Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mouse binding breaks Firefox #992

Closed
rkoe opened this issue Apr 3, 2024 · 6 comments
Closed

mouse binding breaks Firefox #992

rkoe opened this issue Apr 3, 2024 · 6 comments
Labels
skip:changelog Issue/PR should skip CHANGELOG type:bug Something's broken!

Comments

@rkoe
Copy link

rkoe commented Apr 3, 2024

Upfront Information

  • Fvwm3 version (run: fvwm3 --version)
    fvwm3 1.0.8 (released)
    with support for: ReadLine, XPM, PNG, SVG, Shape, XShm, SM, Bidi text, XRandR, XRender, XCursor, XFT, NLS

  • Linux distribution or BSD name/version
    NixOS 23.11

  • Platform (run: uname -sp)
    Linux unknown

Expected Behaviour

A mouse-binding for "Super_L + left mouse button" should not affect normal clicks (without Super_L) on e.g. Firefox.

Actual Behaviour

Since a recent update (of fvwm, Firefox, or Xorg), some fvwm-mouse-bindings break website-menus in Firefox on Linux.
It worked fine previously.

Details:

  • fvwm-configuration:
    I used Super_L + left mouse-button to move/raise/lower windows,
    which is really handy:

    Mouse 0  W  4  move-and-raise-or-raiselower
    DestroyFunc move-and-raise-or-raiselower
    AddToFunc   move-and-raise-or-raiselower
    + "M" Move
    + "M" Raise
    + "C" RaiseLower
    
  • Website menus:
    Many websites use menus, which open on mouse-hover. Then, you have to click on a menu item, and the link of the menu item opens.
    Minimal example:
    https://www.simple-is-better.org/firefox-dropdown-bug/
    Correct behaviour: Click on A/B/C should result in a opening a.html/b.html/c.html with e.g. "Success: A".

  • Since a recent update, I cannot open any menu item anymore, when the above mouse-binding is defined.
    When I click on a menu item, instead of opening the menu-item-link, the menu is only closed (and a link behind the menu is activated, if there is any).

    If I remove the mouse-binding, it works again.

Enabling logging

Nothing is shown in the logs.

Steps to Reproduce

  • Use the default fvwm-config, and add the mouse-binding above.
  • Does the problem also happen with Fvwm2?
    Yes.
@rkoe rkoe added the type:bug Something's broken! label Apr 3, 2024
@somiaj
Copy link
Collaborator

somiaj commented Apr 3, 2024

If you tried a modified other than '4' does it work, like maybe try ctrl or meta? What does your xmodmap say?

@rkoe
Copy link
Author

rkoe commented Apr 3, 2024

  • Using other modifiers unfortunately does not help -- same behavior with "C", "S" or "M" instead of "4".
  • Using a different function for the mouse-binding also doesn't change the behavior.
  • Restricting to a single mouse-button (instead of 0=any) makes the other buttons work in Firefox-menus again, except the selected mouse-button.
  • e.g. Mouse 1 W C Stick causes the same behavior (except that mouse-button 2 can now be used in the Firefox-menu)
  • xmodmap:
    xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):
    
    shift       Shift_L (0x32),  Shift_R (0x3e)
    lock      
    control     Control_L (0x25),  Control_R (0x69)
    mod1        Alt_L (0x40),  Alt_L (0xcc),  Meta_L (0xcd)
    mod2        Num_Lock (0x4d)
    mod3        ISO_Level5_Shift (0xcb)
    mod4        Super_L (0x85),  BadKey (0x86),  Super_L (0xce),  Hyper_L (0xcf)
    mod5        ISO_Level3_Shift (0x5c)
    

@somiaj
Copy link
Collaborator

somiaj commented Apr 3, 2024

X11 key/mouse press/release events can really only be used by a single application, if fvwm doesn't have a binding setup, it passes the event directly to the application, but if it does have a binding then fvwm intercepts it. I am not quite sure how modifiers are dealt with here, but once fvwm grabs the event it won't be the same to firefox.

As a work around, would say making your custom binding only work on mouse 3, or something that doesn't get in the way of normal operations. You could also move your binding off the window to the title bar / borders instead.

I can't seem to reproduce this on firefox-esr here, so my guess is firefox has changed something and the bug is on their end. I would first see if you can downgrade firefox to an older version, try to find when this changed happend, the easiest way is install firefox-esr, and see if the problem is still there.

I can't think of any of the key/mouse binding code in fvwm3 changed recently. Note firefox is often doing non standard things, there is always something they are breaking.

@somiaj
Copy link
Collaborator

somiaj commented Apr 3, 2024

I have done some looking around, seems there have been various users with issues with menus and some smaller wms. Here are some suggested things to toggle, go to about:config and try to set widget.gtk.ignore-bogus-leave-notify to 1 (it defaults as 2), and if that doesn't work you can try to toggle widget.gtk.grab-pointer to 1 as well.

Anyways here is some info here: https://bugzilla.mozilla.org/show_bug.cgi?id=1819206

And it appears this particular bug is already know, this mentions fvwm2/3 and the exact issue you ran into: https://bugzilla.mozilla.org/show_bug.cgi?id=1805939#c32, I still am unsure if it is firefox or fvwm to blame, I think firefox, but they may think that everything needs to update to their standards.

From that comment it sounds like firefox is grabbing the events with AnyModifiers which it cannot since fvwm has already claimed the event for modifier 4 via your key binding. You may want to move this over to firefox, as it seems like their bug to me.

@ThomasAdam
Copy link
Member

For now, I'm afraid this isn't something I feel fvwm is going to be able to "workaround", and the fix ultimately relies on this being done in Firefox.

I hope this is something they're prepared to do.

@rkoe
Copy link
Author

rkoe commented Apr 3, 2024

Thanks a lot!

  • With Firefox-setting widget.gtk.ignore-bogus-leave-notify 1 it works again! :)
  • I had previously submitted a webcompat-issue to Firefox, but it got closed. But with your additional information, I might open a Firefox-issue again.

@ThomasAdam ThomasAdam added the skip:changelog Issue/PR should skip CHANGELOG label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip:changelog Issue/PR should skip CHANGELOG type:bug Something's broken!
Projects
None yet
Development

No branches or pull requests

3 participants