[gtk/keymap-rework-2: 10/13] Drop gtk_accelerator_set_default_mod_mask



commit 599618fd34279813f5830ca19b5fe7ac6c5e8996
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Apr 5 21:43:57 2020 -0400

    Drop gtk_accelerator_set_default_mod_mask
    
    Our new approach to modifiers works with a fixed set,
    there is really no need to customize the modifier
    masks if the backends are all supposed to deliver
    the same modifiers.

 docs/reference/gtk/gtk4-sections.txt |  1 -
 gtk/gtkaccelgroup.c                  | 40 +++++-------------------------------
 gtk/gtkaccelgroup.h                  |  6 ++----
 3 files changed, 7 insertions(+), 40 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 9c58ea3b28..f5462d9d5d 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -60,7 +60,6 @@ gtk_accelerator_get_label
 gtk_accelerator_parse_with_keycode
 gtk_accelerator_name_with_keycode
 gtk_accelerator_get_label_with_keycode
-gtk_accelerator_set_default_mod_mask
 gtk_accelerator_get_default_mod_mask
 </SECTION>
 
diff --git a/gtk/gtkaccelgroup.c b/gtk/gtkaccelgroup.c
index cd85742829..86f3a50621 100644
--- a/gtk/gtkaccelgroup.c
+++ b/gtk/gtkaccelgroup.c
@@ -42,14 +42,6 @@
  * textual representations of keyboard accelerators.
  */
 
-/* --- variables --- */
-static guint default_accel_mod_mask = GDK_CONTROL_MASK|
-                                      GDK_SHIFT_MASK|
-                                      GDK_ALT_MASK|
-                                      GDK_SUPER_MASK|
-                                      GDK_HYPER_MASK|
-                                      GDK_META_MASK;
-
 
 /* --- functions --- */
 /**
@@ -993,42 +985,20 @@ gtk_accelerator_print_label (GString        *gstring,
     }
 }
 
-/**
- * gtk_accelerator_set_default_mod_mask:
- * @default_mod_mask: accelerator modifier mask
- *
- * Sets the modifiers that will be considered significant for keyboard
- * accelerators. The default mod mask depends on the GDK backend in use,
- * but will typically include #GDK_CONTROL_MASK | #GDK_SHIFT_MASK |
- * #GDK_ALT_MASK | #GDK_SUPER_MASK | #GDK_HYPER_MASK | #GDK_META_MASK.
- * In other words, Control, Shift, Alt, Super, Hyper and Meta. Other
- * modifiers will by default be ignored by #GtkAccelGroup.
- *
- * You must include at least the three modifiers Control, Shift
- * and Alt in any value you pass to this function.
- *
- * The default mod mask should be changed on application startup,
- * before using any accelerator groups.
- */
-void
-gtk_accelerator_set_default_mod_mask (GdkModifierType default_mod_mask)
-{
-  default_accel_mod_mask = (default_mod_mask & GDK_MODIFIER_MASK) |
-    (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_ALT_MASK);
-}
-
 /**
  * gtk_accelerator_get_default_mod_mask:
  *
  * Gets the modifier mask.
  *
  * The modifier mask determines which modifiers are considered significant
- * for keyboard accelerators. See gtk_accelerator_set_default_mod_mask().
+ * for keyboard accelerators. This includes all keyboard modifiers except
+ * for %GDK_LOCK_MASK.
  *
- * Returns: the default accelerator modifier mask
+ * Returns: the modifier mask for accelerators
  */
 GdkModifierType
 gtk_accelerator_get_default_mod_mask (void)
 {
-  return default_accel_mod_mask;
+  return GDK_CONTROL_MASK|GDK_SHIFT_MASK|GDK_ALT_MASK|
+         GDK_SUPER_MASK|GDK_HYPER_MASK|GDK_META_MASK;
 }
diff --git a/gtk/gtkaccelgroup.h b/gtk/gtkaccelgroup.h
index 69d0a3f227..6e38622223 100644
--- a/gtk/gtkaccelgroup.h
+++ b/gtk/gtkaccelgroup.h
@@ -67,10 +67,8 @@ gchar*   gtk_accelerator_get_label_with_keycode (GdkDisplay      *display,
                                                  guint            keycode,
                                                  GdkModifierType  accelerator_mods);
 GDK_AVAILABLE_IN_ALL
-void    gtk_accelerator_set_default_mod_mask (GdkModifierType  default_mod_mask);
-GDK_AVAILABLE_IN_ALL
-GdkModifierType
-        gtk_accelerator_get_default_mod_mask (void);
+GdkModifierType gtk_accelerator_get_default_mod_mask (void);
+
 
 G_END_DECLS
 


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