[mutter] backend/x11: Notify whenever the layout group changes



commit a81d4aed7aa681672e181b6f6999057d1700df62
Author: Jonas Ådahl <jadahl gmail com>
Date:   Thu Aug 17 17:03:28 2017 +0800

    backend/x11: Notify whenever the layout group changes
    
    Will be used to trigger keyboard binding rebuild.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786408

 src/backends/x11/meta-backend-x11.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c
index 863749e..2c49690 100644
--- a/src/backends/x11/meta-backend-x11.c
+++ b/src/backends/x11/meta-backend-x11.c
@@ -283,8 +283,6 @@ handle_host_xevent (MetaBackend *backend,
 
       if (xkb_ev->any.device == META_VIRTUAL_CORE_KEYBOARD_ID)
         {
-          int layout_group;
-
           switch (xkb_ev->any.xkb_type)
             {
             case XkbNewKeyboardNotify:
@@ -292,8 +290,20 @@ handle_host_xevent (MetaBackend *backend,
               keymap_changed (backend);
               break;
             case XkbStateNotify:
-              layout_group = xkb_ev->state.locked_group;
-              priv->keymap_layout_group = layout_group;
+              if (xkb_ev->state.changed & XkbGroupLockMask)
+                {
+                  int layout_group;
+                  gboolean layout_group_changed;
+
+                  layout_group = xkb_ev->state.locked_group;
+                  layout_group_changed =
+                    (int) priv->keymap_layout_group != layout_group;
+                  priv->keymap_layout_group = layout_group;
+
+                  if (layout_group_changed)
+                    meta_backend_notify_keymap_layout_group_changed (backend,
+                                                                     layout_group);
+                }
               break;
             default:
               break;


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