~ubuntu-branches/ubuntu/lucid/gnome-settings-daemon/lucid-proposed

« back to all changes in this revision

Viewing changes to debian/patches/92_keyboard_settings_update.patch

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-03-10 00:15:32 UTC
  • Revision ID: james.westby@ubuntu.com-20100310001532-363efxx2zwfxcm73
Tags: 2.29.92-0ubuntu2
* debian/patches/07_dont_display_autostart.patch:
  - don't show the gnome-settings-daemon autostart in the session capplet,
    the description is confusing and it's a required component (lp: #146918)
* debian/patches/92_keyboard_settings_update.patch:
  - upstream change to apply xkb settings to newly connected keyboards
    (lp: #427168)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Subject: [PATCH] Apply all keyboard settings to new keyboards
 
2
 
 
3
When libxklavier sends in a new device event, apply all the
 
4
settings to the new keyboard.
 
5
 
 
6
https://bugzilla.gnome.org/show_bug.cgi?id=610245
 
7
---
 
8
 plugins/keyboard/gsd-keyboard-manager.c |   14 ++++++++++++--
 
9
 plugins/keyboard/gsd-keyboard-manager.h |    1 +
 
10
 plugins/keyboard/gsd-keyboard-xkb.c     |   10 ++++++++--
 
11
 plugins/keyboard/gsd-keyboard-xkb.h     |    5 +++--
 
12
 4 files changed, 24 insertions(+), 6 deletions(-)
 
13
 
 
14
diff --git a/plugins/keyboard/gsd-keyboard-manager.c b/plugins/keyboard/gsd-keyboard-manager.c
 
15
index c1454e4..2855d41 100644
 
16
--- a/plugins/keyboard/gsd-keyboard-manager.c
 
17
+++ b/plugins/keyboard/gsd-keyboard-manager.c
 
18
@@ -370,6 +370,16 @@ apply_settings (GConfClient        *client,
 
19
         gdk_error_trap_pop ();
 
20
 }
 
21
 
 
22
+void
 
23
+gsd_keyboard_manager_apply_settings (GsdKeyboardManager *manager)
 
24
+{
 
25
+        GConfClient *client;
 
26
+
 
27
+        client = gconf_client_get_default ();
 
28
+        apply_settings (client, 0, NULL, manager);
 
29
+        g_object_unref (client);
 
30
+}
 
31
+
 
32
 static gboolean
 
33
 start_keyboard_idle_cb (GsdKeyboardManager *manager)
 
34
 {
 
35
@@ -386,14 +396,14 @@ start_keyboard_idle_cb (GsdKeyboardManager *manager)
 
36
 
 
37
         /* Essential - xkb initialization should happen before */
 
38
         gsd_keyboard_xkb_set_post_activation_callback ((PostActivationCallback) gsd_load_modmap_files, NULL);
 
39
-        gsd_keyboard_xkb_init (client);
 
40
+        gsd_keyboard_xkb_init (client, manager);
 
41
 
 
42
 #ifdef HAVE_X11_EXTENSIONS_XKB_H
 
43
         numlock_xkb_init (manager);
 
44
 #endif /* HAVE_X11_EXTENSIONS_XKB_H */
 
45
 
 
46
         /* apply current settings before we install the callback */
 
47
-        apply_settings (client, 0, NULL, manager);
 
48
+        gsd_keyboard_manager_apply_settings (manager);
 
49
 
 
50
         manager->priv->notify = gconf_client_notify_add (client, GSD_KEYBOARD_KEY,
 
51
                                                          (GConfClientNotifyFunc) apply_settings, manager,
 
52
diff --git a/plugins/keyboard/gsd-keyboard-manager.h b/plugins/keyboard/gsd-keyboard-manager.h
 
53
index 42e2600..434e652 100644
 
54
--- a/plugins/keyboard/gsd-keyboard-manager.h
 
55
+++ b/plugins/keyboard/gsd-keyboard-manager.h
 
56
@@ -51,6 +51,7 @@ GsdKeyboardManager *       gsd_keyboard_manager_new                 (void);
 
57
 gboolean                gsd_keyboard_manager_start               (GsdKeyboardManager *manager,
 
58
                                                                GError         **error);
 
59
 void                    gsd_keyboard_manager_stop                (GsdKeyboardManager *manager);
 
60
+void                    gsd_keyboard_manager_apply_settings      (GsdKeyboardManager *manager);
 
61
 
 
62
 G_END_DECLS
 
63
 
 
64
diff --git a/plugins/keyboard/gsd-keyboard-xkb.c b/plugins/keyboard/gsd-keyboard-xkb.c
 
65
index ff31149..748ddd2 100644
 
66
--- a/plugins/keyboard/gsd-keyboard-xkb.c
 
67
+++ b/plugins/keyboard/gsd-keyboard-xkb.c
 
68
@@ -44,6 +44,8 @@
 
69
 
 
70
 #define GTK_RESPONSE_PRINT 2
 
71
 
 
72
+static GsdKeyboardManager *manager = NULL;
 
73
+
 
74
 static XklEngine *xkl_engine;
 
75
 static XklConfigRegistry *xkl_registry = NULL;
 
76
 
 
77
@@ -140,6 +142,7 @@ apply_desktop_settings (void)
 
78
        if (!inited_ok)
 
79
                return;
 
80
 
 
81
+       gsd_keyboard_manager_apply_settings (manager);
 
82
        gkbd_desktop_config_load_from_gconf (&current_config);
 
83
        /* again, probably it would be nice to compare things
 
84
           before activating them */
 
85
@@ -813,7 +816,8 @@ gsd_keyboard_new_device (XklEngine * engine)
 
86
 }
 
87
 
 
88
 void
 
89
-gsd_keyboard_xkb_init (GConfClient * client)
 
90
+gsd_keyboard_xkb_init (GConfClient * client,
 
91
+                      GsdKeyboardManager * kbd_manager)
 
92
 {
 
93
        gnome_settings_profile_start (NULL);
 
94
 #ifdef GSDKX
 
95
@@ -821,6 +825,7 @@ gsd_keyboard_xkb_init (GConfClient * client)
 
96
        logfile = fopen ("/tmp/gsdkx.log", "a");
 
97
        xkl_set_log_appender (gsd_keyboard_log_appender);
 
98
 #endif
 
99
+       manager = kbd_manager;
 
100
        gnome_settings_profile_start ("xkl_engine_get_instance");
 
101
        xkl_engine = xkl_engine_get_instance (GDK_DISPLAY ());
 
102
        gnome_settings_profile_end ("xkl_engine_get_instance");
 
103
@@ -886,6 +891,7 @@ gsd_keyboard_xkb_shutdown (void)
 
104
 
 
105
        pa_callback = NULL;
 
106
        pa_callback_user_data = NULL;
 
107
+       manager = NULL;
 
108
 
 
109
        g_hash_table_destroy (preview_dialogs);
 
110
 
 
111
diff --git a/plugins/keyboard/gsd-keyboard-xkb.h b/plugins/keyboard/gsd-keyboard-xkb.h
 
112
index cad70ff..21d3705 100644
 
113
--- a/plugins/keyboard/gsd-keyboard-xkb.h
 
114
+++ b/plugins/keyboard/gsd-keyboard-xkb.h
 
115
@@ -28,8 +28,9 @@
 
116
 #include <gconf/gconf-client.h>
 
117
 
 
118
 #include <libxklavier/xklavier.h>
 
119
+#include "gsd-keyboard-manager.h"
 
120
 
 
121
-void gsd_keyboard_xkb_init (GConfClient *client);
 
122
+void gsd_keyboard_xkb_init (GConfClient *client, GsdKeyboardManager *manager);
 
123
 void gsd_keyboard_xkb_shutdown (void);
 
124
 
 
125
 typedef void (*PostActivationCallback) (void *userData);
 
126
-- 
 
127
1.6.6.1
 
128