mzur / gnome-shell-wsmatrix

GNOME shell extension to arrange workspaces in a two-dimensional grid with workspace thumbnails
GNU General Public License v3.0
464 stars 58 forks source link

fix modifier mask captures reserved modifiers #198

Closed ebeem closed 2 years ago

ebeem commented 2 years ago

Sometimes for a very unknown reason, GNOME adds reserved modifiers to the event retrieved from Clutter.get_current_event().get_state(). This causes an incorrect modifier mask to be calculated and a blink behavior if the popup timeout is 0.

To resolve this issue, we need to and the Clutter.get_current_event().get_state() with Clutter.ModifierType.MODIFIER_MASK which is a mask the contains a number to clear all the flags of the reserved modifiers.

reference: https://valadoc.org/clutter-1.0/Clutter.ModifierType.html

Note that Clutter may add internal values to events which include reserved values such as MODIFIER_RESERVED_13_MASK. Your code should preserve and ignore them. You can use MODIFIER_MASK to remove all reserved values.