Solved Annoying issue with Xfce, Virtualbox and Arrow Down key

Hi folks,

after reinstalling again FreeBSD + Xfce4 on my Virtual(box) Machine (which is my daily driver) I am experiencing a very annoying issue:

Every two or three time pressing the "arrow down" key the window loses the focus and the focus jumps to another window, it can cycle all the windows open.

I can't determine if the issue belongs to XFWM, Xorg or VirtualBox.

With this XEV output you can see two time arrow down and then the lost of the focus:

Code:
KeyPress event, serial 36, synthetic NO, window 0x3c00001,
    root 0x51d, subw 0x0, time 11215413, (-538,-611), root:(45,154),
    state 0x10, keycode 116 (keysym 0xff54, Down), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x3c00001,
    root 0x51d, subw 0x0, time 11215542, (-538,-611), root:(45,154),
    state 0x10, keycode 116 (keysym 0xff54, Down), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

FocusOut event, serial 36, synthetic NO, window 0x3c00001,
    mode NotifyNormal, detail NotifyNonlinear

The issue is making the use of the OS utterly complicated since you can not scroll down with the arrow down kwy on anything and must mixing mouse and page up & down.

Where can I get other info to break down this weird behavior?

Thanks!

Code:
uname -a
FreeBSD nag09 13.0-RELEASE-p8 FreeBSD 13.0-RELEASE-p8 #0: Tue Mar 15 09:36:28 UTC 2022     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64


Code:
xfce4-wm-4.16.1_1
Name           : xfce4-wm
Version        : 4.16.1_1
Installed on   : Mon Apr  4 12:55:57 2022 EDT
Origin         : x11-wm/xfce4-wm
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : xfce x11-wm
Licenses       : GPLv2
Maintainer     : xfce@FreeBSD.org
WWW            : https://xfce.org/
Comment        : Xfce's window manager
Options        :
    NLS            : on
    STARTUP        : on
Shared Libs required:
    libXRes.so.1
    libXext.so.6
    libpango-1.0.so.0
    libcairo.so.2
    libepoxy.so.0
    libgtk-3.so.0
    libICE.so.6
    libcairo-gobject.so.2
    libatk-1.0.so.0
    libxfce4ui-2.so.0
    libxfconf-0.so.3
    libSM.so.6
    libXcomposite.so.1
    libgdk_pixbuf-2.0.so.0
    libgio-2.0.so.0
    libXfixes.so.3
    libX11.so.6
    libwnck-3.so.0
    libxfce4kbd-private-3.so.0
    libgobject-2.0.so.0
    libglib-2.0.so.0
    libXpresent.so.1
    libharfbuzz.so.0
    libstartup-notification-1.so.0
    libXrender.so.1
    libXdamage.so.1
    libxfce4util.so.7
    libintl.so.8
    libXrandr.so.2
    libgdk-3.so.0
    libXinerama.so.1
    libpangocairo-1.0.so.0
Annotations    :
    FreeBSD_version: 1300139
    repo_type      : binary
    repository     : FreeBSD
Flat size      : 2.16MiB
Description    :
The Xfce 4 window manager manages the placement of application windows
on the screen, provides window decorations, and manages work-
spaces or virtual desktops.
 
Strange. Are you sure you don't unintentionally click or scroll outside the focused window? Xfwm has by default the strange behaviour of switching focus to the window you scroll upon, even if you don't click anywhere.
 
Strange. Are you sure you don't unintentionally click or scroll outside the focused window? Xfwm has by default the strange behaviour of switching focus to the window you scroll upon, even if you don't click anywhere.

I use XFCE almost everywhere this is the first time I am experiencing this weird behavior... I can replicate the issue with just one finger and anything else... ?
 
Apparently the issue was within VirtualBox...

For some unknown reason the mouse scrollwheel causes Firefox to go back and forth on any tab history currently in use, to fix this I run this command at each login through xfce4-session:

/usr/local/bin/xmodmap -e "pointer = 1 2 3 4 5 6 7 0 0 0 11 12"

Disabling that command fixes the keyboard issue but reintroduces the Firefox bug. Running the same command manually after the login has fixed the Firefox issue without affecting the arrow down key!

Solution?

sh -c '/bin/sleep 3 && /usr/local/bin/xmodmap -e "pointer = 1 2 3 4 5 6 7 0 0 0 11 12"'
 
Unfortunately the fix is not working today so what happened last time was totally a coincidence... ?
 
Back
Top