[gtk/shortcuts-rebased-again: 60/135] gdk: Remove GDK_RELEASE_MASK



commit 6e9ec0a1793e6483d54a714babc8e9bfa51c70b3
Author: Benjamin Otte <otte redhat com>
Date:   Wed Aug 15 05:50:28 2018 +0200

    gdk: Remove GDK_RELEASE_MASK
    
    It was only ever supported by keybindings and those are gone now.

 gdk/broadway/broadway.js |  1 -
 gdk/gdktypes.h           | 10 ++++------
 gtk/gtkaccelgroup.c      | 30 +-----------------------------
 3 files changed, 5 insertions(+), 36 deletions(-)
---
diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js
index ba2fdcd727..a43ac1d81e 100644
--- a/gdk/broadway/broadway.js
+++ b/gdk/broadway/broadway.js
@@ -91,7 +91,6 @@ const GDK_BUTTON5_MASK  = 1 << 12;
 const GDK_SUPER_MASK    = 1 << 26;
 const GDK_HYPER_MASK    = 1 << 27;
 const GDK_META_MASK     = 1 << 28;
-const GDK_RELEASE_MASK  = 1 << 30;
 
 
 var useDataUrls = window.location.search.includes("datauri");
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index 3cd6472d82..58ccd3b60d 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -200,8 +200,7 @@ typedef enum
  * @GDK_HYPER_MASK: the Hyper modifier
  * @GDK_META_MASK: the Meta modifier
  * @GDK_MODIFIER_RESERVED_29_MASK: A reserved bit flag; do not use in your own code
- * @GDK_RELEASE_MASK: not used in GDK itself. GTK uses it to differentiate
- *  between (keyval, modifiers) pairs from key press and release events.
+ * @GDK_MODIFIER_RESERVED_30_MASK: A reserved bit flag; do not use in your own code
  * @GDK_MODIFIER_MASK: a mask covering all modifier types.
  *
  * A set of bit-flags to indicate the state of modifier keys and mouse buttons
@@ -262,12 +261,11 @@ typedef enum
   GDK_META_MASK     = 1 << 28,
   
   GDK_MODIFIER_RESERVED_29_MASK  = 1 << 29,
-
-  GDK_RELEASE_MASK  = 1 << 30,
+  GDK_MODIFIER_RESERVED_30_MASK  = 1 << 30,
 
   /* Combination of GDK_SHIFT_MASK..GDK_BUTTON5_MASK + GDK_SUPER_MASK
-     + GDK_HYPER_MASK + GDK_META_MASK + GDK_RELEASE_MASK */
-  GDK_MODIFIER_MASK = 0x5c001fff
+     + GDK_HYPER_MASK + GDK_META_MASK */
+  GDK_MODIFIER_MASK = 0x1c001fff
 } GdkModifierType;
 
 /**
diff --git a/gtk/gtkaccelgroup.c b/gtk/gtkaccelgroup.c
index e58342e1bc..3283e515d8 100644
--- a/gtk/gtkaccelgroup.c
+++ b/gtk/gtkaccelgroup.c
@@ -1087,20 +1087,6 @@ is_control (const gchar *string)
           (string[8] == '>'));
 }
 
-static inline gboolean
-is_release (const gchar *string)
-{
-  return ((string[0] == '<') &&
-          (string[1] == 'r' || string[1] == 'R') &&
-          (string[2] == 'e' || string[2] == 'E') &&
-          (string[3] == 'l' || string[3] == 'L') &&
-          (string[4] == 'e' || string[4] == 'E') &&
-          (string[5] == 'a' || string[5] == 'A') &&
-          (string[6] == 's' || string[6] == 'S') &&
-          (string[7] == 'e' || string[7] == 'E') &&
-          (string[8] == '>'));
-}
-
 static inline gboolean
 is_meta (const gchar *string)
 {
@@ -1210,13 +1196,7 @@ gtk_accelerator_parse_with_keycode (const gchar     *accelerator,
     {
       if (*accelerator == '<')
         {
-          if (len >= 9 && is_release (accelerator))
-            {
-              accelerator += 9;
-              len -= 9;
-              mods |= GDK_RELEASE_MASK;
-            }
-          else if (len >= 9 && is_primary (accelerator))
+          if (len >= 9 && is_primary (accelerator))
             {
               accelerator += 9;
               len -= 9;
@@ -1505,7 +1485,6 @@ gchar*
 gtk_accelerator_name (guint           accelerator_key,
                       GdkModifierType accelerator_mods)
 {
-  static const gchar text_release[] = "<Release>";
   static const gchar text_primary[] = "<Primary>";
   static const gchar text_shift[] = "<Shift>";
   static const gchar text_control[] = "<Control>";
@@ -1530,8 +1509,6 @@ gtk_accelerator_name (guint           accelerator_key,
 
   saved_mods = accelerator_mods;
   l = 0;
-  if (accelerator_mods & GDK_RELEASE_MASK)
-    l += sizeof (text_release) - 1;
   if (accelerator_mods & _gtk_get_primary_accel_mod ())
     {
       l += sizeof (text_primary) - 1;
@@ -1564,11 +1541,6 @@ gtk_accelerator_name (guint           accelerator_key,
   accelerator_mods = saved_mods;
   l = 0;
   accelerator[l] = 0;
-  if (accelerator_mods & GDK_RELEASE_MASK)
-    {
-      strcpy (accelerator + l, text_release);
-      l += sizeof (text_release) - 1;
-    }
   if (accelerator_mods & _gtk_get_primary_accel_mod ())
     {
       strcpy (accelerator + l, text_primary);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]