Menu

#1187 fluxbox alters left mouse clicks in a way that confuses my web browser

v1.3.7
open
nobody
None
5
2023-02-06
2021-05-04
No

I'm on fluxbox 1.3.7 and Xorg 7.7, running in Tiny Core Linux 12 x86_64. The bug affects Brave web browser 1.22.70 but may also affect other browsers.

I browse the web with Brave browser inside a fluxbox session. I've noticed that on many websites with menus that appear when cursor hovers, left-clicking on any menu item simply causes menu to disappear. On same machine with a different window manager (e.g., FLWM) or no window manager, problem goes away. It seems fluxbox intercepts left mouse clicks and alters them in a way that confuses the web browser.

I already tried deleting ~/.fluxbox/keys and restarting fluxbox, but the problem persists. I also tried unchecking "Use system title bar and borders" in the browser settings but the problem persists.

Discussion

  • crpb

    crpb - 2021-10-19

    I have the same issues with v1.3.5.
    It seems to me that the Chrome-Engine is the common factor.
    I can reproduce the problem in Vivaldi, Chromium and Google-Chrome.
    Only workaround to open the Links are sometimes with a click on Mouse-Wheel to open in a new Tab or if the Site supports it just an Enter and sometimes i <tab> from a near Position and then press <enter> when i can See some indication that i have selected the Link. *-)
    Firefox-ESR and Falkon seem to work.</enter></tab>

    % dpkg -l |grep -E 'chromium|vivaldi|google' |grep -v fonts
    ii  chromium                                         93.0.4577.82-1                        amd64        web browser
    ii  chromium-common                                  93.0.4577.82-1                        amd64        web browser - common resources used by the chromium packages
    ii  chromium-sandbox                                 93.0.4577.82-1                        amd64        web browser - setuid security sandbox for chromium
    ii  google-chrome-stable                             94.0.4606.81-1                        amd64        The web browser from Google
    ii  vivaldi-stable                                   4.3.2439.44-1                         amd64        Experience the web in a whole new way with Vivaldi.
    
    
    ii  fluxbox                                          1.3.5-2+b2                            amd64        Highly configurable and low resource X11 Window manager
    

    I think the problems were also present with the Debian-10 packages.

    I just switched back to good ol' fluxbox and now something silly like that... :-/..

     

    Last edit: crpb 2021-10-19
  • Bruno Dantas

    Bruno Dantas - 2021-10-19

    While I have not found a definite cause or proper fix, I have found an effective workaround: Starting Brave and Chromium with the --disable-features=SendMouseLeaveEvents command line option makes the problem go away :) I have no experience with Chrome or Vivaldi.

     

    Last edit: Bruno Dantas 2021-10-19
    • crpb

      crpb - 2021-10-19

      Thank you Bruno, works on all of them. :-). I think all of them are using the same switches. The playerctl MPRIS-Sessions are also just Chromium.instanceNNNNNNN for any of them which can be a hassle...
      @akir maybe with Fluxbox 1.4 it will be fixed? ggg ..
      i think i should revive my znc in freenode..

       
  • Matthias S. Benkmann

    An example for this issue is here:

    https://jlcpcb.com/

    Hover over "Resources", a navigation menu appears. Try to click "SMT Parts library". The navigation menu disappears but you don't go to the correct page. Instead what happens is you go to the page you would have gone to had you clicked the same spot on the screen without the nav menu open.

    Some relevant code from the page:

    <div class="subMenuBox over" onmouseover="changeNav(1)" onmouseleave="closeNav(1)" style="display: none;">

    So apparently the mouse leave event triggers the disappearing of the navigation menu. It looks like what is supposed to happen is that the left click on the link is supposed to be registered by the browser and processed before the mouseleave event fires. But when running under fluxbox the mouseleave event fires first, causing the popup to go away and the left click to be evaluated too late.

    Is it possible that Fluxbox processes/sends X events related to clicks, mapping and unmapping of windows in a different order than other window managers?
    Does Fluxbox delay left click or left mouse button up events in some manner?

    I am noticing another problem that seems to be related. In VS Code (which is also built on the chrome engine) some horizontal and vertical scrollbars don't seem to work when run under Fluxbox. You cannot pull them with the left mouse. Instead the mouse events seem to go to the underlying window under the semitransparent scrollbars.

     

    Last edit: Matthias S. Benkmann 2021-11-24
    • Jan Fryblik

      Jan Fryblik - 2022-05-19

      I have the same issue as described above with certain pages in browsers using Chrome engine and I can confirm your guess. When I arrange page so that I have link under item of Javascript dropdown menu. Click is performed on underlying link and not on item within menu. (Please see attached video.)

      I'm using Arch Linux and Fluxbox. Whole issue started approx. 6-9 months ago. I'm not exactly sure when, originally I thought it is browser (Vivaldi) issue. IMHO, it started with a xorg-server or xwayland update, but I'm guessing.

      I've also noticed similar issue with desktop Discord client, when I do right click on any channel message, then Add reaction, which opens submenu and no item can be selected by mouse from this menu. I need to use keyboard to select item (reaction).

      Hopefully this helps you somehow. It is really strange issue.

      PS: Thank you for your work!

       

      Last edit: Jan Fryblik 2022-05-19
    • crpb

      crpb - 2022-05-20

      EDIT:
      I just tried it with normal start of Chromium and it did work for me.
      I haven't checked if the problem still persists as i always run my Browsers with the "--disable-features=SendMouseLeaveEvents" switch since i know of it.

      Nevermind, did a reboot after updates and checked with vivaldi and chromium and the problem still persists..

      Fluxbox is compiled from this repo.

      > dpkg -l |grep xorg\ 
      ii  xorg                                          1:7.7+23                               amd64        X.Org X Window System
      ii  xserver-xorg                                  1:7.7+23                               amd64        X.Org X server
      ii  xserver-xorg-core                             2:21.1.3-2+b1                          amd64        Xorg X server - core server
      

      I will do some further testing with other Browsers.

       

      Last edit: crpb 2022-05-20
    • Dmytro Bagrii

      Dmytro Bagrii - 2022-08-01

      Is it possible that Fluxbox processes/sends X events related to clicks, mapping and unmapping of windows in a different order than other window managers?

      Fluxbox grabs Button1 to implement Click-to-Focus (see FluxboxWindow::grabButtons() in src/Window.cc). This causes LeaveNotify and EnterNotify events to be sent before ButtonPress event. In most cases this behavior doesn't affect applications as they track both Leave and Enter events in proper way. But it breaks behavior of dynamically changing elements.

       

      Last edit: Dmytro Bagrii 2022-08-01
  • Dmytro Bagrii

    Dmytro Bagrii - 2022-07-29

    I encountered with similar problem in Meld 3.21: left button mouse click doesn't work at some places with Fluxbox. The bug appears only with Fluxbox. With Xfce4, Weston and barebone X server without window manager it works as expected.
    More details in Meld bug report: https://gitlab.gnome.org/GNOME/meld/-/issues/694
    Should i create a separate ticket?

     
  • crpb

    crpb - 2022-11-18

    With basically any electron app(as those are chrome-based to my understanding) i have the same issue.
    I really would like a solution to that as it is a bit irritating to create wrappers for any application i use.
    I currently get around it with basically those lines..

    echo '~/.local/opt/appname/appname-bin ---disable-features=SendMouseLeaveEvents' > ~/.local/bin/appname-bin
    chmod +x ~/.local/bin/appname-bin
    

    And to make ~/.local/bin available for gmrun (instead of fbrun) i added these lines in ~/.fluxbox/startup to make sure it can resolve the $PATH.

    #!/bin/sh
    
    # make sure ~/.local/bin is available in $PATH
    [ -d "$HOME/.local/bin" ] && {
      [ "${PATH#*"$HOME/.local/bin"}" != "${PATH}" ] \
      || PATH="$HOME/.local/bin:${PATH}";
    }
    

    But this doesn't work always because some of those APPS have "Update-Mechanisms" with which they are restarted without the fix....

     

    Last edit: crpb 2022-11-18
  • Nicola

    Nicola - 2023-02-06

    I have the same issue from many months. Any idea when it will be resolved? I've temporally switched to firefox, but I prefer Opera Browser (a lot)... maybe I have to change WM after 16years?

     
    • crpb

      crpb - 2023-02-06

      Hey Nicola,

      if it's just Opera you could do something similar like me by just creating an executable in either /usr/local/bin or ~/.local/bin or wherever your $PATH looks into and replace "chromium" with whatever the opera-browser is called with

      % cat ~/.local/bin/chromium-fixed
      chromium --disable-features=SendMouseLeaveEvents
      

      You just have to start the Browser with that command. It will not work if you open Links with an closed Browser and whatever your Distribution/Program calls.
      I usually open my Browsers after login in by e.g. <Alt><F2>chromium-fixed<Enter> and let it run until i logout/reboot.
      AFAIK you could also create a file /usr/local/bin/opera in which you call /usr/bin/opera --disable-features=SendMouseLeaveEvents if that is the correct executable-name. You will have to use the full Path because otherwise it will end in an loop :P.
      That way it also should work from the Menu and Applications.

       
      • Dmytro Bagrii

        Dmytro Bagrii - 2023-02-06

        You can create .desktop file for your wrapper in ~/.local/share/applications/ and select it as default browser with xdg-settings set default-web-browser your_browser.desktop. Or just check what .desktop file is for default browser with xdg-settings get default-web-browser and modify command line in existing one.

         

Log in to post a comment.