Closed Bug 1468670 Opened 2 years ago Closed 2 years ago

[Wayland] Alt modifier key is not handled on wayland

Categories

(Core :: Widget: Gtk, defect)

All
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: ashie, Assigned: ashie)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

From https://bugzilla.redhat.com/show_bug.cgi?id=1470031

Description of problem:

  When running firefox(cairo-gtk3-wayland) on wayland, Alt modifier key is not handled.

Steps to Reproduce:

  1. Launch Firefox
  2. Visit some pages
  3. Press Alt + ← or Alt + →

Expected results:

  Fire "GoForward" or "GoBack" event, then moving visited pages which listed on history in current tab.

Actual results:

  Nothing happens

Additional info:

  Firefox handles modifier keys by itself.
  It depends on X11.
  And when not existing X11, mModifierMasks is always set as 0.

    * https://dxr.mozilla.org/mozilla-central/rev/75a32b57132f8cba42779555662a057a0416a313/widget/gtk/nsGtkKeyUtils.cpp#
    * https://dxr.mozilla.org/mozilla-central/rev/75a32b57132f8cba42779555662a057a0416a313/widget/gtk/nsGtkKeyUtils.cpp#433
Blocks: wayland
Summary: [Wayland] Alt modifier key is not handled on weston → [Wayland] Alt modifier key is not handled on wayland
It's reproduced on GNOME Shell & Weston.
(In reply to Takuro Ashie from comment #0)
>     *
> https://dxr.mozilla.org/mozilla-central/rev/
> 75a32b57132f8cba42779555662a057a0416a313/widget/gtk/nsGtkKeyUtils.cpp#

Sorry, the line number is missing:

https://dxr.mozilla.org/mozilla-central/rev/75a32b57132f8cba42779555662a057a0416a313/widget/gtk/nsGtkKeyUtils.cpp#176
Assignee: nobody → ashie
Thanks, I'll look at it.
Component: Graphics → Widget: Gtk
Comment on attachment 8985299 [details]
Bug 1468670 - Enablel Alt modifier key on Wayland

https://reviewboard.mozilla.org/r/250924/#review257456

Looks good but please move the Wayland setup to a dedicated routine - see commend below. Thanks!

::: widget/gtk/nsGtkKeyUtils.cpp:198
(Diff revision 1)
>  
>      mModifierKeys.Clear();
>      memset(mModifierMasks, 0, sizeof(mModifierMasks));
>  
>      if (GDK_IS_X11_DISPLAY(gdk_display_get_default()))
>          InitBySystemSettings();

Please remove it to InitBySystemSettingsX11 (or similar) to stress that it's X11 only.

::: widget/gtk/nsGtkKeyUtils.cpp:200
(Diff revision 1)
>      memset(mModifierMasks, 0, sizeof(mModifierMasks));
>  
>      if (GDK_IS_X11_DISPLAY(gdk_display_get_default()))
>          InitBySystemSettings();
> +    else
> +        mModifierMasks[INDEX_ALT] = 1 << 3;

Please create a new method (InitBySystemSettingsWayland() or so) and move the init here. I guess we'd need more key settings so we can configure all there.
Attachment #8985299 - Flags: review?(stransky)
Comment on attachment 8985299 [details]
Bug 1468670 - Enablel Alt modifier key on Wayland

https://reviewboard.mozilla.org/r/250924/#review258132
Comment on attachment 8985299 [details]
Bug 1468670 - Enablel Alt modifier key on Wayland

https://reviewboard.mozilla.org/r/250924/#review257456

> Please create a new method (InitBySystemSettingsWayland() or so) and move the init here. I guess we'd need more key settings so we can configure all there.

Done.

To handle it properly, probably we need to use wl_keyboard and xkb.
I'll file a new bug for it after this patch is merged.
Comment on attachment 8985299 [details]
Bug 1468670 - Enablel Alt modifier key on Wayland

https://reviewboard.mozilla.org/r/250924/#review258138
Attachment #8985299 - Flags: review?(stransky) → review+
Keywords: checkin-needed
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/98620eaa1b5c
Enablel Alt modifier key on Wayland r=stransky
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/98620eaa1b5c
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
(In reply to Takuro Ashie [:ashie] from comment #8)
> To handle it properly, probably we need to use wl_keyboard and xkb.
> I'll file a new bug for it after this patch is merged.

bug1470047

I'm also seeing this on Firefox 66.0b6 developer edition under Wayland, build 20190208180655.

It seems to effect this too: bug1511973

:ashie: I am having seemingly the same problem, as this one was closed, I thought it's better to refile: #1538052

You need to log in before you can comment on or make changes to this bug.