Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gtk gtk
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,605
    • Issues 1,605
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 217
    • Merge requests 217
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gtkgtk
  • Issues
  • #4913
Closed
Open
Issue created May 11, 2022 by Thomas Jost@Schnouki

GDK_SUPER_MASK is not set on Super key press events on Wayland / wlroots

When handling a key press event for something like "Super+/", the GDK_SUPER_MASK bit is not set on Sway; only the GDK_MOD4_MASK bit is. This is different from the documented behavior, which I could reproduce using X11 with Xwayland.

Steps to reproduce

  1. Download the following script: https://paste.sr.ht/~schnouki/9f76166c5287de6a1e7d3d3f1537fe2fbd511d5e (sorry, didn't try to do it in C; if needed please let me know and I'll do what I can)

  2. Run it under Sway, hit "Super+/": on the console, the following output appears:

    $ ./gtk-events.py
    event.keyval=65515 event.string='' event.state=<flags 0 of type Gdk.ModifierType>
    event.keyval=47 event.string='/' event.state=<flags GDK_MOD4_MASK of type Gdk.ModifierType>

    First event is the Super_L key on its own, 2nd one is Super+/. There's GDK_MOD4_MASK in the modifiers, but no GDK_SUPER_MASK.

  3. Run the same script under Xwayland and do the same thing:

    $ WAYLAND_DISPLAY="" XDG_SEAT="" ./gtk-events.py
    event.keyval=65515 event.string='' event.state=<flags 0 of type Gdk.ModifierType>
    event.keyval=47 event.string='/' event.state=<flags GDK_MOD4_MASK | GDK_SUPER_MASK of type Gdk.ModifierType>

    This time the GDK_SUPER_MASK is set.

Current behavior

The GDK_SUPER_MASK bit is not set on key press events when Super is pressed, only GDK_MOD4_MASK is.

Expected outcome

The GDK_SUPER_MASK bit should be set too.

Version information

  • GTK 3.24.33 (from the Arch repo)
  • Arch Linux
  • Sway 1.7, wlroots 0.15.1, xorg-xwayland 22.1.1

Additional information

This was found while trying to understand a bug in recent Git versions of Emacs: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55362. It used to work because Emacs didn't rely on GDK modifier flags and re-implemented a similar mechanism, which was recently removed.

Assignee
Assign to
Time tracking