[Xfce4-commits] [xfce/libxfce4ui] 01/01: Fix grabbing shortcuts with <Super> modifier (bug #10373)

noreply at xfce.org noreply at xfce.org
Wed Feb 18 17:18:01 CET 2015


This is an automated email from the git hooks/post-receive script.

hjudt pushed a commit to branch master
in repository xfce/libxfce4ui.

commit b680e8b9f6b0cf1c706ed430a548590daa1f4565
Author: Harald Judt <h.judt at gmx.at>
Date:   Wed Feb 18 17:03:23 2015 +0100

    Fix grabbing shortcuts with <Super> modifier (bug #10373)
    
    This is only considered a hack but has been proven to fix this bug, so far
    without doing any harm. It turns mod4 modifiers into the Super modifier
    and enables filtering for Super. In short, it restores proper functionality
    for use-cases like the following:
    
    1) Assign xfrun4 to <F12>.
    2) Assign xfce4-about to <Super>-<F12>.
    
    Expected behaviour:
    Pressing <Super>-<F12> will execute xfce4-about, as assigned in step 2).
    
    Actual behaviour:
    Pressing <Super>-<F12> will execute xfrun4, not xfce4-about.
    
    It is not clear why some people can reproduce this bug while others cannot.
    Marking this as FIX ME in the comment because a proper solution would be
    desirable.
---
 libxfce4kbd-private/xfce-shortcuts-grabber.c |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/libxfce4kbd-private/xfce-shortcuts-grabber.c b/libxfce4kbd-private/xfce-shortcuts-grabber.c
index 211b606..b51e0d6 100644
--- a/libxfce4kbd-private/xfce-shortcuts-grabber.c
+++ b/libxfce4kbd-private/xfce-shortcuts-grabber.c
@@ -373,7 +373,7 @@ find_event_key (const gchar                *shortcut,
 
   TRACE ("Comparing to %s", shortcut);
 
-  if ((key->modifiers & (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK))
+  if ((key->modifiers & (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK | GDK_SUPER_MASK))
       == (context->modifiers)
       && (key->keyval == context->keyval))
     {
@@ -439,6 +439,20 @@ xfce_shortcuts_grabber_event_filter (GdkXEvent            *gdk_xevent,
   if ((modifiers & GDK_SHIFT_MASK) && (consumed & GDK_SHIFT_MASK))
     consumed &= ~GDK_SHIFT_MASK;
 
+  /*
+   * !!! FIX ME !!!
+   * Turn MOD4 into SUPER key press events. Although it is not clear if
+   * this is a proper solution, it fixes bug #10373 which some people
+   * experience without breaking functionality for other users.
+   */
+  if (modifiers & GDK_MOD4_MASK)
+    {
+      modifiers &= ~GDK_MOD4_MASK;
+      modifiers |= GDK_SUPER_MASK;
+      consumed &= ~GDK_MOD4_MASK;
+      consumed &= ~GDK_SUPER_MASK;
+    }
+
   modifiers &= ~consumed;
   modifiers &= mod_mask;
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list