[gtk/wip/ebassi/shortcut: 162/203] gdk: Remove GDK_RELEASE_MASK



commit 99145388c9398b31fe3039fadc72d4aec6d9ac46
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 |  3 +--
 gdk/gdktypes.h           | 10 ++++------
 gtk/gtkaccelgroup.c      | 30 +-----------------------------
 3 files changed, 6 insertions(+), 37 deletions(-)
---
diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js
index ba2fdcd727..39e359e17d 100644
--- a/gdk/broadway/broadway.js
+++ b/gdk/broadway/broadway.js
@@ -75,7 +75,7 @@ const GDK_CROSSING_GRAB = 1;
 const GDK_CROSSING_UNGRAB = 2;
 
 // GdkModifierType
-const GDK_SHIFT_MASK = 1 << 0;
+const GDK_SHIFT_MASK    = 1 << 0;
 const GDK_LOCK_MASK     = 1 << 1;
 const GDK_CONTROL_MASK  = 1 << 2;
 const GDK_MOD1_MASK     = 1 << 3;
@@ -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 c5e237fffc..72ed69466f 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 0dea8cd6f7..59f9af2590 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]