0 | |
Index: gnome-settings-daemon-3.6.4/configure.ac
|
1 | |
===================================================================
|
2 | |
--- gnome-settings-daemon-3.6.4.orig/configure.ac 2013-04-17 17:52:29.768040154 +0200
|
3 | |
+++ gnome-settings-daemon-3.6.4/configure.ac 2013-04-17 17:52:29.748040153 +0200
|
4 | |
@@ -54,7 +54,6 @@
|
5 | |
LIBWACOM_REQUIRED_VERSION=0.6
|
6 | |
UPOWER_REQUIRED_VERSION=0.9.11
|
7 | |
APPINDICATOR_REQUIRED_VERSION=0.3.0
|
8 | |
-IBUS_REQUIRED_VERSION=1.4.99
|
9 | |
|
10 | |
EXTRA_COMPILE_WARNINGS(yes)
|
11 | |
|
12 | |
@@ -204,21 +203,8 @@
|
13 | |
dnl - Keyboard plugin stuff
|
14 | |
dnl ---------------------------------------------------------------------------
|
15 | |
|
16 | |
-AC_ARG_ENABLE(ibus,
|
17 | |
- AS_HELP_STRING([--disable-ibus],
|
18 | |
- [Disable IBus support]),
|
19 | |
- enable_ibus=$enableval,
|
20 | |
- enable_ibus=yes)
|
21 | |
-
|
22 | |
-if test "x$enable_ibus" = "xyes" ; then
|
23 | |
- IBUS_MODULE="ibus-1.0 >= $IBUS_REQUIRED_VERSION"
|
24 | |
- AC_DEFINE(HAVE_IBUS, 1, [Defined if IBus support is enabled])
|
25 | |
-else
|
26 | |
- IBUS_MODULE=
|
27 | |
-fi
|
28 | |
-AM_CONDITIONAL(HAVE_IBUS, test "x$enable_ibus" == "xyes")
|
29 | |
-
|
30 | |
-PKG_CHECK_MODULES(KEYBOARD, xkbfile $IBUS_MODULE gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED_VERSION)
|
31 | |
+LIBGNOMEKBD_REQUIRED=2.91.1
|
32 | |
+PKG_CHECK_MODULES(KEYBOARD, [libgnomekbdui >= $LIBGNOMEKBD_REQUIRED libgnomekbd >= $LIBGNOMEKBD_REQUIRED libxklavier >= 5.0 kbproto])
|
33 | |
|
34 | |
dnl ---------------------------------------------------------------------------
|
35 | |
dnl - Housekeeping plugin stuff
|
36 | |
@@ -595,7 +581,6 @@
|
37 | |
|
38 | |
Session tracking: ${SESSION_TRACKING}
|
39 | |
LCMS DICT support: ${have_new_lcms}
|
40 | |
- IBus support: ${enable_ibus}
|
41 | |
Libnotify support: ${have_libnotify}
|
42 | |
App indicator support: ${enable_appindicator}
|
43 | |
PackageKit support: ${have_packagekit}
|
44 | |
Index: gnome-settings-daemon-3.6.4/data/Makefile.am
|
45 | |
===================================================================
|
46 | |
--- gnome-settings-daemon-3.6.4.orig/data/Makefile.am 2013-04-17 17:52:29.768040154 +0200
|
47 | |
+++ gnome-settings-daemon-3.6.4/data/Makefile.am 2013-04-17 17:52:29.748040153 +0200
|
48 | |
@@ -67,12 +67,3 @@
|
49 | |
Makefile.in \
|
50 | |
$(gsettings_SCHEMAS:.xml=.valid)
|
51 | |
|
52 | |
-if HAVE_IBUS
|
53 | |
-dbusservicedir=${datadir}/dbus-1/services
|
54 | |
-dbusservice_DATA = $(dbusservice_in_files:.service.in=.service)
|
55 | |
-
|
56 | |
-org.freedesktop.IBus.service: org.freedesktop.IBus.service.in
|
57 | |
- $(AM_V_GEN) sed -e "s|\@bindir\@|$(bindir)|" $< > $@.tmp && mv $@.tmp $@
|
58 | |
-
|
59 | |
-CLEANFILES = $(dbusservice_DATA)
|
60 | |
-endif
|
61 | |
Index: gnome-settings-daemon-3.6.4/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
|
62 | |
===================================================================
|
63 | |
--- gnome-settings-daemon-3.6.4.orig/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in 2013-04-17 17:52:29.768040154 +0200
|
64 | |
+++ gnome-settings-daemon-3.6.4/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in 2013-04-17 17:52:29.748040153 +0200
|
65 | |
@@ -180,16 +180,6 @@
|
66 | |
<_summary>Magnifier zoom out</_summary>
|
67 | |
<_description>Binding for the magnifier to zoom out</_description>
|
68 | |
</key>
|
69 | |
- <key name="switch-input-source" type="s">
|
70 | |
- <default>''</default>
|
71 | |
- <_summary>Switch input source</_summary>
|
72 | |
- <_description>Binding to select the next input source</_description>
|
73 | |
- </key>
|
74 | |
- <key name="switch-input-source-backward" type="s">
|
75 | |
- <default>''</default>
|
76 | |
- <_summary>Switch input source backward</_summary>
|
77 | |
- <_description>Binding to select the previous input source</_description>
|
78 | |
- </key>
|
79 | |
</schema>
|
80 | |
|
81 | |
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.settings-daemon.plugins.media-keys.custom-keybinding">
|
82 | |
Index: gnome-settings-daemon-3.6.4/plugins/keyboard/delayed-dialog.c
|
83 | |
===================================================================
|
84 | |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
85 | |
+++ gnome-settings-daemon-3.6.4/plugins/keyboard/delayed-dialog.c 2013-04-17 17:52:29.748040153 +0200
|
86 | |
@@ -0,0 +1,128 @@
|
87 | |
+/*
|
88 | |
+ * Copyright © 2006 Novell, Inc.
|
89 | |
+ *
|
90 | |
+ * This program is free software; you can redistribute it and/or
|
91 | |
+ * modify it under the terms of the GNU General Public License as
|
92 | |
+ * published by the Free Software Foundation; either version 2, or (at
|
93 | |
+ * your option) any later version.
|
94 | |
+ *
|
95 | |
+ * This program is distributed in the hope that it will be useful, but
|
96 | |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
97 | |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
98 | |
+ * General Public License for more details.
|
99 | |
+ *
|
100 | |
+ * You should have received a copy of the GNU General Public License
|
101 | |
+ * along with this program; if not, write to the Free Software
|
102 | |
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
103 | |
+ * 02111-1307, USA.
|
104 | |
+ */
|
105 | |
+
|
106 | |
+#include <stdlib.h>
|
107 | |
+#include <string.h>
|
108 | |
+
|
109 | |
+#include <gtk/gtk.h>
|
110 | |
+#include <gdk/gdkx.h>
|
111 | |
+
|
112 | |
+#include "delayed-dialog.h"
|
113 | |
+
|
114 | |
+static gboolean delayed_show_timeout (gpointer data);
|
115 | |
+static GdkFilterReturn message_filter (GdkXEvent *xevent,
|
116 | |
+ GdkEvent *event,
|
117 | |
+ gpointer data);
|
118 | |
+
|
119 | |
+static GSList *dialogs = NULL;
|
120 | |
+
|
121 | |
+/**
|
122 | |
+ * gsd_delayed_show_dialog:
|
123 | |
+ * @dialog: the dialog
|
124 | |
+ *
|
125 | |
+ * Shows the dialog as with gtk_widget_show(), unless a window manager
|
126 | |
+ * hasn't been started yet, in which case it will wait up to 5 seconds
|
127 | |
+ * for that to happen before showing the dialog.
|
128 | |
+ **/
|
129 | |
+void
|
130 | |
+gsd_delayed_show_dialog (GtkWidget *dialog)
|
131 | |
+{
|
132 | |
+ GdkDisplay *display = gtk_widget_get_display (dialog);
|
133 | |
+ Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
134 | |
+ GdkScreen *screen = gtk_widget_get_screen (dialog);
|
135 | |
+ char selection_name[10];
|
136 | |
+ Atom selection_atom;
|
137 | |
+
|
138 | |
+ /* We can't use gdk_selection_owner_get() for this, because
|
139 | |
+ * it's an unknown out-of-process window.
|
140 | |
+ */
|
141 | |
+ snprintf (selection_name, sizeof (selection_name), "WM_S%d",
|
142 | |
+ gdk_screen_get_number (screen));
|
143 | |
+ selection_atom = XInternAtom (xdisplay, selection_name, True);
|
144 | |
+ if (selection_atom &&
|
145 | |
+ XGetSelectionOwner (xdisplay, selection_atom) != None) {
|
146 | |
+ gtk_widget_show (dialog);
|
147 | |
+ return;
|
148 | |
+ }
|
149 | |
+
|
150 | |
+ dialogs = g_slist_prepend (dialogs, dialog);
|
151 | |
+
|
152 | |
+ gdk_window_add_filter (NULL, message_filter, NULL);
|
153 | |
+
|
154 | |
+ g_timeout_add (5000, delayed_show_timeout, NULL);
|
155 | |
+}
|
156 | |
+
|
157 | |
+static gboolean
|
158 | |
+delayed_show_timeout (gpointer data)
|
159 | |
+{
|
160 | |
+ GSList *l;
|
161 | |
+
|
162 | |
+ for (l = dialogs; l; l = l->next)
|
163 | |
+ gtk_widget_show (l->data);
|
164 | |
+ g_slist_free (dialogs);
|
165 | |
+ dialogs = NULL;
|
166 | |
+
|
167 | |
+ /* FIXME: There's no gdk_display_remove_client_message_filter */
|
168 | |
+
|
169 | |
+ return FALSE;
|
170 | |
+}
|
171 | |
+
|
172 | |
+static GdkFilterReturn
|
173 | |
+message_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data)
|
174 | |
+{
|
175 | |
+ XClientMessageEvent *evt;
|
176 | |
+ char *selection_name;
|
177 | |
+ int screen;
|
178 | |
+ GSList *l, *next;
|
179 | |
+
|
180 | |
+ if (((XEvent *)xevent)->type != ClientMessage)
|
181 | |
+ return GDK_FILTER_CONTINUE;
|
182 | |
+
|
183 | |
+ evt = (XClientMessageEvent *)xevent;
|
184 | |
+
|
185 | |
+ if (evt->message_type != XInternAtom (evt->display, "MANAGER", FALSE))
|
186 | |
+ return GDK_FILTER_CONTINUE;
|
187 | |
+
|
188 | |
+ selection_name = XGetAtomName (evt->display, evt->data.l[1]);
|
189 | |
+
|
190 | |
+ if (strncmp (selection_name, "WM_S", 4) != 0) {
|
191 | |
+ XFree (selection_name);
|
192 | |
+ return GDK_FILTER_CONTINUE;
|
193 | |
+ }
|
194 | |
+
|
195 | |
+ screen = atoi (selection_name + 4);
|
196 | |
+
|
197 | |
+ for (l = dialogs; l; l = next) {
|
198 | |
+ GtkWidget *dialog = l->data;
|
199 | |
+ next = l->next;
|
200 | |
+
|
201 | |
+ if (gdk_screen_get_number (gtk_widget_get_screen (dialog)) == screen) {
|
202 | |
+ gtk_widget_show (dialog);
|
203 | |
+ dialogs = g_slist_remove (dialogs, dialog);
|
204 | |
+ }
|
205 | |
+ }
|
206 | |
+
|
207 | |
+ if (!dialogs) {
|
208 | |
+ gdk_window_remove_filter (NULL, message_filter, NULL);
|
209 | |
+ }
|
210 | |
+
|
211 | |
+ XFree (selection_name);
|
212 | |
+
|
213 | |
+ return GDK_FILTER_CONTINUE;
|
214 | |
+}
|
215 | |
Index: gnome-settings-daemon-3.6.4/plugins/keyboard/delayed-dialog.h
|
216 | |
===================================================================
|
217 | |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
218 | |
+++ gnome-settings-daemon-3.6.4/plugins/keyboard/delayed-dialog.h 2013-04-17 17:52:29.748040153 +0200
|
219 | |
@@ -0,0 +1,32 @@
|
220 | |
+/*
|
221 | |
+ * Copyright © 2006 Novell, Inc.
|
222 | |
+ *
|
223 | |
+ * This program is free software; you can redistribute it and/or
|
224 | |
+ * modify it under the terms of the GNU General Public License as
|
225 | |
+ * published by the Free Software Foundation; either version 2, or (at
|
226 | |
+ * your option) any later version.
|
227 | |
+ *
|
228 | |
+ * This program is distributed in the hope that it will be useful, but
|
229 | |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
230 | |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
231 | |
+ * General Public License for more details.
|
232 | |
+ *
|
233 | |
+ * You should have received a copy of the GNU General Public License
|
234 | |
+ * along with this program; if not, write to the Free Software
|
235 | |
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
236 | |
+ * 02111-1307, USA.
|
237 | |
+ */
|
238 | |
+
|
239 | |
+
|
240 | |
+#ifndef __DELAYED_DIALOG_H
|
241 | |
+#define __DELAYED_DIALOG_H
|
242 | |
+
|
243 | |
+#include <gtk/gtk.h>
|
244 | |
+
|
245 | |
+G_BEGIN_DECLS
|
246 | |
+
|
247 | |
+void gsd_delayed_show_dialog (GtkWidget *dialog);
|
248 | |
+
|
249 | |
+G_END_DECLS
|
250 | |
+
|
251 | |
+#endif
|
252 | |
Index: gnome-settings-daemon-3.6.4/plugins/keyboard/gkbd-configuration.c
|
253 | |
===================================================================
|
254 | |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
255 | |
+++ gnome-settings-daemon-3.6.4/plugins/keyboard/gkbd-configuration.c 2013-04-17 17:52:29.752040153 +0200
|
256 | |
@@ -0,0 +1,350 @@
|
257 | |
+/*
|
258 | |
+ * Copyright (C) 2010 Canonical Ltd.
|
259 | |
+ *
|
260 | |
+ * Authors: Jan Arne Petersen <jpetersen@openismus.com>
|
261 | |
+ *
|
262 | |
+ * Based on gkbd-status.c by Sergey V. Udaltsov <svu@gnome.org>
|
263 | |
+ *
|
264 | |
+ * This library is free software; you can redistribute it and/or
|
265 | |
+ * modify it under the terms of the GNU Lesser General Public
|
266 | |
+ * License as published by the Free Software Foundation; either
|
267 | |
+ * version 2 of the License, or (at your option) any later version.
|
268 | |
+ *
|
269 | |
+ * This library is distributed in the hope that it will be useful,
|
270 | |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
271 | |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
272 | |
+ * Lesser General Public License for more details.
|
273 | |
+ *
|
274 | |
+ * You should have received a copy of the GNU Lesser General Public
|
275 | |
+ * License along with this library; if not, write to the
|
276 | |
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
277 | |
+ * Boston, MA 02111-1307, USA.
|
278 | |
+ */
|
279 | |
+
|
280 | |
+#include <memory.h>
|
281 | |
+
|
282 | |
+#include <gdk/gdkkeysyms.h>
|
283 | |
+#include <gdk/gdkx.h>
|
284 | |
+#include <glib/gi18n.h>
|
285 | |
+
|
286 | |
+#include <libgnomekbd/gkbd-desktop-config.h>
|
287 | |
+#include <libgnomekbd/gkbd-indicator-config.h>
|
288 | |
+
|
289 | |
+#include "gkbd-configuration.h"
|
290 | |
+
|
291 | |
+struct _GkbdConfigurationPrivate {
|
292 | |
+ XklEngine *engine;
|
293 | |
+ XklConfigRegistry *registry;
|
294 | |
+
|
295 | |
+ GkbdDesktopConfig cfg;
|
296 | |
+ GkbdIndicatorConfig ind_cfg;
|
297 | |
+ GkbdKeyboardConfig kbd_cfg;
|
298 | |
+
|
299 | |
+ gchar **full_group_names;
|
300 | |
+ gchar **short_group_names;
|
301 | |
+
|
302 | |
+ gulong state_changed_handler;
|
303 | |
+ gulong config_changed_handler;
|
304 | |
+};
|
305 | |
+
|
306 | |
+enum {
|
307 | |
+ SIGNAL_CHANGED,
|
308 | |
+ SIGNAL_GROUP_CHANGED,
|
309 | |
+ LAST_SIGNAL
|
310 | |
+};
|
311 | |
+
|
312 | |
+static guint signals[LAST_SIGNAL] = { 0, };
|
313 | |
+
|
314 | |
+#define GKBD_CONFIGURATION_GET_PRIVATE(o) \
|
315 | |
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), GKBD_TYPE_CONFIGURATION, GkbdConfigurationPrivate))
|
316 | |
+
|
317 | |
+G_DEFINE_TYPE (GkbdConfiguration, gkbd_configuration, G_TYPE_OBJECT)
|
318 | |
+
|
319 | |
+/* Should be called once for all widgets */
|
320 | |
+static void
|
321 | |
+gkbd_configuration_cfg_changed (GSettings *settings,
|
322 | |
+ const char *key,
|
323 | |
+ GkbdConfiguration * configuration)
|
324 | |
+{
|
325 | |
+ GkbdConfigurationPrivate *priv = configuration->priv;
|
326 | |
+
|
327 | |
+ xkl_debug (100,
|
328 | |
+ "General configuration changed in GSettings - reiniting...\n");
|
329 | |
+ gkbd_desktop_config_load (&priv->cfg);
|
330 | |
+ gkbd_desktop_config_activate (&priv->cfg);
|
331 | |
+
|
332 | |
+ g_signal_emit (configuration,
|
333 | |
+ signals[SIGNAL_CHANGED], 0);
|
334 | |
+}
|
335 | |
+
|
336 | |
+/* Should be called once for all widgets */
|
337 | |
+static void
|
338 | |
+gkbd_configuration_ind_cfg_changed (GSettings *settings,
|
339 | |
+ const char *key,
|
340 | |
+ GkbdConfiguration * configuration)
|
341 | |
+{
|
342 | |
+ GkbdConfigurationPrivate *priv = configuration->priv;
|
343 | |
+ xkl_debug (100,
|
344 | |
+ "Applet configuration changed in GSettings - reiniting...\n");
|
345 | |
+ gkbd_indicator_config_load (&priv->ind_cfg);
|
346 | |
+
|
347 | |
+ gkbd_indicator_config_free_image_filenames (&priv->ind_cfg);
|
348 | |
+ gkbd_indicator_config_load_image_filenames (&priv->ind_cfg,
|
349 | |
+ &priv->kbd_cfg);
|
350 | |
+
|
351 | |
+ gkbd_indicator_config_activate (&priv->ind_cfg);
|
352 | |
+
|
353 | |
+ g_signal_emit (configuration,
|
354 | |
+ signals[SIGNAL_CHANGED], 0);
|
355 | |
+}
|
356 | |
+
|
357 | |
+static void
|
358 | |
+gkbd_configuration_load_group_names (GkbdConfiguration * configuration,
|
359 | |
+ XklConfigRec * xklrec)
|
360 | |
+{
|
361 | |
+ GkbdConfigurationPrivate *priv = configuration->priv;
|
362 | |
+
|
363 | |
+ if (!gkbd_desktop_config_load_group_descriptions (&priv->cfg,
|
364 | |
+ priv->registry,
|
365 | |
+ (const char **) xklrec->layouts,
|
366 | |
+ (const char **) xklrec->variants,
|
367 | |
+ &priv->short_group_names,
|
368 | |
+ &priv->full_group_names)) {
|
369 | |
+ /* We just populate no short names (remain NULL) -
|
370 | |
+ * full names are going to be used anyway */
|
371 | |
+ gint i, total_groups =
|
372 | |
+ xkl_engine_get_num_groups (priv->engine);
|
373 | |
+ xkl_debug (150, "group descriptions loaded: %d!\n",
|
374 | |
+ total_groups);
|
375 | |
+ priv->full_group_names =
|
376 | |
+ g_new0 (char *, total_groups + 1);
|
377 | |
+
|
378 | |
+ if (xkl_engine_get_features (priv->engine) &
|
379 | |
+ XKLF_MULTIPLE_LAYOUTS_SUPPORTED) {
|
380 | |
+ for (i = 0; priv->kbd_cfg.layouts_variants[i]; i++) {
|
381 | |
+ priv->full_group_names[i] =
|
382 | |
+ g_strdup ((char *) priv->kbd_cfg.layouts_variants[i]);
|
383 | |
+ }
|
384 | |
+ } else {
|
385 | |
+ for (i = total_groups; --i >= 0;) {
|
386 | |
+ priv->full_group_names[i] =
|
387 | |
+ g_strdup_printf ("Group %d", i);
|
388 | |
+ }
|
389 | |
+ }
|
390 | |
+ }
|
391 | |
+}
|
392 | |
+
|
393 | |
+/* Should be called once for all widgets */
|
394 | |
+static void
|
395 | |
+gkbd_configuration_kbd_cfg_callback (XklEngine *engine,
|
396 | |
+ GkbdConfiguration *configuration)
|
397 | |
+{
|
398 | |
+ GkbdConfigurationPrivate *priv = configuration->priv;
|
399 | |
+ XklConfigRec *xklrec = xkl_config_rec_new ();
|
400 | |
+ xkl_debug (100,
|
401 | |
+ "XKB configuration changed on X Server - reiniting...\n");
|
402 | |
+
|
403 | |
+ gkbd_keyboard_config_load_from_x_current (&priv->kbd_cfg,
|
404 | |
+ xklrec);
|
405 | |
+
|
406 | |
+ gkbd_indicator_config_free_image_filenames (&priv->ind_cfg);
|
407 | |
+ gkbd_indicator_config_load_image_filenames (&priv->ind_cfg,
|
408 | |
+ &priv->kbd_cfg);
|
409 | |
+
|
410 | |
+ g_strfreev (priv->full_group_names);
|
411 | |
+ priv->full_group_names = NULL;
|
412 | |
+
|
413 | |
+ g_strfreev (priv->short_group_names);
|
414 | |
+ priv->short_group_names = NULL;
|
415 | |
+
|
416 | |
+ gkbd_configuration_load_group_names (configuration,
|
417 | |
+ xklrec);
|
418 | |
+
|
419 | |
+ g_signal_emit (configuration,
|
420 | |
+ signals[SIGNAL_CHANGED],
|
421 | |
+ 0);
|
422 | |
+
|
423 | |
+ g_object_unref (G_OBJECT (xklrec));
|
424 | |
+}
|
425 | |
+
|
426 | |
+/* Should be called once for all applets */
|
427 | |
+static void
|
428 | |
+gkbd_configuration_state_callback (XklEngine * engine,
|
429 | |
+ XklEngineStateChange changeType,
|
430 | |
+ gint group, gboolean restore,
|
431 | |
+ GkbdConfiguration * configuration)
|
432 | |
+{
|
433 | |
+ xkl_debug (150, "group is now %d, restore: %d\n", group, restore);
|
434 | |
+
|
435 | |
+ if (changeType == GROUP_CHANGED) {
|
436 | |
+ g_signal_emit (configuration,
|
437 | |
+ signals[SIGNAL_GROUP_CHANGED], 0,
|
438 | |
+ group);
|
439 | |
+ }
|
440 | |
+}
|
441 | |
+
|
442 | |
+static void
|
443 | |
+gkbd_configuration_init (GkbdConfiguration *configuration)
|
444 | |
+{
|
445 | |
+ GkbdConfigurationPrivate *priv;
|
446 | |
+ XklConfigRec *xklrec = xkl_config_rec_new ();
|
447 | |
+
|
448 | |
+ priv = GKBD_CONFIGURATION_GET_PRIVATE (configuration);
|
449 | |
+ configuration->priv = priv;
|
450 | |
+
|
451 | |
+ priv->engine = xkl_engine_get_instance (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
|
452 | |
+ if (priv->engine == NULL) {
|
453 | |
+ xkl_debug (0, "Libxklavier initialization error");
|
454 | |
+ return;
|
455 | |
+ }
|
456 | |
+
|
457 | |
+ priv->state_changed_handler =
|
458 | |
+ g_signal_connect (priv->engine, "X-state-changed",
|
459 | |
+ G_CALLBACK (gkbd_configuration_state_callback),
|
460 | |
+ configuration);
|
461 | |
+ priv->config_changed_handler =
|
462 | |
+ g_signal_connect (priv->engine, "X-config-changed",
|
463 | |
+ G_CALLBACK (gkbd_configuration_kbd_cfg_callback),
|
464 | |
+ configuration);
|
465 | |
+
|
466 | |
+ gkbd_desktop_config_init (&priv->cfg, priv->engine);
|
467 | |
+ gkbd_keyboard_config_init (&priv->kbd_cfg, priv->engine);
|
468 | |
+ gkbd_indicator_config_init (&priv->ind_cfg, priv->engine);
|
469 | |
+
|
470 | |
+ gkbd_desktop_config_load (&priv->cfg);
|
471 | |
+ gkbd_desktop_config_activate (&priv->cfg);
|
472 | |
+
|
473 | |
+ priv->registry = xkl_config_registry_get_instance (priv->engine);
|
474 | |
+ xkl_config_registry_load (priv->registry,
|
475 | |
+ priv->cfg.load_extra_items);
|
476 | |
+
|
477 | |
+ gkbd_keyboard_config_load_from_x_current (&priv->kbd_cfg,
|
478 | |
+ xklrec);
|
479 | |
+
|
480 | |
+ gkbd_indicator_config_load (&priv->ind_cfg);
|
481 | |
+
|
482 | |
+ gkbd_indicator_config_load_image_filenames (&priv->ind_cfg,
|
483 | |
+ &priv->kbd_cfg);
|
484 | |
+
|
485 | |
+ gkbd_indicator_config_activate (&priv->ind_cfg);
|
486 | |
+
|
487 | |
+ gkbd_configuration_load_group_names (configuration,
|
488 | |
+ xklrec);
|
489 | |
+ g_object_unref (G_OBJECT (xklrec));
|
490 | |
+
|
491 | |
+ gkbd_desktop_config_start_listen (&priv->cfg,
|
492 | |
+ G_CALLBACK (gkbd_configuration_cfg_changed),
|
493 | |
+ configuration);
|
494 | |
+ gkbd_indicator_config_start_listen (&priv->ind_cfg,
|
495 | |
+ G_CALLBACK (gkbd_configuration_ind_cfg_changed),
|
496 | |
+ configuration);
|
497 | |
+ xkl_engine_start_listen (priv->engine,
|
498 | |
+ XKLL_TRACK_KEYBOARD_STATE);
|
499 | |
+
|
500 | |
+ xkl_debug (100, "Initiating the widget startup process for %p\n",
|
501 | |
+ configuration);
|
502 | |
+}
|
503 | |
+
|
504 | |
+static void
|
505 | |
+gkbd_configuration_finalize (GObject * obj)
|
506 | |
+{
|
507 | |
+ GkbdConfiguration *configuration = GKBD_CONFIGURATION (obj);
|
508 | |
+ GkbdConfigurationPrivate *priv = configuration->priv;
|
509 | |
+
|
510 | |
+ xkl_debug (100,
|
511 | |
+ "Starting the gnome-kbd-configuration widget shutdown process for %p\n",
|
512 | |
+ configuration);
|
513 | |
+
|
514 | |
+ xkl_engine_stop_listen (priv->engine,
|
515 | |
+ XKLL_TRACK_KEYBOARD_STATE);
|
516 | |
+
|
517 | |
+ gkbd_desktop_config_stop_listen (&priv->cfg);
|
518 | |
+ gkbd_indicator_config_stop_listen (&priv->ind_cfg);
|
519 | |
+
|
520 | |
+ gkbd_indicator_config_term (&priv->ind_cfg);
|
521 | |
+ gkbd_keyboard_config_term (&priv->kbd_cfg);
|
522 | |
+ gkbd_desktop_config_term (&priv->cfg);
|
523 | |
+
|
524 | |
+ if (g_signal_handler_is_connected (priv->engine,
|
525 | |
+ priv->state_changed_handler)) {
|
526 | |
+ g_signal_handler_disconnect (priv->engine,
|
527 | |
+ priv->state_changed_handler);
|
528 | |
+ priv->state_changed_handler = 0;
|
529 | |
+ }
|
530 | |
+ if (g_signal_handler_is_connected (priv->engine,
|
531 | |
+ priv->config_changed_handler)) {
|
532 | |
+ g_signal_handler_disconnect (priv->engine,
|
533 | |
+ priv->config_changed_handler);
|
534 | |
+ priv->config_changed_handler = 0;
|
535 | |
+ }
|
536 | |
+
|
537 | |
+ g_object_unref (priv->registry);
|
538 | |
+ priv->registry = NULL;
|
539 | |
+ g_object_unref (priv->engine);
|
540 | |
+ priv->engine = NULL;
|
541 | |
+
|
542 | |
+ G_OBJECT_CLASS (gkbd_configuration_parent_class)->finalize (obj);
|
543 | |
+}
|
544 | |
+
|
545 | |
+static void
|
546 | |
+gkbd_configuration_class_init (GkbdConfigurationClass * klass)
|
547 | |
+{
|
548 | |
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
549 | |
+
|
550 | |
+ /* Initing vtable */
|
551 | |
+ object_class->finalize = gkbd_configuration_finalize;
|
552 | |
+
|
553 | |
+ /* Signals */
|
554 | |
+ signals[SIGNAL_CHANGED] = g_signal_new ("changed",
|
555 | |
+ GKBD_TYPE_CONFIGURATION,
|
556 | |
+ G_SIGNAL_RUN_LAST,
|
557 | |
+ 0,
|
558 | |
+ NULL, NULL,
|
559 | |
+ g_cclosure_marshal_VOID__VOID,
|
560 | |
+ G_TYPE_NONE,
|
561 | |
+ 0);
|
562 | |
+ signals[SIGNAL_GROUP_CHANGED] = g_signal_new ("group-changed",
|
563 | |
+ GKBD_TYPE_CONFIGURATION,
|
564 | |
+ G_SIGNAL_RUN_LAST,
|
565 | |
+ 0,
|
566 | |
+ NULL, NULL,
|
567 | |
+ g_cclosure_marshal_VOID__INT,
|
568 | |
+ G_TYPE_NONE,
|
569 | |
+ 1,
|
570 | |
+ G_TYPE_INT);
|
571 | |
+
|
572 | |
+ g_type_class_add_private (klass, sizeof (GkbdConfigurationPrivate));
|
573 | |
+}
|
574 | |
+
|
575 | |
+GkbdConfiguration *
|
576 | |
+gkbd_configuration_get (void)
|
577 | |
+{
|
578 | |
+ static gpointer instance = NULL;
|
579 | |
+
|
580 | |
+ if (!instance) {
|
581 | |
+ instance = g_object_new (GKBD_TYPE_CONFIGURATION, NULL);
|
582 | |
+ g_object_add_weak_pointer (instance, &instance);
|
583 | |
+ } else {
|
584 | |
+ g_object_ref (instance);
|
585 | |
+ }
|
586 | |
+
|
587 | |
+ return instance;
|
588 | |
+}
|
589 | |
+
|
590 | |
+XklEngine *
|
591 | |
+gkbd_configuration_get_xkl_engine (GkbdConfiguration *configuration)
|
592 | |
+{
|
593 | |
+ return configuration->priv->engine;
|
594 | |
+}
|
595 | |
+
|
596 | |
+const char * const *
|
597 | |
+gkbd_configuration_get_group_names (GkbdConfiguration *configuration)
|
598 | |
+{
|
599 | |
+ return configuration->priv->full_group_names;
|
600 | |
+}
|
601 | |
+
|
602 | |
+const char * const *
|
603 | |
+gkbd_configuration_get_short_group_names (GkbdConfiguration *configuration)
|
604 | |
+{
|
605 | |
+ return configuration->priv->short_group_names;
|
606 | |
+}
|
607 | |
Index: gnome-settings-daemon-3.6.4/plugins/keyboard/gkbd-configuration.h
|
608 | |
===================================================================
|
609 | |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
610 | |
+++ gnome-settings-daemon-3.6.4/plugins/keyboard/gkbd-configuration.h 2013-04-17 17:52:29.752040153 +0200
|
611 | |
@@ -0,0 +1,65 @@
|
612 | |
+/*
|
613 | |
+ * Copyright (C) 2010 Canonical Ltd.
|
614 | |
+ *
|
615 | |
+ * Authors: Jan Arne Petersen <jpetersen@openismus.com>
|
616 | |
+ *
|
617 | |
+ * Based on gkbd-status.h by Sergey V. Udaltsov <svu@gnome.org>
|
618 | |
+ *
|
619 | |
+ * This library is free software; you can redistribute it and/or
|
620 | |
+ * modify it under the terms of the GNU Lesser General Public
|
621 | |
+ * License as published by the Free Software Foundation; either
|
622 | |
+ * version 2 of the License, or (at your option) any later version.
|
623 | |
+ *
|
624 | |
+ * This library is distributed in the hope that it will be useful,
|
625 | |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
626 | |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
627 | |
+ * Lesser General Public License for more details.
|
628 | |
+ *
|
629 | |
+ * You should have received a copy of the GNU Lesser General Public
|
630 | |
+ * License along with this library; if not, write to the
|
631 | |
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
632 | |
+ * Boston, MA 02111-1307, USA.
|
633 | |
+ */
|
634 | |
+
|
635 | |
+#ifndef __GKBD_CONFIGURATION_H__
|
636 | |
+#define __GKBD_CONFIGURATION_H__
|
637 | |
+
|
638 | |
+#include <glib-object.h>
|
639 | |
+
|
640 | |
+#include <libxklavier/xklavier.h>
|
641 | |
+
|
642 | |
+G_BEGIN_DECLS
|
643 | |
+
|
644 | |
+typedef struct _GkbdConfiguration GkbdConfiguration;
|
645 | |
+typedef struct _GkbdConfigurationPrivate GkbdConfigurationPrivate;
|
646 | |
+typedef struct _GkbdConfigurationClass GkbdConfigurationClass;
|
647 | |
+
|
648 | |
+#define GKBD_TYPE_CONFIGURATION (gkbd_configuration_get_type ())
|
649 | |
+#define GKBD_CONFIGURATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GKBD_TYPE_CONFIGURATION, GkbdConfiguration))
|
650 | |
+#define GKBD_INDCATOR_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), GKBD_TYPE_CONFIGURATION, GkbdConfigurationClass))
|
651 | |
+#define GKBD_IS_CONFIGURATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GKBD_TYPE_CONFIGURATION))
|
652 | |
+#define GKBD_IS_CONFIGURATION_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), GKBD_TYPE_CONFIGURATION))
|
653 | |
+#define GKBD_CONFIGURATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GKBD_TYPE_CONFIGURATION, GkbdConfigurationClass))
|
654 | |
+
|
655 | |
+struct _GkbdConfiguration {
|
656 | |
+ GObject parent;
|
657 | |
+
|
658 | |
+ GkbdConfigurationPrivate *priv;
|
659 | |
+};
|
660 | |
+
|
661 | |
+struct _GkbdConfigurationClass {
|
662 | |
+ GObjectClass parent_class;
|
663 | |
+};
|
664 | |
+
|
665 | |
+extern GType gkbd_configuration_get_type (void);
|
666 | |
+
|
667 | |
+extern GkbdConfiguration *gkbd_configuration_get (void);
|
668 | |
+
|
669 | |
+extern XklEngine *gkbd_configuration_get_xkl_engine (GkbdConfiguration *configuration);
|
670 | |
+
|
671 | |
+extern const char * const *gkbd_configuration_get_group_names (GkbdConfiguration *configuration);
|
672 | |
+extern const char * const *gkbd_configuration_get_short_group_names (GkbdConfiguration *configuration);
|
673 | |
+
|
674 | |
+G_END_DECLS
|
675 | |
+
|
676 | |
+#endif
|
677 | |
Index: gnome-settings-daemon-3.6.4/plugins/keyboard/gsd-keyboard-manager.c
|
678 | |
===================================================================
|
679 | |
--- gnome-settings-daemon-3.6.4.orig/plugins/keyboard/gsd-keyboard-manager.c 2013-04-17 17:52:29.768040154 +0200
|
680 | |
+++ gnome-settings-daemon-3.6.4/plugins/keyboard/gsd-keyboard-manager.c 2013-04-17 17:52:29.756040153 +0200
|
681 | |
@@ -40,22 +40,19 @@
|
682 | |
|
683 | |
#include <X11/XKBlib.h>
|
684 | |
#include <X11/keysym.h>
|
685 | |
-#include <X11/extensions/XKBrules.h>
|
686 | |
-
|
687 | |
-#define GNOME_DESKTOP_USE_UNSTABLE_API
|
688 | |
-#include <libgnome-desktop/gnome-xkb-info.h>
|
689 | |
-
|
690 | |
-#ifdef HAVE_IBUS
|
691 | |
-#include <ibus.h>
|
692 | |
-#endif
|
693 | |
|
694 | |
#include "gnome-settings-profile.h"
|
695 | |
#include "gsd-keyboard-manager.h"
|
696 | |
-#include "gsd-input-helper.h"
|
697 | |
#include "gsd-enums.h"
|
698 | |
|
699 | |
+#include "gsd-keyboard-xkb.h"
|
700 | |
+
|
701 | |
#define GSD_KEYBOARD_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_KEYBOARD_MANAGER, GsdKeyboardManagerPrivate))
|
702 | |
|
703 | |
+#ifndef HOST_NAME_MAX
|
704 | |
+# define HOST_NAME_MAX 255
|
705 | |
+#endif
|
706 | |
+
|
707 | |
#define GSD_KEYBOARD_DIR "org.gnome.settings-daemon.peripherals.keyboard"
|
708 | |
|
709 | |
#define KEY_REPEAT "repeat"
|
710 | |
@@ -63,7 +60,6 @@
|
711 | |
#define KEY_INTERVAL "repeat-interval"
|
712 | |
#define KEY_DELAY "delay"
|
713 | |
#define KEY_CLICK_VOLUME "click-volume"
|
714 | |
-#define KEY_REMEMBER_NUMLOCK_STATE "remember-numlock-state"
|
715 | |
#define KEY_NUMLOCK_STATE "numlock-state"
|
716 | |
|
717 | |
#define KEY_BELL_VOLUME "bell-volume"
|
718 | |
@@ -71,560 +67,27 @@
|
719 | |
#define KEY_BELL_DURATION "bell-duration"
|
720 | |
#define KEY_BELL_MODE "bell-mode"
|
721 | |
|
722 | |
-#define KEY_SWITCHER "input-sources-switcher"
|
723 | |
-
|
724 | |
-#define GNOME_DESKTOP_INTERFACE_DIR "org.gnome.desktop.interface"
|
725 | |
-
|
726 | |
-#define KEY_GTK_IM_MODULE "gtk-im-module"
|
727 | |
-#define GTK_IM_MODULE_SIMPLE "gtk-im-context-simple"
|
728 | |
-#define GTK_IM_MODULE_IBUS "ibus"
|
729 | |
-
|
730 | |
-#define GNOME_DESKTOP_INPUT_SOURCES_DIR "org.gnome.desktop.input-sources"
|
731 | |
-
|
732 | |
-#define KEY_CURRENT_INPUT_SOURCE "current"
|
733 | |
-#define KEY_INPUT_SOURCES "sources"
|
734 | |
-#define KEY_KEYBOARD_OPTIONS "xkb-options"
|
735 | |
-
|
736 | |
-#define INPUT_SOURCE_TYPE_XKB "xkb"
|
737 | |
-#define INPUT_SOURCE_TYPE_IBUS "ibus"
|
738 | |
-
|
739 | |
-#define DEFAULT_LANGUAGE "en_US"
|
740 | |
+#define LIBGNOMEKBD_KEYBOARD_DIR "org.gnome.libgnomekbd.keyboard"
|
741 | |
+#define LIBGNOMEKBD_KEY_LAYOUTS "layouts"
|
742 | |
|
743 | |
struct GsdKeyboardManagerPrivate
|
744 | |
{
|
745 | |
guint start_idle_id;
|
746 | |
GSettings *settings;
|
747 | |
- GSettings *input_sources_settings;
|
748 | |
- GSettings *interface_settings;
|
749 | |
- GnomeXkbInfo *xkb_info;
|
750 | |
-#ifdef HAVE_IBUS
|
751 | |
- IBusBus *ibus;
|
752 | |
- GHashTable *ibus_engines;
|
753 | |
- GHashTable *ibus_xkb_engines;
|
754 | |
- GCancellable *ibus_cancellable;
|
755 | |
- gboolean session_is_fallback;
|
756 | |
-#endif
|
757 | |
+ GSettings *libgnomekbd_settings;
|
758 | |
+ gboolean have_xkb;
|
759 | |
gint xkb_event_base;
|
760 | |
GsdNumLockState old_state;
|
761 | |
- GdkDeviceManager *device_manager;
|
762 | |
- guint device_added_id;
|
763 | |
- guint device_removed_id;
|
764 | |
-
|
765 | |
- gboolean input_sources_switcher_spawned;
|
766 | |
- GPid input_sources_switcher_pid;
|
767 | |
};
|
768 | |
|
769 | |
static void gsd_keyboard_manager_class_init (GsdKeyboardManagerClass *klass);
|
770 | |
static void gsd_keyboard_manager_init (GsdKeyboardManager *keyboard_manager);
|
771 | |
static void gsd_keyboard_manager_finalize (GObject *object);
|
772 | |
-static gboolean apply_input_sources_settings (GSettings *settings,
|
773 | |
- gpointer keys,
|
774 | |
- gint n_keys,
|
775 | |
- GsdKeyboardManager *manager);
|
776 | |
-static void set_gtk_im_module (GsdKeyboardManager *manager,
|
777 | |
- const gchar *new_module);
|
778 | |
|
779 | |
G_DEFINE_TYPE (GsdKeyboardManager, gsd_keyboard_manager, G_TYPE_OBJECT)
|
780 | |
|
781 | |
static gpointer manager_object = NULL;
|
782 | |
|
783 | |
-static void
|
784 | |
-init_builder_with_sources (GVariantBuilder *builder,
|
785 | |
- GSettings *settings)
|
786 | |
-{
|
787 | |
- const gchar *type;
|
788 | |
- const gchar *id;
|
789 | |
- GVariantIter iter;
|
790 | |
- GVariant *sources;
|
791 | |
-
|
792 | |
- sources = g_settings_get_value (settings, KEY_INPUT_SOURCES);
|
793 | |
-
|
794 | |
- g_variant_builder_init (builder, G_VARIANT_TYPE ("a(ss)"));
|
795 | |
-
|
796 | |
- g_variant_iter_init (&iter, sources);
|
797 | |
- while (g_variant_iter_next (&iter, "(&s&s)", &type, &id))
|
798 | |
- g_variant_builder_add (builder, "(ss)", type, id);
|
799 | |
-
|
800 | |
- g_variant_unref (sources);
|
801 | |
-}
|
802 | |
-
|
803 | |
-static gboolean
|
804 | |
-schema_is_installed (const gchar *name)
|
805 | |
-{
|
806 | |
- const gchar * const *schemas;
|
807 | |
- const gchar * const *s;
|
808 | |
-
|
809 | |
- schemas = g_settings_list_schemas ();
|
810 | |
- for (s = schemas; *s; ++s)
|
811 | |
- if (g_str_equal (*s, name))
|
812 | |
- return TRUE;
|
813 | |
-
|
814 | |
- return FALSE;
|
815 | |
-}
|
816 | |
-
|
817 | |
-#ifdef HAVE_IBUS
|
818 | |
-static void
|
819 | |
-clear_ibus (GsdKeyboardManager *manager)
|
820 | |
-{
|
821 | |
- GsdKeyboardManagerPrivate *priv = manager->priv;
|
822 | |
-
|
823 | |
- g_cancellable_cancel (priv->ibus_cancellable);
|
824 | |
- g_clear_object (&priv->ibus_cancellable);
|
825 | |
- g_clear_pointer (&priv->ibus_engines, g_hash_table_destroy);
|
826 | |
- g_clear_pointer (&priv->ibus_xkb_engines, g_hash_table_destroy);
|
827 | |
- g_clear_object (&priv->ibus);
|
828 | |
-}
|
829 | |
-
|
830 | |
-static gchar *
|
831 | |
-make_xkb_source_id (const gchar *engine_id)
|
832 | |
-{
|
833 | |
- gchar *id;
|
834 | |
- gchar *p;
|
835 | |
- gint n_colons = 0;
|
836 | |
-
|
837 | |
- /* engine_id is like "xkb:layout:variant:lang" where
|
838 | |
- * 'variant' and 'lang' might be empty */
|
839 | |
-
|
840 | |
- engine_id += 4;
|
841 | |
-
|
842 | |
- for (p = (gchar *)engine_id; *p; ++p)
|
843 | |
- if (*p == ':')
|
844 | |
- if (++n_colons == 2)
|
845 | |
- break;
|
846 | |
- if (!*p)
|
847 | |
- return NULL;
|
848 | |
-
|
849 | |
- id = g_strndup (engine_id, p - engine_id + 1);
|
850 | |
-
|
851 | |
- id[p - engine_id] = '\0';
|
852 | |
-
|
853 | |
- /* id is "layout:variant" where 'variant' might be empty */
|
854 | |
-
|
855 | |
- for (p = id; *p; ++p)
|
856 | |
- if (*p == ':') {
|
857 | |
- if (*(p + 1) == '\0')
|
858 | |
- *p = '\0';
|
859 | |
- else
|
860 | |
- *p = '+';
|
861 | |
- break;
|
862 | |
- }
|
863 | |
-
|
864 | |
- /* id is "layout+variant" or "layout" */
|
865 | |
-
|
866 | |
- return id;
|
867 | |
-}
|
868 | |
-
|
869 | |
-static void
|
870 | |
-fetch_ibus_engines_result (GObject *object,
|
871 | |
- GAsyncResult *result,
|
872 | |
- GsdKeyboardManager *manager)
|
873 | |
-{
|
874 | |
- GsdKeyboardManagerPrivate *priv = manager->priv;
|
875 | |
- GList *list, *l;
|
876 | |
- GError *error = NULL;
|
877 | |
-
|
878 | |
- /* engines shouldn't be there yet */
|
879 | |
- g_return_if_fail (priv->ibus_engines == NULL);
|
880 | |
-
|
881 | |
- g_clear_object (&priv->ibus_cancellable);
|
882 | |
-
|
883 | |
- list = ibus_bus_list_engines_async_finish (priv->ibus,
|
884 | |
- result,
|
885 | |
- &error);
|
886 | |
- if (!list && error) {
|
887 | |
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
888 | |
- g_warning ("Couldn't finish IBus request: %s", error->message);
|
889 | |
- g_error_free (error);
|
890 | |
-
|
891 | |
- clear_ibus (manager);
|
892 | |
- return;
|
893 | |
- }
|
894 | |
-
|
895 | |
- /* Maps IBus engine ids to engine description objects */
|
896 | |
- priv->ibus_engines = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref);
|
897 | |
- /* Maps XKB source id strings to engine description objects */
|
898 | |
- priv->ibus_xkb_engines = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
|
899 | |
-
|
900 | |
- for (l = list; l; l = l->next) {
|
901 | |
- IBusEngineDesc *engine = l->data;
|
902 | |
- const gchar *engine_id = ibus_engine_desc_get_name (engine);
|
903 | |
-
|
904 | |
- g_hash_table_replace (priv->ibus_engines, (gpointer)engine_id, engine);
|
905 | |
-
|
906 | |
- if (strncmp ("xkb:", engine_id, 4) == 0) {
|
907 | |
- gchar *xkb_source_id = make_xkb_source_id (engine_id);
|
908 | |
- if (xkb_source_id)
|
909 | |
- g_hash_table_replace (priv->ibus_xkb_engines,
|
910 | |
- xkb_source_id,
|
911 | |
- engine);
|
912 | |
- }
|
913 | |
- }
|
914 | |
- g_list_free (list);
|
915 | |
-
|
916 | |
- apply_input_sources_settings (priv->input_sources_settings, NULL, 0, manager);
|
917 | |
-}
|
918 | |
-
|
919 | |
-static void
|
920 | |
-fetch_ibus_engines (GsdKeyboardManager *manager)
|
921 | |
-{
|
922 | |
- GsdKeyboardManagerPrivate *priv = manager->priv;
|
923 | |
-
|
924 | |
- /* engines shouldn't be there yet */
|
925 | |
- g_return_if_fail (priv->ibus_engines == NULL);
|
926 | |
- g_return_if_fail (priv->ibus_cancellable == NULL);
|
927 | |
-
|
928 | |
- priv->ibus_cancellable = g_cancellable_new ();
|
929 | |
-
|
930 | |
- ibus_bus_list_engines_async (priv->ibus,
|
931 | |
- -1,
|
932 | |
- priv->ibus_cancellable,
|
933 | |
- (GAsyncReadyCallback)fetch_ibus_engines_result,
|
934 | |
- manager);
|
935 | |
-}
|
936 | |
-
|
937 | |
-static void
|
938 | |
-maybe_start_ibus (GsdKeyboardManager *manager,
|
939 | |
- GVariant *sources)
|
940 | |
-{
|
941 | |
- gboolean need_ibus = FALSE;
|
942 | |
- GVariantIter iter;
|
943 | |
- const gchar *type;
|
944 | |
-
|
945 | |
- if (manager->priv->session_is_fallback)
|
946 | |
- return;
|
947 | |
-
|
948 | |
- g_variant_iter_init (&iter, sources);
|
949 | |
- while (g_variant_iter_next (&iter, "(&s&s)", &type, NULL))
|
950 | |
- if (g_str_equal (type, INPUT_SOURCE_TYPE_IBUS)) {
|
951 | |
- need_ibus = TRUE;
|
952 | |
- break;
|
953 | |
- }
|
954 | |
-
|
955 | |
- if (!need_ibus)
|
956 | |
- return;
|
957 | |
-
|
958 | |
- if (!manager->priv->ibus) {
|
959 | |
- ibus_init ();
|
960 | |
- manager->priv->ibus = ibus_bus_new_async ();
|
961 | |
- g_signal_connect_swapped (manager->priv->ibus, "connected",
|
962 | |
- G_CALLBACK (fetch_ibus_engines), manager);
|
963 | |
- g_signal_connect_swapped (manager->priv->ibus, "disconnected",
|
964 | |
- G_CALLBACK (clear_ibus), manager);
|
965 | |
- }
|
966 | |
- /* IBus doesn't export API in the session bus. The only thing
|
967 | |
- * we have there is a well known name which we can use as a
|
968 | |
- * sure-fire way to activate it. */
|
969 | |
- g_bus_unwatch_name (g_bus_watch_name (G_BUS_TYPE_SESSION,
|
970 | |
- IBUS_SERVICE_IBUS,
|
971 | |
- G_BUS_NAME_WATCHER_FLAGS_AUTO_START,
|
972 | |
- NULL,
|
973 | |
- NULL,
|
974 | |
- NULL,
|
975 | |
- NULL));
|
976 | |
-}
|
977 | |
-
|
978 | |
-static void
|
979 | |
-got_session_name (GObject *object,
|
980 | |
- GAsyncResult *res,
|
981 | |
- GsdKeyboardManager *manager)
|
982 | |
-{
|
983 | |
- GVariant *result, *variant;
|
984 | |
- GDBusConnection *connection = G_DBUS_CONNECTION (object);
|
985 | |
- GsdKeyboardManagerPrivate *priv = manager->priv;
|
986 | |
- const gchar *session_name = NULL;
|
987 | |
- GError *error = NULL;
|
988 | |
-
|
989 | |
- /* IBus shouldn't have been touched yet */
|
990 | |
- g_return_if_fail (priv->ibus == NULL);
|
991 | |
-
|
992 | |
- g_clear_object (&priv->ibus_cancellable);
|
993 | |
-
|
994 | |
- result = g_dbus_connection_call_finish (connection, res, &error);
|
995 | |
- if (!result) {
|
996 | |
- g_warning ("Couldn't get session name: %s", error->message);
|
997 | |
- g_error_free (error);
|
998 | |
- goto out;
|
999 | |
- }
|
1000 | |
-
|
1001 | |
- g_variant_get (result, "(v)", &variant);
|
1002 | |
- g_variant_unref (result);
|
1003 | |
-
|
1004 | |
- g_variant_get (variant, "&s", &session_name);
|
1005 | |
-
|
1006 | |
- if (g_strcmp0 (session_name, "gnome") == 0)
|
1007 | |
- manager->priv->session_is_fallback = FALSE;
|
1008 | |
-
|
1009 | |
- g_variant_unref (variant);
|
1010 | |
- out:
|
1011 | |
- apply_input_sources_settings (manager->priv->input_sources_settings, NULL, 0, manager);
|
1012 | |
- g_object_unref (connection);
|
1013 | |
-}
|
1014 | |
-
|
1015 | |
-static void
|
1016 | |
-got_bus (GObject *object,
|
1017 | |
- GAsyncResult *res,
|
1018 | |
- GsdKeyboardManager *manager)
|
1019 | |
-{
|
1020 | |
- GDBusConnection *connection;
|
1021 | |
- GsdKeyboardManagerPrivate *priv = manager->priv;
|
1022 | |
- GError *error = NULL;
|
1023 | |
-
|
1024 | |
- /* IBus shouldn't have been touched yet */
|
1025 | |
- g_return_if_fail (priv->ibus == NULL);
|
1026 | |
-
|
1027 | |
- g_clear_object (&priv->ibus_cancellable);
|
1028 | |
-
|
1029 | |
- connection = g_bus_get_finish (res, &error);
|
1030 | |
- if (!connection) {
|
1031 | |
- g_warning ("Couldn't get session bus: %s", error->message);
|
1032 | |
- g_error_free (error);
|
1033 | |
- apply_input_sources_settings (priv->input_sources_settings, NULL, 0, manager);
|
1034 | |
- return;
|
1035 | |
- }
|
1036 | |
-
|
1037 | |
- priv->ibus_cancellable = g_cancellable_new ();
|
1038 | |
-
|
1039 | |
- g_dbus_connection_call (connection,
|
1040 | |
- "org.gnome.SessionManager",
|
1041 | |
- "/org/gnome/SessionManager",
|
1042 | |
- "org.freedesktop.DBus.Properties",
|
1043 | |
- "Get",
|
1044 | |
- g_variant_new ("(ss)",
|
1045 | |
- "org.gnome.SessionManager",
|
1046 | |
- "SessionName"),
|
1047 | |
- NULL,
|
1048 | |
- G_DBUS_CALL_FLAGS_NONE,
|
1049 | |
- -1,
|
1050 | |
- priv->ibus_cancellable,
|
1051 | |
- (GAsyncReadyCallback)got_session_name,
|
1052 | |
- manager);
|
1053 | |
-}
|
1054 | |
-
|
1055 | |
-static void
|
1056 | |
-set_ibus_engine_finish (GObject *object,
|
1057 | |
- GAsyncResult *res,
|
1058 | |
- GsdKeyboardManager *manager)
|
1059 | |
-{
|
1060 | |
- gboolean result;
|
1061 | |
- IBusBus *ibus = IBUS_BUS (object);
|
1062 | |
- GsdKeyboardManagerPrivate *priv = manager->priv;
|
1063 | |
- GError *error = NULL;
|
1064 | |
-
|
1065 | |
- g_clear_object (&priv->ibus_cancellable);
|
1066 | |
-
|
1067 | |
- result = ibus_bus_set_global_engine_async_finish (ibus, res, &error);
|
1068 | |
- if (!result) {
|
1069 | |
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
1070 | |
- g_warning ("Couldn't set IBus engine: %s", error->message);
|
1071 | |
- g_error_free (error);
|
1072 | |
- }
|
1073 | |
-}
|
1074 | |
-
|
1075 | |
-static void
|
1076 | |
-set_ibus_engine (GsdKeyboardManager *manager,
|
1077 | |
- const gchar *engine_id)
|
1078 | |
-{
|
1079 | |
- GsdKeyboardManagerPrivate *priv = manager->priv;
|
1080 | |
-
|
1081 | |
- g_return_if_fail (priv->ibus != NULL);
|
1082 | |
- g_return_if_fail (priv->ibus_engines != NULL);
|
1083 | |
-
|
1084 | |
- g_cancellable_cancel (priv->ibus_cancellable);
|
1085 | |
- g_clear_object (&priv->ibus_cancellable);
|
1086 | |
- priv->ibus_cancellable = g_cancellable_new ();
|
1087 | |
-
|
1088 | |
- ibus_bus_set_global_engine_async (priv->ibus,
|
1089 | |
- engine_id,
|
1090 | |
- -1,
|
1091 | |
- priv->ibus_cancellable,
|
1092 | |
- (GAsyncReadyCallback)set_ibus_engine_finish,
|
1093 | |
- manager);
|
1094 | |
-}
|
1095 | |
-
|
1096 | |
-static void
|
1097 | |
-set_ibus_xkb_engine (GsdKeyboardManager *manager,
|
1098 | |
- const gchar *xkb_id)
|
1099 | |
-{
|
1100 | |
- IBusEngineDesc *engine;
|
1101 | |
- GsdKeyboardManagerPrivate *priv = manager->priv;
|
1102 | |
-
|
1103 | |
- if (!priv->ibus_xkb_engines)
|
1104 | |
- return;
|
1105 | |
-
|
1106 | |
- engine = g_hash_table_lookup (priv->ibus_xkb_engines, xkb_id);
|
1107 | |
- if (!engine)
|
1108 | |
- return;
|
1109 | |
-
|
1110 | |
- set_ibus_engine (manager, ibus_engine_desc_get_name (engine));
|
1111 | |
-}
|
1112 | |
-
|
1113 | |
-/* XXX: See upstream bug:
|
1114 | |
- * https://codereview.appspot.com/6586075/ */
|
1115 | |
-static gchar *
|
1116 | |
-layout_from_ibus_layout (const gchar *ibus_layout)
|
1117 | |
-{
|
1118 | |
- const gchar *p;
|
1119 | |
-
|
1120 | |
- /* we get something like "layout(variant)[option1,option2]" */
|
1121 | |
-
|
1122 | |
- p = ibus_layout;
|
1123 | |
- while (*p) {
|
1124 | |
- if (*p == '(' || *p == '[')
|
1125 | |
- break;
|
1126 | |
- p += 1;
|
1127 | |
- }
|
1128 | |
-
|
1129 | |
- return g_strndup (ibus_layout, p - ibus_layout);
|
1130 | |
-}
|
1131 | |
-
|
1132 | |
-static gchar *
|
1133 | |
-variant_from_ibus_layout (const gchar *ibus_layout)
|
1134 | |
-{
|
1135 | |
- const gchar *a, *b;
|
1136 | |
-
|
1137 | |
- /* we get something like "layout(variant)[option1,option2]" */
|
1138 | |
-
|
1139 | |
- a = ibus_layout;
|
1140 | |
- while (*a) {
|
1141 | |
- if (*a == '(')
|
1142 | |
- break;
|
1143 | |
- a += 1;
|
1144 | |
- }
|
1145 | |
- if (!*a)
|
1146 | |
- return NULL;
|
1147 | |
-
|
1148 | |
- a += 1;
|
1149 | |
- b = a;
|
1150 | |
- while (*b) {
|
1151 | |
- if (*b == ')')
|
1152 | |
- break;
|
1153 | |
- b += 1;
|
1154 | |
- }
|
1155 | |
- if (!*b)
|
1156 | |
- return NULL;
|
1157 | |
-
|
1158 | |
- return g_strndup (a, b - a);
|
1159 | |
-}
|
1160 | |
-
|
1161 | |
-static gchar **
|
1162 | |
-options_from_ibus_layout (const gchar *ibus_layout)
|
1163 | |
-{
|
1164 | |
- const gchar *a, *b;
|
1165 | |
- GPtrArray *opt_array;
|
1166 | |
-
|
1167 | |
- /* we get something like "layout(variant)[option1,option2]" */
|
1168 | |
-
|
1169 | |
- a = ibus_layout;
|
1170 | |
- while (*a) {
|
1171 | |
- if (*a == '[')
|
1172 | |
- break;
|
1173 | |
- a += 1;
|
1174 | |
- }
|
1175 | |
- if (!*a)
|
1176 | |
- return NULL;
|
1177 | |
-
|
1178 | |
- opt_array = g_ptr_array_new ();
|
1179 | |
-
|
1180 | |
- do {
|
1181 | |
- a += 1;
|
1182 | |
- b = a;
|
1183 | |
- while (*b) {
|
1184 | |
- if (*b == ',' || *b == ']')
|
1185 | |
- break;
|
1186 | |
- b += 1;
|
1187 | |
- }
|
1188 | |
- if (!*b)
|
1189 | |
- goto out;
|
1190 | |
-
|
1191 | |
- g_ptr_array_add (opt_array, g_strndup (a, b - a));
|
1192 | |
-
|
1193 | |
- a = b;
|
1194 | |
- } while (*a && *a == ',');
|
1195 | |
-
|
1196 | |
-out:
|
1197 | |
- g_ptr_array_add (opt_array, NULL);
|
1198 | |
- return (gchar **) g_ptr_array_free (opt_array, FALSE);
|
1199 | |
-}
|
1200 | |
-
|
1201 | |
-static const gchar *
|
1202 | |
-engine_from_locale (void)
|
1203 | |
-{
|
1204 | |
- const gchar *locale;
|
1205 | |
- const gchar *locale_engine[][2] = {
|
1206 | |
- { "as_IN", "m17n:as:phonetic" },
|
1207 | |
- { "bn_IN", "m17n:bn:inscript" },
|
1208 | |
- { "gu_IN", "m17n:gu:inscript" },
|
1209 | |
- { "hi_IN", "m17n:hi:inscript" },
|
1210 | |
- { "ja_JP", "anthy" },
|
1211 | |
- { "kn_IN", "m17n:kn:kgp" },
|
1212 | |
- { "ko_KR", "hangul" },
|
1213 | |
- { "mai_IN", "m17n:mai:inscript" },
|
1214 | |
- { "ml_IN", "m17n:ml:inscript" },
|
1215 | |
- { "mr_IN", "m17n:mr:inscript" },
|
1216 | |
- { "or_IN", "m17n:or:inscript" },
|
1217 | |
- { "pa_IN", "m17n:pa:inscript" },
|
1218 | |
- { "sd_IN", "m17n:sd:inscript" },
|
1219 | |
- { "ta_IN", "m17n:ta:tamil99" },
|
1220 | |
- { "te_IN", "m17n:te:inscript" },
|
1221 | |
- { "zh_CN", "pinyin" },
|
1222 | |
- { "zh_HK", "cangjie3" },
|
1223 | |
- { "zh_TW", "chewing" },
|
1224 | |
- };
|
1225 | |
- gint i;
|
1226 | |
-
|
1227 | |
- locale = setlocale (LC_CTYPE, NULL);
|
1228 | |
- if (!locale)
|
1229 | |
- return NULL;
|
1230 | |
-
|
1231 | |
- for (i = 0; i < G_N_ELEMENTS (locale_engine); ++i)
|
1232 | |
- if (g_str_has_prefix (locale, locale_engine[i][0]))
|
1233 | |
- return locale_engine[i][1];
|
1234 | |
-
|
1235 | |
- return NULL;
|
1236 | |
-}
|
1237 | |
-
|
1238 | |
-static void
|
1239 | |
-add_ibus_sources_from_locale (GSettings *settings)
|
1240 | |
-{
|
1241 | |
- const gchar *locale_engine;
|
1242 | |
- GVariantBuilder builder;
|
1243 | |
-
|
1244 | |
- locale_engine = engine_from_locale ();
|
1245 | |
- if (!locale_engine)
|
1246 | |
- return;
|
1247 | |
-
|
1248 | |
- init_builder_with_sources (&builder, settings);
|
1249 | |
- g_variant_builder_add (&builder, "(ss)", INPUT_SOURCE_TYPE_IBUS, locale_engine);
|
1250 | |
- g_settings_set_value (settings, KEY_INPUT_SOURCES, g_variant_builder_end (&builder));
|
1251 | |
-}
|
1252 | |
-
|
1253 | |
-static void
|
1254 | |
-convert_ibus (GSettings *settings)
|
1255 | |
-{
|
1256 | |
- GVariantBuilder builder;
|
1257 | |
- GSettings *ibus_settings;
|
1258 | |
- gchar **engines, **e;
|
1259 | |
-
|
1260 | |
- if (!schema_is_installed ("org.freedesktop.ibus.general"))
|
1261 | |
- return;
|
1262 | |
-
|
1263 | |
- init_builder_with_sources (&builder, settings);
|
1264 | |
-
|
1265 | |
- ibus_settings = g_settings_new ("org.freedesktop.ibus.general");
|
1266 | |
- engines = g_settings_get_strv (ibus_settings, "preload-engines");
|
1267 | |
- for (e = engines; *e; ++e) {
|
1268 | |
- if (g_str_has_prefix (*e, "xkb:"))
|
1269 | |
- continue;
|
1270 | |
- g_variant_builder_add (&builder, "(ss)", INPUT_SOURCE_TYPE_IBUS, *e);
|
1271 | |
- }
|
1272 | |
-
|
1273 | |
- g_settings_set_value (settings, KEY_INPUT_SOURCES, g_variant_builder_end (&builder));
|
1274 | |
-
|
1275 | |
- g_strfreev (engines);
|
1276 | |
- g_object_unref (ibus_settings);
|
1277 | |
-}
|
1278 | |
-#endif /* HAVE_IBUS */
|
1279 | |
-
|
1280 | |
static gboolean
|
1281 | |
xkb_set_keyboard_autorepeat_rate (guint delay, guint interval)
|
1282 | |
{
|
1283 | |
@@ -634,33 +97,32 @@
|
1284 | |
interval);
|
1285 | |
}
|
1286 | |
|
1287 | |
-static gboolean
|
1288 | |
-check_xkb_extension (GsdKeyboardManager *manager)
|
1289 | |
+static void
|
1290 | |
+numlock_xkb_init (GsdKeyboardManager *manager)
|
1291 | |
{
|
1292 | |
Display *dpy = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
1293 | |
- int opcode, error_base, major, minor;
|
1294 | |
gboolean have_xkb;
|
1295 | |
+ int opcode, error_base, major, minor;
|
1296 | |
|
1297 | |
have_xkb = XkbQueryExtension (dpy,
|
1298 | |
&opcode,
|
1299 | |
&manager->priv->xkb_event_base,
|
1300 | |
&error_base,
|
1301 | |
&major,
|
1302 | |
- &minor);
|
1303 | |
- return have_xkb;
|
1304 | |
-}
|
1305 | |
+ &minor)
|
1306 | |
+ && XkbUseExtension (dpy, &major, &minor);
|
1307 | |
|
1308 | |
-static void
|
1309 | |
-xkb_init (GsdKeyboardManager *manager)
|
1310 | |
-{
|
1311 | |
- Display *dpy;
|
1312 | |
+ if (have_xkb) {
|
1313 | |
+ XkbSelectEventDetails (dpy,
|
1314 | |
+ XkbUseCoreKbd,
|
1315 | |
+ XkbStateNotifyMask,
|
1316 | |
+ XkbModifierLockMask,
|
1317 | |
+ XkbModifierLockMask);
|
1318 | |
+ } else {
|
1319 | |
+ g_warning ("XKB extension not available");
|
1320 | |
+ }
|
1321 | |
|
1322 | |
- dpy = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
1323 | |
- XkbSelectEventDetails (dpy,
|
1324 | |
- XkbUseCoreKbd,
|
1325 | |
- XkbStateNotify,
|
1326 | |
- XkbModifierLockMask,
|
1327 | |
- XkbModifierLockMask);
|
1328 | |
+ manager->priv->have_xkb = have_xkb;
|
1329 | |
}
|
1330 | |
|
1331 | |
static unsigned
|
1332 | |
@@ -681,32 +143,19 @@
|
1333 | |
XkbLockModifiers (dpy, XkbUseCoreKbd, num_mask, new_state == GSD_NUM_LOCK_STATE_ON ? num_mask : 0);
|
1334 | |
}
|
1335 | |
|
1336 | |
-static const char *
|
1337 | |
-num_lock_state_to_string (GsdNumLockState numlock_state)
|
1338 | |
-{
|
1339 | |
- switch (numlock_state) {
|
1340 | |
- case GSD_NUM_LOCK_STATE_UNKNOWN:
|
1341 | |
- return "GSD_NUM_LOCK_STATE_UNKNOWN";
|
1342 | |
- case GSD_NUM_LOCK_STATE_ON:
|
1343 | |
- return "GSD_NUM_LOCK_STATE_ON";
|
1344 | |
- case GSD_NUM_LOCK_STATE_OFF:
|
1345 | |
- return "GSD_NUM_LOCK_STATE_OFF";
|
1346 | |
- default:
|
1347 | |
- return "UNKNOWN";
|
1348 | |
- }
|
1349 | |
-}
|
1350 | |
-
|
1351 | |
static GdkFilterReturn
|
1352 | |
-xkb_events_filter (GdkXEvent *xev_,
|
1353 | |
- GdkEvent *gdkev_,
|
1354 | |
- gpointer user_data)
|
1355 | |
+numlock_xkb_callback (GdkXEvent *xev_,
|
1356 | |
+ GdkEvent *gdkev_,
|
1357 | |
+ gpointer user_data)
|
1358 | |
{
|
1359 | |
XEvent *xev = (XEvent *) xev_;
|
1360 | |
XkbEvent *xkbev = (XkbEvent *) xev;
|
1361 | |
GsdKeyboardManager *manager = (GsdKeyboardManager *) user_data;
|
1362 | |
|
1363 | |
- if (xev->type != manager->priv->xkb_event_base ||
|
1364 | |
- xkbev->any.xkb_type != XkbStateNotify)
|
1365 | |
+ if (xev->type != manager->priv->xkb_event_base)
|
1366 | |
+ return GDK_FILTER_CONTINUE;
|
1367 | |
+
|
1368 | |
+ if (xkbev->any.xkb_type != XkbStateNotify)
|
1369 | |
return GDK_FILTER_CONTINUE;
|
1370 | |
|
1371 | |
if (xkbev->state.changed & XkbModifierLockMask) {
|
1372 | |
@@ -717,9 +166,6 @@
|
1373 | |
numlock_state = (num_mask & locked_mods) ? GSD_NUM_LOCK_STATE_ON : GSD_NUM_LOCK_STATE_OFF;
|
1374 | |
|
1375 | |
if (numlock_state != manager->priv->old_state) {
|
1376 | |
- g_debug ("New num-lock state '%s' != Old num-lock state '%s'",
|
1377 | |
- num_lock_state_to_string (numlock_state),
|
1378 | |
- num_lock_state_to_string (manager->priv->old_state));
|
1379 | |
g_settings_set_enum (manager->priv->settings,
|
1380 | |
KEY_NUMLOCK_STATE,
|
1381 | |
numlock_state);
|
1382 | |
@@ -731,509 +177,57 @@
|
1383 | |
}
|
1384 | |
|
1385 | |
static void
|
1386 | |
-install_xkb_filter (GsdKeyboardManager *manager)
|
1387 | |
+numlock_install_xkb_callback (GsdKeyboardManager *manager)
|
1388 | |
{
|
1389 | |
- gdk_window_add_filter (NULL,
|
1390 | |
- xkb_events_filter,
|
1391 | |
- manager);
|
1392 | |
-}
|
1393 | |
-
|
1394 | |
-static void
|
1395 | |
-remove_xkb_filter (GsdKeyboardManager *manager)
|
1396 | |
-{
|
1397 | |
- gdk_window_remove_filter (NULL,
|
1398 | |
- xkb_events_filter,
|
1399 | |
- manager);
|
1400 | |
-}
|
1401 | |
-
|
1402 | |
-static void
|
1403 | |
-free_xkb_component_names (XkbComponentNamesRec *p)
|
1404 | |
-{
|
1405 | |
- g_return_if_fail (p != NULL);
|
1406 | |
-
|
1407 | |
- free (p->keymap);
|
1408 | |
- free (p->keycodes);
|
1409 | |
- free (p->types);
|
1410 | |
- free (p->compat);
|
1411 | |
- free (p->symbols);
|
1412 | |
- free (p->geometry);
|
1413 | |
-
|
1414 | |
- g_free (p);
|
1415 | |
-}
|
1416 | |
-
|
1417 | |
-static void
|
1418 | |
-upload_xkb_description (const gchar *rules_file_path,
|
1419 | |
- XkbRF_VarDefsRec *var_defs,
|
1420 | |
- XkbComponentNamesRec *comp_names)
|
1421 | |
-{
|
1422 | |
- Display *display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
1423 | |
- XkbDescRec *xkb_desc;
|
1424 | |
- gchar *rules_file;
|
1425 | |
-
|
1426 | |
- /* Upload it to the X server using the same method as setxkbmap */
|
1427 | |
- xkb_desc = XkbGetKeyboardByName (display,
|
1428 | |
- XkbUseCoreKbd,
|
1429 | |
- comp_names,
|
1430 | |
- XkbGBN_AllComponentsMask,
|
1431 | |
- XkbGBN_AllComponentsMask &
|
1432 | |
- (~XkbGBN_GeometryMask), True);
|
1433 | |
- if (!xkb_desc) {
|
1434 | |
- g_warning ("Couldn't upload new XKB keyboard description");
|
1435 | |
+ if (!manager->priv->have_xkb)
|
1436 | |
return;
|
1437 | |
- }
|
1438 | |
-
|
1439 | |
- XkbFreeKeyboard (xkb_desc, 0, True);
|
1440 | |
-
|
1441 | |
- rules_file = g_path_get_basename (rules_file_path);
|
1442 | |
|
1443 | |
- if (!XkbRF_SetNamesProp (display, rules_file, var_defs))
|
1444 | |
- g_warning ("Couldn't update the XKB root window property");
|
1445 | |
-
|
1446 | |
- g_free (rules_file);
|
1447 | |
-}
|
1448 | |
-
|
1449 | |
-static gchar *
|
1450 | |
-language_code_from_locale (const gchar *locale)
|
1451 | |
-{
|
1452 | |
- if (!locale || !locale[0] || !locale[1])
|
1453 | |
- return NULL;
|
1454 | |
-
|
1455 | |
- if (!locale[2] || locale[2] == '_' || locale[2] == '.')
|
1456 | |
- return g_strndup (locale, 2);
|
1457 | |
-
|
1458 | |
- if (!locale[3] || locale[3] == '_' || locale[3] == '.')
|
1459 | |
- return g_strndup (locale, 3);
|
1460 | |
-
|
1461 | |
- return NULL;
|
1462 | |
-}
|
1463 | |
-
|
1464 | |
-static gchar *
|
1465 | |
-build_xkb_group_string (const gchar *user,
|
1466 | |
- const gchar *locale,
|
1467 | |
- const gchar *latin)
|
1468 | |
-{
|
1469 | |
- gchar *string;
|
1470 | |
- gsize length = 0;
|
1471 | |
- guint commas = 2;
|
1472 | |
-
|
1473 | |
- if (latin)
|
1474 | |
- length += strlen (latin);
|
1475 | |
- else
|
1476 | |
- commas -= 1;
|
1477 | |
-
|
1478 | |
- if (locale)
|
1479 | |
- length += strlen (locale);
|
1480 | |
- else
|
1481 | |
- commas -= 1;
|
1482 | |
-
|
1483 | |
- length += strlen (user) + commas + 1;
|
1484 | |
-
|
1485 | |
- string = malloc (length);
|
1486 | |
-
|
1487 | |
- if (locale && latin)
|
1488 | |
- sprintf (string, "%s,%s,%s", user, locale, latin);
|
1489 | |
- else if (locale)
|
1490 | |
- sprintf (string, "%s,%s", user, locale);
|
1491 | |
- else if (latin)
|
1492 | |
- sprintf (string, "%s,%s", user, latin);
|
1493 | |
- else
|
1494 | |
- sprintf (string, "%s", user);
|
1495 | |
-
|
1496 | |
- return string;
|
1497 | |
-}
|
1498 | |
-
|
1499 | |
-static gboolean
|
1500 | |
-layout_equal (const gchar *layout_a,
|
1501 | |
- const gchar *variant_a,
|
1502 | |
- const gchar *layout_b,
|
1503 | |
- const gchar *variant_b)
|
1504 | |
-{
|
1505 | |
- return !g_strcmp0 (layout_a, layout_b) && !g_strcmp0 (variant_a, variant_b);
|
1506 | |
-}
|
1507 | |
-
|
1508 | |
-static void
|
1509 | |
-replace_layout_and_variant (GsdKeyboardManager *manager,
|
1510 | |
- XkbRF_VarDefsRec *xkb_var_defs,
|
1511 | |
- const gchar *layout,
|
1512 | |
- const gchar *variant)
|
1513 | |
-{
|
1514 | |
- /* Toolkits need to know about both a latin layout to handle
|
1515 | |
- * accelerators which are usually defined like Ctrl+C and a
|
1516 | |
- * layout with the symbols for the language used in UI strings
|
1517 | |
- * to handle mnemonics like Alt+Ф, so we try to find and add
|
1518 | |
- * them in XKB group slots after the layout which the user
|
1519 | |
- * actually intends to type with. */
|
1520 | |
- const gchar *latin_layout = "us";
|
1521 | |
- const gchar *latin_variant = "";
|
1522 | |
- const gchar *locale_layout = NULL;
|
1523 | |
- const gchar *locale_variant = NULL;
|
1524 | |
- const gchar *locale;
|
1525 | |
- gchar *language;
|
1526 | |
-
|
1527 | |
- if (!layout)
|
1528 | |
- return;
|
1529 | |
-
|
1530 | |
- if (!variant)
|
1531 | |
- variant = "";
|
1532 | |
-
|
1533 | |
- locale = setlocale (LC_MESSAGES, NULL);
|
1534 | |
- /* If LANG is empty, default to en_US */
|
1535 | |
- if (!locale)
|
1536 | |
- language = g_strdup (DEFAULT_LANGUAGE);
|
1537 | |
- else
|
1538 | |
- language = language_code_from_locale (locale);
|
1539 | |
-
|
1540 | |
- if (!language)
|
1541 | |
- language = language_code_from_locale (DEFAULT_LANGUAGE);
|
1542 | |
-
|
1543 | |
- gnome_xkb_info_get_layout_info_for_language (manager->priv->xkb_info,
|
1544 | |
- language,
|
1545 | |
- NULL,
|
1546 | |
- NULL,
|
1547 | |
- NULL,
|
1548 | |
- &locale_layout,
|
1549 | |
- &locale_variant);
|
1550 | |
- g_free (language);
|
1551 | |
-
|
1552 | |
- /* We want to minimize the number of XKB groups if we have
|
1553 | |
- * duplicated layout+variant pairs.
|
1554 | |
- *
|
1555 | |
- * Also, if a layout doesn't have a variant we still have to
|
1556 | |
- * include it in the variants string because the number of
|
1557 | |
- * variants must agree with the number of layouts. For
|
1558 | |
- * instance:
|
1559 | |
- *
|
1560 | |
- * layouts: "us,ru,us"
|
1561 | |
- * variants: "dvorak,,"
|
1562 | |
- */
|
1563 | |
- if (layout_equal (latin_layout, latin_variant, locale_layout, locale_variant) ||
|
1564 | |
- layout_equal (latin_layout, latin_variant, layout, variant)) {
|
1565 | |
- latin_layout = NULL;
|
1566 | |
- latin_variant = NULL;
|
1567 | |
- }
|
1568 | |
-
|
1569 | |
- if (layout_equal (locale_layout, locale_variant, layout, variant)) {
|
1570 | |
- locale_layout = NULL;
|
1571 | |
- locale_variant = NULL;
|
1572 | |
- }
|
1573 | |
-
|
1574 | |
- free (xkb_var_defs->layout);
|
1575 | |
- xkb_var_defs->layout = build_xkb_group_string (layout, locale_layout, latin_layout);
|
1576 | |
-
|
1577 | |
- free (xkb_var_defs->variant);
|
1578 | |
- xkb_var_defs->variant = build_xkb_group_string (variant, locale_variant, latin_variant);
|
1579 | |
-}
|
1580 | |
-
|
1581 | |
-static gchar *
|
1582 | |
-build_xkb_options_string (gchar **options)
|
1583 | |
-{
|
1584 | |
- gchar *string;
|
1585 | |
-
|
1586 | |
- if (*options) {
|
1587 | |
- gint i;
|
1588 | |
- gsize len;
|
1589 | |
- gchar *ptr;
|
1590 | |
-
|
1591 | |
- /* First part, getting length */
|
1592 | |
- len = 1 + strlen (options[0]);
|
1593 | |
- for (i = 1; options[i] != NULL; i++)
|
1594 | |
- len += strlen (options[i]);
|
1595 | |
- len += (i - 1); /* commas */
|
1596 | |
-
|
1597 | |
- /* Second part, building string */
|
1598 | |
- string = malloc (len);
|
1599 | |
- ptr = g_stpcpy (string, *options);
|
1600 | |
- for (i = 1; options[i] != NULL; i++) {
|
1601 | |
- ptr = g_stpcpy (ptr, ",");
|
1602 | |
- ptr = g_stpcpy (ptr, options[i]);
|
1603 | |
- }
|
1604 | |
- } else {
|
1605 | |
- string = malloc (1);
|
1606 | |
- *string = '\0';
|
1607 | |
- }
|
1608 | |
-
|
1609 | |
- return string;
|
1610 | |
-}
|
1611 | |
-
|
1612 | |
-static gchar **
|
1613 | |
-append_options (gchar **a,
|
1614 | |
- gchar **b)
|
1615 | |
-{
|
1616 | |
- gchar **c, **p;
|
1617 | |
-
|
1618 | |
- if (!a && !b)
|
1619 | |
- return NULL;
|
1620 | |
- else if (!a)
|
1621 | |
- return g_strdupv (b);
|
1622 | |
- else if (!b)
|
1623 | |
- return g_strdupv (a);
|
1624 | |
-
|
1625 | |
- c = g_new0 (gchar *, g_strv_length (a) + g_strv_length (b) + 1);
|
1626 | |
- p = c;
|
1627 | |
-
|
1628 | |
- while (*a) {
|
1629 | |
- *p = g_strdup (*a);
|
1630 | |
- p += 1;
|
1631 | |
- a += 1;
|
1632 | |
- }
|
1633 | |
- while (*b) {
|
1634 | |
- *p = g_strdup (*b);
|
1635 | |
- p += 1;
|
1636 | |
- b += 1;
|
1637 | |
- }
|
1638 | |
-
|
1639 | |
- return c;
|
1640 | |
-}
|
1641 | |
-
|
1642 | |
-static void
|
1643 | |
-add_xkb_options (GsdKeyboardManager *manager,
|
1644 | |
- XkbRF_VarDefsRec *xkb_var_defs,
|
1645 | |
- gchar **extra_options)
|
1646 | |
-{
|
1647 | |
- gchar **options;
|
1648 | |
- gchar **settings_options;
|
1649 | |
-
|
1650 | |
- settings_options = g_settings_get_strv (manager->priv->input_sources_settings,
|
1651 | |
- KEY_KEYBOARD_OPTIONS);
|
1652 | |
- options = append_options (settings_options, extra_options);
|
1653 | |
- g_strfreev (settings_options);
|
1654 | |
-
|
1655 | |
- free (xkb_var_defs->options);
|
1656 | |
- xkb_var_defs->options = build_xkb_options_string (options);
|
1657 | |
-
|
1658 | |
- g_strfreev (options);
|
1659 | |
+ gdk_window_add_filter (NULL,
|
1660 | |
+ numlock_xkb_callback,
|
1661 | |
+ manager);
|
1662 | |
}
|
1663 | |
|
1664 | |
-static void
|
1665 | |
-apply_xkb_settings (GsdKeyboardManager *manager,
|
1666 | |
- const gchar *layout,
|
1667 | |
- const gchar *variant,
|
1668 | |
- gchar **options)
|
1669 | |
+static guint
|
1670 | |
+_gsd_settings_get_uint (GSettings *settings,
|
1671 | |
+ const char *key)
|
1672 | |
{
|
1673 | |
- XkbRF_RulesRec *xkb_rules;
|
1674 | |
- XkbRF_VarDefsRec *xkb_var_defs;
|
1675 | |
- gchar *rules_file_path;
|
1676 | |
-
|
1677 | |
- gnome_xkb_info_get_var_defs (&rules_file_path, &xkb_var_defs);
|
1678 | |
-
|
1679 | |
- add_xkb_options (manager, xkb_var_defs, options);
|
1680 | |
- replace_layout_and_variant (manager, xkb_var_defs, layout, variant);
|
1681 | |
-
|
1682 | |
- gdk_error_trap_push ();
|
1683 | |
-
|
1684 | |
- xkb_rules = XkbRF_Load (rules_file_path, NULL, True, True);
|
1685 | |
- if (xkb_rules) {
|
1686 | |
- XkbComponentNamesRec *xkb_comp_names;
|
1687 | |
- xkb_comp_names = g_new0 (XkbComponentNamesRec, 1);
|
1688 | |
-
|
1689 | |
- XkbRF_GetComponents (xkb_rules, xkb_var_defs, xkb_comp_names);
|
1690 | |
- upload_xkb_description (rules_file_path, xkb_var_defs, xkb_comp_names);
|
1691 | |
+ guint value;
|
1692 | |
|
1693 | |
- free_xkb_component_names (xkb_comp_names);
|
1694 | |
- XkbRF_Free (xkb_rules, True);
|
1695 | |
- } else {
|
1696 | |
- g_warning ("Couldn't load XKB rules");
|
1697 | |
- }
|
1698 | |
-
|
1699 | |
- if (gdk_error_trap_pop ())
|
1700 | |
- g_warning ("Error loading XKB rules");
|
1701 | |
-
|
1702 | |
- gnome_xkb_info_free_var_defs (xkb_var_defs);
|
1703 | |
- g_free (rules_file_path);
|
1704 | |
+ g_settings_get (settings, key, "u", &value);
|
1705 | |
+ return value;
|
1706 | |
}
|
1707 | |
|
1708 | |
static void
|
1709 | |
-set_gtk_im_module (GsdKeyboardManager *manager,
|
1710 | |
- const gchar *new_module)
|
1711 | |
-{
|
1712 | |
- GsdKeyboardManagerPrivate *priv = manager->priv;
|
1713 | |
- gchar *current_module;
|
1714 | |
-
|
1715 | |
- current_module = g_settings_get_string (priv->interface_settings,
|
1716 | |
- KEY_GTK_IM_MODULE);
|
1717 | |
- if (!g_str_equal (current_module, new_module))
|
1718 | |
- g_settings_set_string (priv->interface_settings,
|
1719 | |
- KEY_GTK_IM_MODULE,
|
1720 | |
- new_module);
|
1721 | |
- g_free (current_module);
|
1722 | |
-}
|
1723 | |
-
|
1724 | |
-static gboolean
|
1725 | |
-apply_input_sources_settings (GSettings *settings,
|
1726 | |
- gpointer keys,
|
1727 | |
- gint n_keys,
|
1728 | |
- GsdKeyboardManager *manager)
|
1729 | |
+apply_settings (GSettings *settings,
|
1730 | |
+ const char *key,
|
1731 | |
+ GsdKeyboardManager *manager)
|
1732 | |
{
|
1733 | |
- GsdKeyboardManagerPrivate *priv = manager->priv;
|
1734 | |
- GVariant *sources;
|
1735 | |
- guint current;
|
1736 | |
- guint n_sources;
|
1737 | |
- const gchar *type = NULL;
|
1738 | |
- const gchar *id = NULL;
|
1739 | |
- gchar *layout = NULL;
|
1740 | |
- gchar *variant = NULL;
|
1741 | |
- gchar **options = NULL;
|
1742 | |
-
|
1743 | |
- sources = g_settings_get_value (priv->input_sources_settings, KEY_INPUT_SOURCES);
|
1744 | |
- current = g_settings_get_uint (priv->input_sources_settings, KEY_CURRENT_INPUT_SOURCE);
|
1745 | |
- n_sources = g_variant_n_children (sources);
|
1746 | |
-
|
1747 | |
- if (n_sources < 1)
|
1748 | |
- goto exit;
|
1749 | |
-
|
1750 | |
- if (current >= n_sources) {
|
1751 | |
- g_settings_set_uint (priv->input_sources_settings,
|
1752 | |
- KEY_CURRENT_INPUT_SOURCE,
|
1753 | |
- n_sources - 1);
|
1754 | |
- goto exit;
|
1755 | |
- }
|
1756 | |
-
|
1757 | |
-#ifdef HAVE_IBUS
|
1758 | |
- maybe_start_ibus (manager, sources);
|
1759 | |
-#endif
|
1760 | |
-
|
1761 | |
- g_variant_get_child (sources, current, "(&s&s)", &type, &id);
|
1762 | |
-
|
1763 | |
- if (g_str_equal (type, INPUT_SOURCE_TYPE_XKB)) {
|
1764 | |
- const gchar *l, *v;
|
1765 | |
- gnome_xkb_info_get_layout_info (priv->xkb_info, id, NULL, NULL, &l, &v);
|
1766 | |
-
|
1767 | |
- layout = g_strdup (l);
|
1768 | |
- variant = g_strdup (v);
|
1769 | |
-
|
1770 | |
- if (!layout || !layout[0]) {
|
1771 | |
- g_warning ("Couldn't find XKB input source '%s'", id);
|
1772 | |
- goto exit;
|
1773 | |
- }
|
1774 | |
- set_gtk_im_module (manager, GTK_IM_MODULE_SIMPLE);
|
1775 | |
-#ifdef HAVE_IBUS
|
1776 | |
- set_ibus_xkb_engine (manager, id);
|
1777 | |
-#endif
|
1778 | |
- } else if (g_str_equal (type, INPUT_SOURCE_TYPE_IBUS)) {
|
1779 | |
-#ifdef HAVE_IBUS
|
1780 | |
- IBusEngineDesc *engine_desc = NULL;
|
1781 | |
-
|
1782 | |
- if (priv->session_is_fallback)
|
1783 | |
- goto exit;
|
1784 | |
-
|
1785 | |
- if (priv->ibus_engines)
|
1786 | |
- engine_desc = g_hash_table_lookup (priv->ibus_engines, id);
|
1787 | |
- else
|
1788 | |
- goto exit; /* we'll be called again when ibus is up and running */
|
1789 | |
-
|
1790 | |
- if (engine_desc) {
|
1791 | |
- const gchar *ibus_layout;
|
1792 | |
- ibus_layout = ibus_engine_desc_get_layout (engine_desc);
|
1793 | |
-
|
1794 | |
- if (ibus_layout) {
|
1795 | |
- layout = layout_from_ibus_layout (ibus_layout);
|
1796 | |
- variant = variant_from_ibus_layout (ibus_layout);
|
1797 | |
- options = options_from_ibus_layout (ibus_layout);
|
1798 | |
- }
|
1799 | |
- } else {
|
1800 | |
- g_warning ("Couldn't find IBus input source '%s'", id);
|
1801 | |
- goto exit;
|
1802 | |
- }
|
1803 | |
-
|
1804 | |
- set_gtk_im_module (manager, GTK_IM_MODULE_IBUS);
|
1805 | |
- set_ibus_engine (manager, id);
|
1806 | |
-#else
|
1807 | |
- g_warning ("IBus input source type specified but IBus support was not compiled");
|
1808 | |
-#endif
|
1809 | |
- } else {
|
1810 | |
- g_warning ("Unknown input source type '%s'", type);
|
1811 | |
- }
|
1812 | |
-
|
1813 | |
- exit:
|
1814 | |
- apply_xkb_settings (manager, layout, variant, options);
|
1815 | |
- g_variant_unref (sources);
|
1816 | |
- g_free (layout);
|
1817 | |
- g_free (variant);
|
1818 | |
- g_strfreev (options);
|
1819 | |
- /* Prevent individual "changed" signal invocations since we
|
1820 | |
- don't need them. */
|
1821 | |
- return TRUE;
|
1822 | |
-}
|
1823 | |
-
|
1824 | |
-static void
|
1825 | |
-apply_bell (GsdKeyboardManager *manager)
|
1826 | |
-{
|
1827 | |
- GSettings *settings;
|
1828 | |
XKeyboardControl kbdcontrol;
|
1829 | |
+ gboolean repeat;
|
1830 | |
gboolean click;
|
1831 | |
+ guint interval;
|
1832 | |
+ guint delay;
|
1833 | |
+ int click_volume;
|
1834 | |
int bell_volume;
|
1835 | |
int bell_pitch;
|
1836 | |
int bell_duration;
|
1837 | |
GsdBellMode bell_mode;
|
1838 | |
- int click_volume;
|
1839 | |
+ gboolean rnumlock;
|
1840 | |
|
1841 | |
- g_debug ("Applying the bell settings");
|
1842 | |
- settings = manager->priv->settings;
|
1843 | |
+ if (g_strcmp0 (key, KEY_NUMLOCK_STATE) == 0)
|
1844 | |
+ return;
|
1845 | |
+
|
1846 | |
+ repeat = g_settings_get_boolean (settings, KEY_REPEAT);
|
1847 | |
click = g_settings_get_boolean (settings, KEY_CLICK);
|
1848 | |
+ interval = _gsd_settings_get_uint (settings, KEY_INTERVAL);
|
1849 | |
+ delay = _gsd_settings_get_uint (settings, KEY_DELAY);
|
1850 | |
click_volume = g_settings_get_int (settings, KEY_CLICK_VOLUME);
|
1851 | |
-
|
1852 | |
bell_pitch = g_settings_get_int (settings, KEY_BELL_PITCH);
|
1853 | |
bell_duration = g_settings_get_int (settings, KEY_BELL_DURATION);
|
1854 | |
|
1855 | |
bell_mode = g_settings_get_enum (settings, KEY_BELL_MODE);
|
1856 | |
bell_volume = (bell_mode == GSD_BELL_MODE_ON) ? 50 : 0;
|
1857 | |
|
1858 | |
- /* as percentage from 0..100 inclusive */
|
1859 | |
- if (click_volume < 0) {
|
1860 | |
- click_volume = 0;
|
1861 | |
- } else if (click_volume > 100) {
|
1862 | |
- click_volume = 100;
|
1863 | |
- }
|
1864 | |
- kbdcontrol.key_click_percent = click ? click_volume : 0;
|
1865 | |
- kbdcontrol.bell_percent = bell_volume;
|
1866 | |
- kbdcontrol.bell_pitch = bell_pitch;
|
1867 | |
- kbdcontrol.bell_duration = bell_duration;
|
1868 | |
-
|
1869 | |
- gdk_error_trap_push ();
|
1870 | |
- XChangeKeyboardControl (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
1871 | |
- KBKeyClickPercent | KBBellPercent | KBBellPitch | KBBellDuration,
|
1872 | |
- &kbdcontrol);
|
1873 | |
-
|
1874 | |
- XSync (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), FALSE);
|
1875 | |
- gdk_error_trap_pop_ignored ();
|
1876 | |
-}
|
1877 | |
-
|
1878 | |
-static void
|
1879 | |
-apply_numlock (GsdKeyboardManager *manager)
|
1880 | |
-{
|
1881 | |
- GSettings *settings;
|
1882 | |
- gboolean rnumlock;
|
1883 | |
-
|
1884 | |
- g_debug ("Applying the num-lock settings");
|
1885 | |
- settings = manager->priv->settings;
|
1886 | |
- rnumlock = g_settings_get_boolean (settings, KEY_REMEMBER_NUMLOCK_STATE);
|
1887 | |
- manager->priv->old_state = g_settings_get_enum (manager->priv->settings, KEY_NUMLOCK_STATE);
|
1888 | |
-
|
1889 | |
- gdk_error_trap_push ();
|
1890 | |
- if (rnumlock) {
|
1891 | |
- g_debug ("Remember num-lock is set, so applying setting '%s'",
|
1892 | |
- num_lock_state_to_string (manager->priv->old_state));
|
1893 | |
- numlock_set_xkb_state (manager->priv->old_state);
|
1894 | |
- }
|
1895 | |
-
|
1896 | |
- XSync (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), FALSE);
|
1897 | |
- gdk_error_trap_pop_ignored ();
|
1898 | |
-}
|
1899 | |
-
|
1900 | |
-static void
|
1901 | |
-apply_repeat (GsdKeyboardManager *manager)
|
1902 | |
-{
|
1903 | |
- GSettings *settings;
|
1904 | |
- gboolean repeat;
|
1905 | |
- guint interval;
|
1906 | |
- guint delay;
|
1907 | |
-
|
1908 | |
- g_debug ("Applying the repeat settings");
|
1909 | |
- settings = manager->priv->settings;
|
1910 | |
- repeat = g_settings_get_boolean (settings, KEY_REPEAT);
|
1911 | |
- interval = g_settings_get_uint (settings, KEY_INTERVAL);
|
1912 | |
- delay = g_settings_get_uint (settings, KEY_DELAY);
|
1913 | |
-
|
1914 | |
gdk_error_trap_push ();
|
1915 | |
if (repeat) {
|
1916 | |
gboolean rate_set = FALSE;
|
1917 | |
@@ -1249,319 +243,124 @@
|
1918 | |
XAutoRepeatOff (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
|
1919 | |
}
|
1920 | |
|
1921 | |
- XSync (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), FALSE);
|
1922 | |
- gdk_error_trap_pop_ignored ();
|
1923 | |
-}
|
1924 | |
-
|
1925 | |
-static void
|
1926 | |
-apply_all_settings (GsdKeyboardManager *manager)
|
1927 | |
-{
|
1928 | |
- apply_repeat (manager);
|
1929 | |
- apply_bell (manager);
|
1930 | |
- apply_numlock (manager);
|
1931 | |
-}
|
1932 | |
-
|
1933 | |
-static void
|
1934 | |
-set_input_sources_switcher (GsdKeyboardManager *manager,
|
1935 | |
- gboolean state)
|
1936 | |
-{
|
1937 | |
- if (state) {
|
1938 | |
- GError *error = NULL;
|
1939 | |
- char *args[2];
|
1940 | |
-
|
1941 | |
- if (manager->priv->input_sources_switcher_spawned)
|
1942 | |
- set_input_sources_switcher (manager, FALSE);
|
1943 | |
-
|
1944 | |
- args[0] = LIBEXECDIR "/gsd-input-sources-switcher";
|
1945 | |
- args[1] = NULL;
|
1946 | |
-
|
1947 | |
- g_spawn_async (NULL, args, NULL,
|
1948 | |
- 0, NULL, NULL,
|
1949 | |
- &manager->priv->input_sources_switcher_pid, &error);
|
1950 | |
-
|
1951 | |
- manager->priv->input_sources_switcher_spawned = (error == NULL);
|
1952 | |
-
|
1953 | |
- if (error) {
|
1954 | |
- g_warning ("Couldn't spawn %s: %s", args[0], error->message);
|
1955 | |
- g_error_free (error);
|
1956 | |
- }
|
1957 | |
- } else if (manager->priv->input_sources_switcher_spawned) {
|
1958 | |
- kill (manager->priv->input_sources_switcher_pid, SIGHUP);
|
1959 | |
- g_spawn_close_pid (manager->priv->input_sources_switcher_pid);
|
1960 | |
- manager->priv->input_sources_switcher_spawned = FALSE;
|
1961 | |
+ /* as percentage from 0..100 inclusive */
|
1962 | |
+ if (click_volume < 0) {
|
1963 | |
+ click_volume = 0;
|
1964 | |
+ } else if (click_volume > 100) {
|
1965 | |
+ click_volume = 100;
|
1966 | |
}
|
1967 | |
-}
|
1968 | |
-
|
1969 | |
-static gboolean
|
1970 | |
-enable_switcher (GsdKeyboardManager *manager)
|
1971 | |
-{
|
1972 | |
- GsdInputSourcesSwitcher switcher;
|
1973 | |
+ kbdcontrol.key_click_percent = click ? click_volume : 0;
|
1974 | |
+ kbdcontrol.bell_percent = bell_volume;
|
1975 | |
+ kbdcontrol.bell_pitch = bell_pitch;
|
1976 | |
+ kbdcontrol.bell_duration = bell_duration;
|
1977 | |
+ XChangeKeyboardControl (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
1978 | |
+ KBKeyClickPercent | KBBellPercent | KBBellPitch | KBBellDuration,
|
1979 | |
+ &kbdcontrol);
|
1980 | |
|
1981 | |
- switcher = g_settings_get_enum (manager->priv->settings, KEY_SWITCHER);
|
1982 | |
+ if (g_strcmp0 (key, "remember-numlock-state") == 0 || key == NULL) {
|
1983 | |
+ rnumlock = g_settings_get_boolean (settings, "remember-numlock-state");
|
1984 | |
|
1985 | |
- return switcher != GSD_INPUT_SOURCES_SWITCHER_OFF;
|
1986 | |
-}
|
1987 | |
+ manager->priv->old_state = g_settings_get_enum (manager->priv->settings, KEY_NUMLOCK_STATE);
|
1988 | |
|
1989 | |
-static void
|
1990 | |
-settings_changed (GSettings *settings,
|
1991 | |
- const char *key,
|
1992 | |
- GsdKeyboardManager *manager)
|
1993 | |
-{
|
1994 | |
- if (g_strcmp0 (key, KEY_CLICK) == 0||
|
1995 | |
- g_strcmp0 (key, KEY_CLICK_VOLUME) == 0 ||
|
1996 | |
- g_strcmp0 (key, KEY_BELL_PITCH) == 0 ||
|
1997 | |
- g_strcmp0 (key, KEY_BELL_DURATION) == 0 ||
|
1998 | |
- g_strcmp0 (key, KEY_BELL_MODE) == 0) {
|
1999 | |
- g_debug ("Bell setting '%s' changed, applying bell settings", key);
|
2000 | |
- apply_bell (manager);
|
2001 | |
- } else if (g_strcmp0 (key, KEY_REMEMBER_NUMLOCK_STATE) == 0) {
|
2002 | |
- g_debug ("Remember Num-Lock state '%s' changed, applying num-lock settings", key);
|
2003 | |
- apply_numlock (manager);
|
2004 | |
- } else if (g_strcmp0 (key, KEY_NUMLOCK_STATE) == 0) {
|
2005 | |
- g_debug ("Num-Lock state '%s' changed, will apply at next startup", key);
|
2006 | |
- } else if (g_strcmp0 (key, KEY_REPEAT) == 0 ||
|
2007 | |
- g_strcmp0 (key, KEY_INTERVAL) == 0 ||
|
2008 | |
- g_strcmp0 (key, KEY_DELAY) == 0) {
|
2009 | |
- g_debug ("Key repeat setting '%s' changed, applying key repeat settings", key);
|
2010 | |
- apply_repeat (manager);
|
2011 | |
- } else if (g_strcmp0 (key, KEY_SWITCHER) == 0) {
|
2012 | |
- set_input_sources_switcher (manager, enable_switcher (manager));
|
2013 | |
- } else {
|
2014 | |
- g_warning ("Unhandled settings change, key '%s'", key);
|
2015 | |
+ if (manager->priv->have_xkb && rnumlock)
|
2016 | |
+ numlock_set_xkb_state (manager->priv->old_state);
|
2017 | |
}
|
2018 | |
|
2019 | |
+ XSync (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), FALSE);
|
2020 | |
+ gdk_error_trap_pop_ignored ();
|
2021 | |
}
|
2022 | |
|
2023 | |
-static void
|
2024 | |
-device_added_cb (GdkDeviceManager *device_manager,
|
2025 | |
- GdkDevice *device,
|
2026 | |
- GsdKeyboardManager *manager)
|
2027 | |
-{
|
2028 | |
- GdkInputSource source;
|
2029 | |
-
|
2030 | |
- source = gdk_device_get_source (device);
|
2031 | |
- if (source == GDK_SOURCE_KEYBOARD) {
|
2032 | |
- g_debug ("New keyboard plugged in, applying all settings");
|
2033 | |
- apply_all_settings (manager);
|
2034 | |
- apply_input_sources_settings (manager->priv->input_sources_settings, NULL, 0, manager);
|
2035 | |
- run_custom_command (device, COMMAND_DEVICE_ADDED);
|
2036 | |
- }
|
2037 | |
-}
|
2038 | |
-
|
2039 | |
-static void
|
2040 | |
-device_removed_cb (GdkDeviceManager *device_manager,
|
2041 | |
- GdkDevice *device,
|
2042 | |
- GsdKeyboardManager *manager)
|
2043 | |
-{
|
2044 | |
- GdkInputSource source;
|
2045 | |
-
|
2046 | |
- source = gdk_device_get_source (device);
|
2047 | |
- if (source == GDK_SOURCE_KEYBOARD) {
|
2048 | |
- run_custom_command (device, COMMAND_DEVICE_REMOVED);
|
2049 | |
- }
|
2050 | |
-}
|
2051 | |
-
|
2052 | |
-static void
|
2053 | |
-set_devicepresence_handler (GsdKeyboardManager *manager)
|
2054 | |
-{
|
2055 | |
- GdkDeviceManager *device_manager;
|
2056 | |
-
|
2057 | |
- device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
|
2058 | |
-
|
2059 | |
- manager->priv->device_added_id = g_signal_connect (G_OBJECT (device_manager), "device-added",
|
2060 | |
- G_CALLBACK (device_added_cb), manager);
|
2061 | |
- manager->priv->device_removed_id = g_signal_connect (G_OBJECT (device_manager), "device-removed",
|
2062 | |
- G_CALLBACK (device_removed_cb), manager);
|
2063 | |
- manager->priv->device_manager = device_manager;
|
2064 | |
-}
|
2065 | |
-
|
2066 | |
-static void
|
2067 | |
-create_sources_from_current_xkb_config (GSettings *settings)
|
2068 | |
-{
|
2069 | |
- GVariantBuilder builder;
|
2070 | |
- XkbRF_VarDefsRec *xkb_var_defs;
|
2071 | |
- gchar *tmp;
|
2072 | |
- gchar **layouts = NULL;
|
2073 | |
- gchar **variants = NULL;
|
2074 | |
- guint i, n;
|
2075 | |
-
|
2076 | |
- gnome_xkb_info_get_var_defs (&tmp, &xkb_var_defs);
|
2077 | |
- g_free (tmp);
|
2078 | |
-
|
2079 | |
- if (xkb_var_defs->layout)
|
2080 | |
- layouts = g_strsplit (xkb_var_defs->layout, ",", 0);
|
2081 | |
- if (xkb_var_defs->variant)
|
2082 | |
- variants = g_strsplit (xkb_var_defs->variant, ",", 0);
|
2083 | |
-
|
2084 | |
- gnome_xkb_info_free_var_defs (xkb_var_defs);
|
2085 | |
-
|
2086 | |
- if (!layouts)
|
2087 | |
- goto out;
|
2088 | |
-
|
2089 | |
- if (variants && variants[0])
|
2090 | |
- n = MIN (g_strv_length (layouts), g_strv_length (variants));
|
2091 | |
- else
|
2092 | |
- n = g_strv_length (layouts);
|
2093 | |
-
|
2094 | |
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ss)"));
|
2095 | |
- for (i = 0; i < n && layouts[i][0]; ++i) {
|
2096 | |
- if (variants && variants[i] && variants[i][0])
|
2097 | |
- tmp = g_strdup_printf ("%s+%s", layouts[i], variants[i]);
|
2098 | |
- else
|
2099 | |
- tmp = g_strdup (layouts[i]);
|
2100 | |
-
|
2101 | |
- g_variant_builder_add (&builder, "(ss)", INPUT_SOURCE_TYPE_XKB, tmp);
|
2102 | |
- g_free (tmp);
|
2103 | |
- }
|
2104 | |
- g_settings_set_value (settings, KEY_INPUT_SOURCES, g_variant_builder_end (&builder));
|
2105 | |
-out:
|
2106 | |
- g_strfreev (layouts);
|
2107 | |
- g_strfreev (variants);
|
2108 | |
-}
|
2109 | |
-
|
2110 | |
-static void
|
2111 | |
-convert_libgnomekbd_options (GSettings *settings)
|
2112 | |
+void
|
2113 | |
+gsd_keyboard_manager_apply_settings (GsdKeyboardManager *manager)
|
2114 | |
{
|
2115 | |
- GPtrArray *opt_array;
|
2116 | |
- GSettings *libgnomekbd_settings;
|
2117 | |
- gchar **options, **o;
|
2118 | |
-
|
2119 | |
- if (!schema_is_installed ("org.gnome.libgnomekbd.keyboard"))
|
2120 | |
- return;
|
2121 | |
-
|
2122 | |
- opt_array = g_ptr_array_new_with_free_func (g_free);
|
2123 | |
-
|
2124 | |
- libgnomekbd_settings = g_settings_new ("org.gnome.libgnomekbd.keyboard");
|
2125 | |
- options = g_settings_get_strv (libgnomekbd_settings, "options");
|
2126 | |
-
|
2127 | |
- for (o = options; *o; ++o) {
|
2128 | |
- gchar **strv;
|
2129 | |
-
|
2130 | |
- strv = g_strsplit (*o, "\t", 2);
|
2131 | |
- if (strv[0] && strv[1]) {
|
2132 | |
- /* We don't want the group switcher because
|
2133 | |
- * it's incompatible with the way we use XKB
|
2134 | |
- * groups. */
|
2135 | |
- if (!g_str_has_prefix (strv[1], "grp:"))
|
2136 | |
- g_ptr_array_add (opt_array, g_strdup (strv[1]));
|
2137 | |
- }
|
2138 | |
- g_strfreev (strv);
|
2139 | |
- }
|
2140 | |
- g_ptr_array_add (opt_array, NULL);
|
2141 | |
-
|
2142 | |
- g_settings_set_strv (settings, KEY_KEYBOARD_OPTIONS, (const gchar * const*) opt_array->pdata);
|
2143 | |
-
|
2144 | |
- g_strfreev (options);
|
2145 | |
- g_object_unref (libgnomekbd_settings);
|
2146 | |
- g_ptr_array_free (opt_array, TRUE);
|
2147 | |
+ apply_settings (manager->priv->settings, NULL, manager);
|
2148 | |
}
|
2149 | |
|
2150 | |
static void
|
2151 | |
-convert_libgnomekbd_layouts (GSettings *settings)
|
2152 | |
+apply_libgnomekbd_settings (GSettings *settings,
|
2153 | |
+ const char *key,
|
2154 | |
+ GsdKeyboardManager *manager)
|
2155 | |
{
|
2156 | |
- GVariantBuilder builder;
|
2157 | |
- GSettings *libgnomekbd_settings;
|
2158 | |
- gchar **layouts, **l;
|
2159 | |
-
|
2160 | |
- if (!schema_is_installed ("org.gnome.libgnomekbd.keyboard"))
|
2161 | |
- return;
|
2162 | |
+ gchar **layouts;
|
2163 | |
|
2164 | |
- init_builder_with_sources (&builder, settings);
|
2165 | |
+ layouts = g_settings_get_strv (settings, LIBGNOMEKBD_KEY_LAYOUTS);
|
2166 | |
|
2167 | |
- libgnomekbd_settings = g_settings_new ("org.gnome.libgnomekbd.keyboard");
|
2168 | |
- layouts = g_settings_get_strv (libgnomekbd_settings, "layouts");
|
2169 | |
-
|
2170 | |
- for (l = layouts; *l; ++l) {
|
2171 | |
- gchar *id;
|
2172 | |
- gchar **strv;
|
2173 | |
-
|
2174 | |
- strv = g_strsplit (*l, "\t", 2);
|
2175 | |
- if (strv[0] && !strv[1])
|
2176 | |
- id = g_strdup (strv[0]);
|
2177 | |
- else if (strv[0] && strv[1])
|
2178 | |
- id = g_strdup_printf ("%s+%s", strv[0], strv[1]);
|
2179 | |
- else
|
2180 | |
- id = NULL;
|
2181 | |
-
|
2182 | |
- if (id)
|
2183 | |
- g_variant_builder_add (&builder, "(ss)", INPUT_SOURCE_TYPE_XKB, id);
|
2184 | |
-
|
2185 | |
- g_free (id);
|
2186 | |
- g_strfreev (strv);
|
2187 | |
- }
|
2188 | |
-
|
2189 | |
- g_settings_set_value (settings, KEY_INPUT_SOURCES, g_variant_builder_end (&builder));
|
2190 | |
-
|
2191 | |
- g_strfreev (layouts);
|
2192 | |
- g_object_unref (libgnomekbd_settings);
|
2193 | |
-}
|
2194 | |
-
|
2195 | |
-static void
|
2196 | |
-maybe_convert_old_settings (GSettings *settings)
|
2197 | |
-{
|
2198 | |
- GVariant *sources;
|
2199 | |
- gchar **options;
|
2200 | |
- gchar *stamp_dir_path = NULL;
|
2201 | |
- gchar *stamp_file_path = NULL;
|
2202 | |
+ /* Get accounts daemon */
|
2203 | |
+ GDBusProxy *proxy = NULL;
|
2204 | |
+ GDBusProxy *user = NULL;
|
2205 | |
+ GVariant *variant = NULL;
|
2206 | |
GError *error = NULL;
|
2207 | |
+ gchar *object_path = NULL;
|
2208 | |
|
2209 | |
- stamp_dir_path = g_build_filename (g_get_user_data_dir (), PACKAGE_NAME, NULL);
|
2210 | |
- if (g_mkdir_with_parents (stamp_dir_path, 0755)) {
|
2211 | |
- g_warning ("Failed to create directory %s: %s", stamp_dir_path, g_strerror (errno));
|
2212 | |
- goto out;
|
2213 | |
- }
|
2214 | |
+ proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
|
2215 | |
+ G_DBUS_PROXY_FLAGS_NONE,
|
2216 | |
+ NULL,
|
2217 | |
+ "org.freedesktop.Accounts",
|
2218 | |
+ "/org/freedesktop/Accounts",
|
2219 | |
+ "org.freedesktop.Accounts",
|
2220 | |
+ NULL,
|
2221 | |
+ &error);
|
2222 | |
|
2223 | |
- stamp_file_path = g_build_filename (stamp_dir_path, "input-sources-converted", NULL);
|
2224 | |
- if (g_file_test (stamp_file_path, G_FILE_TEST_EXISTS))
|
2225 | |
- goto out;
|
2226 | |
-
|
2227 | |
- sources = g_settings_get_value (settings, KEY_INPUT_SOURCES);
|
2228 | |
- if (g_variant_n_children (sources) < 1) {
|
2229 | |
- convert_libgnomekbd_layouts (settings);
|
2230 | |
-#ifdef HAVE_IBUS
|
2231 | |
- convert_ibus (settings);
|
2232 | |
-#endif
|
2233 | |
+ if (proxy == NULL) {
|
2234 | |
+ g_warning ("Failed to contact accounts service: %s", error->message);
|
2235 | |
+ g_error_free (error);
|
2236 | |
+ goto bail;
|
2237 | |
}
|
2238 | |
- g_variant_unref (sources);
|
2239 | |
|
2240 | |
- options = g_settings_get_strv (settings, KEY_KEYBOARD_OPTIONS);
|
2241 | |
- if (g_strv_length (options) < 1)
|
2242 | |
- convert_libgnomekbd_options (settings);
|
2243 | |
- g_strfreev (options);
|
2244 | |
+ variant = g_dbus_proxy_call_sync (proxy,
|
2245 | |
+ "FindUserByName",
|
2246 | |
+ g_variant_new ("(s)", g_get_user_name ()),
|
2247 | |
+ G_DBUS_CALL_FLAGS_NONE,
|
2248 | |
+ -1,
|
2249 | |
+ NULL,
|
2250 | |
+ &error);
|
2251 | |
|
2252 | |
- if (!g_file_set_contents (stamp_file_path, "", 0, &error)) {
|
2253 | |
- g_warning ("%s", error->message);
|
2254 | |
+ if (variant == NULL) {
|
2255 | |
+ g_warning ("Could not contact accounts service to look up '%s': %s",
|
2256 | |
+ g_get_user_name (), error->message);
|
2257 | |
g_error_free (error);
|
2258 | |
+ goto bail;
|
2259 | |
}
|
2260 | |
-out:
|
2261 | |
- g_free (stamp_file_path);
|
2262 | |
- g_free (stamp_dir_path);
|
2263 | |
-}
|
2264 | |
|
2265 | |
-static void
|
2266 | |
-maybe_create_input_sources (GsdKeyboardManager *manager)
|
2267 | |
-{
|
2268 | |
- GSettings *settings;
|
2269 | |
- GVariant *sources;
|
2270 | |
-
|
2271 | |
- settings = manager->priv->input_sources_settings;
|
2272 | |
+ g_variant_get (variant, "(o)", &object_path);
|
2273 | |
+ user = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
|
2274 | |
+ G_DBUS_PROXY_FLAGS_NONE,
|
2275 | |
+ NULL,
|
2276 | |
+ "org.freedesktop.Accounts",
|
2277 | |
+ object_path,
|
2278 | |
+ "org.freedesktop.Accounts.User",
|
2279 | |
+ NULL,
|
2280 | |
+ &error);
|
2281 | |
+ g_free (object_path);
|
2282 | |
|
2283 | |
- if (g_getenv ("RUNNING_UNDER_GDM")) {
|
2284 | |
- create_sources_from_current_xkb_config (settings);
|
2285 | |
- return;
|
2286 | |
+ if (user == NULL) {
|
2287 | |
+ g_warning ("Could not create proxy for user '%s': %s",
|
2288 | |
+ g_variant_get_string (variant, NULL), error->message);
|
2289 | |
+ g_error_free (error);
|
2290 | |
+ goto bail;
|
2291 | |
}
|
2292 | |
+ g_variant_unref (variant);
|
2293 | |
|
2294 | |
- maybe_convert_old_settings (settings);
|
2295 | |
+ variant = g_dbus_proxy_call_sync (user,
|
2296 | |
+ "SetXKeyboardLayouts",
|
2297 | |
+ g_variant_new ("(^as)", layouts),
|
2298 | |
+ G_DBUS_CALL_FLAGS_NONE,
|
2299 | |
+ -1,
|
2300 | |
+ NULL,
|
2301 | |
+ &error);
|
2302 | |
|
2303 | |
- /* if we still don't have anything do some educated guesses */
|
2304 | |
- sources = g_settings_get_value (settings, KEY_INPUT_SOURCES);
|
2305 | |
- if (g_variant_n_children (sources) < 1) {
|
2306 | |
- create_sources_from_current_xkb_config (settings);
|
2307 | |
-#ifdef HAVE_IBUS
|
2308 | |
- add_ibus_sources_from_locale (settings);
|
2309 | |
-#endif
|
2310 | |
+ if (variant == NULL) {
|
2311 | |
+ g_warning ("Failed to set the keyboard layouts: %s", error->message);
|
2312 | |
+ g_error_free (error);
|
2313 | |
+ goto bail;
|
2314 | |
}
|
2315 | |
- g_variant_unref (sources);
|
2316 | |
+
|
2317 | |
+bail:
|
2318 | |
+ if (proxy != NULL)
|
2319 | |
+ g_object_unref (proxy);
|
2320 | |
+ if (variant != NULL)
|
2321 | |
+ g_variant_unref (variant);
|
2322 | |
+ g_strfreev (layouts);
|
2323 | |
}
|
2324 | |
|
2325 | |
static gboolean
|
2326 | |
@@ -1571,41 +370,26 @@
|
2327 | |
|
2328 | |
g_debug ("Starting keyboard manager");
|
2329 | |
|
2330 | |
+ manager->priv->have_xkb = 0;
|
2331 | |
manager->priv->settings = g_settings_new (GSD_KEYBOARD_DIR);
|
2332 | |
+ manager->priv->libgnomekbd_settings = g_settings_new (LIBGNOMEKBD_KEYBOARD_DIR);
|
2333 | |
|
2334 | |
- xkb_init (manager);
|
2335 | |
+ /* Essential - xkb initialization should happen before */
|
2336 | |
+ gsd_keyboard_xkb_init (manager);
|
2337 | |
|
2338 | |
- set_devicepresence_handler (manager);
|
2339 | |
+ numlock_xkb_init (manager);
|
2340 | |
|
2341 | |
- manager->priv->input_sources_settings = g_settings_new (GNOME_DESKTOP_INPUT_SOURCES_DIR);
|
2342 | |
- manager->priv->interface_settings = g_settings_new (GNOME_DESKTOP_INTERFACE_DIR);
|
2343 | |
- manager->priv->xkb_info = gnome_xkb_info_new ();
|
2344 | |
-
|
2345 | |
- maybe_create_input_sources (manager);
|
2346 | |
-
|
2347 | |
-#ifdef HAVE_IBUS
|
2348 | |
- /* We don't want to touch IBus until we are sure this isn't a
|
2349 | |
- fallback session. */
|
2350 | |
- manager->priv->session_is_fallback = TRUE;
|
2351 | |
- manager->priv->ibus_cancellable = g_cancellable_new ();
|
2352 | |
- g_bus_get (G_BUS_TYPE_SESSION,
|
2353 | |
- manager->priv->ibus_cancellable,
|
2354 | |
- (GAsyncReadyCallback)got_bus,
|
2355 | |
- manager);
|
2356 | |
-#else
|
2357 | |
- apply_input_sources_settings (manager->priv->input_sources_settings, NULL, 0, manager);
|
2358 | |
-#endif
|
2359 | |
/* apply current settings before we install the callback */
|
2360 | |
- g_debug ("Started the keyboard plugin, applying all settings");
|
2361 | |
- apply_all_settings (manager);
|
2362 | |
+ gsd_keyboard_manager_apply_settings (manager);
|
2363 | |
|
2364 | |
g_signal_connect (G_OBJECT (manager->priv->settings), "changed",
|
2365 | |
- G_CALLBACK (settings_changed), manager);
|
2366 | |
- g_signal_connect (G_OBJECT (manager->priv->input_sources_settings), "change-event",
|
2367 | |
- G_CALLBACK (apply_input_sources_settings), manager);
|
2368 | |
+ G_CALLBACK (apply_settings), manager);
|
2369 | |
+
|
2370 | |
+ apply_libgnomekbd_settings (manager->priv->libgnomekbd_settings, NULL, manager);
|
2371 | |
+ g_signal_connect (G_OBJECT (manager->priv->libgnomekbd_settings), "changed",
|
2372 | |
+ G_CALLBACK (apply_libgnomekbd_settings), manager);
|
2373 | |
|
2374 | |
- install_xkb_filter (manager);
|
2375 | |
- set_input_sources_switcher (manager, enable_switcher (manager));
|
2376 | |
+ numlock_install_xkb_callback (manager);
|
2377 | |
|
2378 | |
gnome_settings_profile_end (NULL);
|
2379 | |
|
2380 | |
@@ -1620,11 +404,6 @@
|
2381 | |
{
|
2382 | |
gnome_settings_profile_start (NULL);
|
2383 | |
|
2384 | |
- if (check_xkb_extension (manager) == FALSE) {
|
2385 | |
- g_debug ("XKB is not supported, not applying any settings");
|
2386 | |
- return TRUE;
|
2387 | |
- }
|
2388 | |
-
|
2389 | |
manager->priv->start_idle_id = g_idle_add ((GSourceFunc) start_keyboard_idle_cb, manager);
|
2390 | |
|
2391 | |
gnome_settings_profile_end (NULL);
|
2392 | |
@@ -1639,24 +418,37 @@
|
2393 | |
|
2394 | |
g_debug ("Stopping keyboard manager");
|
2395 | |
|
2396 | |
- g_clear_object (&p->settings);
|
2397 | |
- g_clear_object (&p->input_sources_settings);
|
2398 | |
- g_clear_object (&p->interface_settings);
|
2399 | |
- g_clear_object (&p->xkb_info);
|
2400 | |
+ if (p->settings != NULL) {
|
2401 | |
+ g_object_unref (p->settings);
|
2402 | |
+ p->settings = NULL;
|
2403 | |
+ }
|
2404 | |
|
2405 | |
-#ifdef HAVE_IBUS
|
2406 | |
- clear_ibus (manager);
|
2407 | |
-#endif
|
2408 | |
+ if (p->libgnomekbd_settings != NULL) {
|
2409 | |
+ g_object_unref (p->libgnomekbd_settings);
|
2410 | |
+ p->libgnomekbd_settings = NULL;
|
2411 | |
+ }
|
2412 | |
|
2413 | |
- if (p->device_manager != NULL) {
|
2414 | |
- g_signal_handler_disconnect (p->device_manager, p->device_added_id);
|
2415 | |
- g_signal_handler_disconnect (p->device_manager, p->device_removed_id);
|
2416 | |
- p->device_manager = NULL;
|
2417 | |
+ if (p->have_xkb) {
|
2418 | |
+ gdk_window_remove_filter (NULL,
|
2419 | |
+ numlock_xkb_callback,
|
2420 | |
+ manager);
|
2421 | |
}
|
2422 | |
|
2423 | |
- remove_xkb_filter (manager);
|
2424 | |
+ gsd_keyboard_xkb_shutdown ();
|
2425 | |
+}
|
2426 | |
+
|
2427 | |
+static GObject *
|
2428 | |
+gsd_keyboard_manager_constructor (GType type,
|
2429 | |
+ guint n_construct_properties,
|
2430 | |
+ GObjectConstructParam *construct_properties)
|
2431 | |
+{
|
2432 | |
+ GsdKeyboardManager *keyboard_manager;
|
2433 | |
+
|
2434 | |
+ keyboard_manager = GSD_KEYBOARD_MANAGER (G_OBJECT_CLASS (gsd_keyboard_manager_parent_class)->constructor (type,
|
2435 | |
+ n_construct_properties,
|
2436 | |
+ construct_properties));
|
2437 | |
|
2438 | |
- set_input_sources_switcher (manager, FALSE);
|
2439 | |
+ return G_OBJECT (keyboard_manager);
|
2440 | |
}
|
2441 | |
|
2442 | |
static void
|
2443 | |
@@ -1664,6 +456,7 @@
|
2444 | |
{
|
2445 | |
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
2446 | |
|
2447 | |
+ object_class->constructor = gsd_keyboard_manager_constructor;
|
2448 | |
object_class->finalize = gsd_keyboard_manager_finalize;
|
2449 | |
|
2450 | |
g_type_class_add_private (klass, sizeof (GsdKeyboardManagerPrivate));
|
2451 | |
Index: gnome-settings-daemon-3.6.4/plugins/keyboard/gsd-keyboard-manager.h
|
2452 | |
===================================================================
|
2453 | |
--- gnome-settings-daemon-3.6.4.orig/plugins/keyboard/gsd-keyboard-manager.h 2013-04-17 17:52:29.768040154 +0200
|
2454 | |
+++ gnome-settings-daemon-3.6.4/plugins/keyboard/gsd-keyboard-manager.h 2013-04-17 17:52:29.756040153 +0200
|
2455 | |
@@ -51,6 +51,7 @@
|
2456 | |
gboolean gsd_keyboard_manager_start (GsdKeyboardManager *manager,
|
2457 | |
GError **error);
|
2458 | |
void gsd_keyboard_manager_stop (GsdKeyboardManager *manager);
|
2459 | |
+void gsd_keyboard_manager_apply_settings (GsdKeyboardManager *manager);
|
2460 | |
|
2461 | |
G_END_DECLS
|
2462 | |
|
2463 | |
Index: gnome-settings-daemon-3.6.4/plugins/keyboard/gsd-keyboard-xkb.c
|
2464 | |
===================================================================
|
2465 | |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
2466 | |
+++ gnome-settings-daemon-3.6.4/plugins/keyboard/gsd-keyboard-xkb.c 2013-04-17 17:52:29.760040153 +0200
|
2467 | |
@@ -0,0 +1,851 @@
|
2468 | |
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
2469 | |
+ *
|
2470 | |
+ * Copyright (C) 2001 Udaltsoft
|
2471 | |
+ *
|
2472 | |
+ * Written by Sergey V. Oudaltsov <svu@users.sourceforge.net>
|
2473 | |
+ *
|
2474 | |
+ * This program is free software; you can redistribute it and/or modify
|
2475 | |
+ * it under the terms of the GNU General Public License as published by
|
2476 | |
+ * the Free Software Foundation; either version 2, or (at your option)
|
2477 | |
+ * any later version.
|
2478 | |
+ *
|
2479 | |
+ * This program is distributed in the hope that it will be useful,
|
2480 | |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2481 | |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2482 | |
+ * GNU General Public License for more details.
|
2483 | |
+ *
|
2484 | |
+ * You should have received a copy of the GNU General Public License
|
2485 | |
+ * along with this program; if not, write to the Free Software
|
2486 | |
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
2487 | |
+ * 02111-1307, USA.
|
2488 | |
+ */
|
2489 | |
+
|
2490 | |
+#include "config.h"
|
2491 | |
+
|
2492 | |
+#include <string.h>
|
2493 | |
+#include <time.h>
|
2494 | |
+
|
2495 | |
+#include <glib/gi18n.h>
|
2496 | |
+#include <gdk/gdk.h>
|
2497 | |
+#include <gdk/gdkx.h>
|
2498 | |
+#include <gtk/gtk.h>
|
2499 | |
+
|
2500 | |
+#ifndef HAVE_APPINDICATOR
|
2501 | |
+#include <libgnomekbd/gkbd-status.h>
|
2502 | |
+#endif
|
2503 | |
+#include <libgnomekbd/gkbd-keyboard-drawing.h>
|
2504 | |
+#include <libgnomekbd/gkbd-desktop-config.h>
|
2505 | |
+#include <libgnomekbd/gkbd-indicator-config.h>
|
2506 | |
+#include <libgnomekbd/gkbd-keyboard-config.h>
|
2507 | |
+#include <libgnomekbd/gkbd-util.h>
|
2508 | |
+
|
2509 | |
+#ifdef HAVE_APPINDICATOR
|
2510 | |
+#include <libappindicator/app-indicator.h>
|
2511 | |
+#include "gkbd-configuration.h"
|
2512 | |
+#endif
|
2513 | |
+
|
2514 | |
+#include "gsd-keyboard-xkb.h"
|
2515 | |
+#include "delayed-dialog.h"
|
2516 | |
+#include "gnome-settings-profile.h"
|
2517 | |
+
|
2518 | |
+#define SETTINGS_KEYBOARD_DIR "org.gnome.settings-daemon.plugins.keyboard"
|
2519 | |
+
|
2520 | |
+static GsdKeyboardManager *manager = NULL;
|
2521 | |
+
|
2522 | |
+static XklEngine *xkl_engine;
|
2523 | |
+static XklConfigRegistry *xkl_registry = NULL;
|
2524 | |
+
|
2525 | |
+static GkbdDesktopConfig current_config;
|
2526 | |
+static GkbdKeyboardConfig current_kbd_config;
|
2527 | |
+
|
2528 | |
+/* never terminated */
|
2529 | |
+static GkbdKeyboardConfig initial_sys_kbd_config;
|
2530 | |
+
|
2531 | |
+static gboolean inited_ok = FALSE;
|
2532 | |
+
|
2533 | |
+static GSettings *settings_desktop = NULL;
|
2534 | |
+static GSettings *settings_keyboard = NULL;
|
2535 | |
+
|
2536 | |
+static PostActivationCallback pa_callback = NULL;
|
2537 | |
+static void *pa_callback_user_data = NULL;
|
2538 | |
+
|
2539 | |
+#ifdef HAVE_APPINDICATOR
|
2540 | |
+static AppIndicator *app_indicator = NULL;
|
2541 | |
+static GkbdConfiguration *gkbd_configuration = NULL;
|
2542 | |
+static GkbdIndicatorConfig current_ind_config;
|
2543 | |
+static GSList *groups_items_group = NULL;
|
2544 | |
+static size_t lang_menu_items = 0;
|
2545 | |
+
|
2546 | |
+static void state_callback (XklEngine * engine,
|
2547 | |
+ XklEngineStateChange changeType,
|
2548 | |
+ gint group, gboolean restore);
|
2549 | |
+static void gsd_keyboard_configuration_changed (GkbdConfiguration *configuration);
|
2550 | |
+
|
2551 | |
+#else
|
2552 | |
+static GtkStatusIcon *icon = NULL;
|
2553 | |
+#endif
|
2554 | |
+
|
2555 | |
+static GHashTable *preview_dialogs = NULL;
|
2556 | |
+
|
2557 | |
+static void
|
2558 | |
+activation_error (void)
|
2559 | |
+{
|
2560 | |
+ char const *vendor;
|
2561 | |
+ GtkWidget *dialog;
|
2562 | |
+
|
2563 | |
+ vendor =
|
2564 | |
+ ServerVendor (GDK_DISPLAY_XDISPLAY
|
2565 | |
+ (gdk_display_get_default ()));
|
2566 | |
+
|
2567 | |
+ /* VNC viewers will not work, do not barrage them with warnings */
|
2568 | |
+ if (NULL != vendor && NULL != strstr (vendor, "VNC"))
|
2569 | |
+ return;
|
2570 | |
+
|
2571 | |
+ dialog = gtk_message_dialog_new_with_markup (NULL,
|
2572 | |
+ 0,
|
2573 | |
+ GTK_MESSAGE_ERROR,
|
2574 | |
+ GTK_BUTTONS_CLOSE,
|
2575 | |
+ _
|
2576 | |
+ ("Error activating XKB configuration.\n"
|
2577 | |
+ "There can be various reasons for that.\n\n"
|
2578 | |
+ "If you report this situation as a bug, include the results of\n"
|
2579 | |
+ " • <b>%s</b>\n"
|
2580 | |
+ " • <b>%s</b>\n"
|
2581 | |
+ " • <b>%s</b>\n"
|
2582 | |
+ " • <b>%s</b>"),
|
2583 | |
+ "xprop -root | grep XKB",
|
2584 | |
+ "gsettings get org.gnome.libgnomekbd.keyboard model",
|
2585 | |
+ "gsettings get org.gnome.libgnomekbd.keyboard layouts",
|
2586 | |
+ "gsettings get org.gnome.libgnomekbd.keyboard options");
|
2587 | |
+ g_signal_connect (dialog, "response",
|
2588 | |
+ G_CALLBACK (gtk_widget_destroy), NULL);
|
2589 | |
+ gsd_delayed_show_dialog (dialog);
|
2590 | |
+}
|
2591 | |
+
|
2592 | |
+static gboolean
|
2593 | |
+ensure_xkl_registry (void)
|
2594 | |
+{
|
2595 | |
+ if (!xkl_registry) {
|
2596 | |
+ xkl_registry =
|
2597 | |
+ xkl_config_registry_get_instance (xkl_engine);
|
2598 | |
+ /* load all materials, unconditionally! */
|
2599 | |
+ if (!xkl_config_registry_load (xkl_registry, TRUE)) {
|
2600 | |
+ g_object_unref (xkl_registry);
|
2601 | |
+ xkl_registry = NULL;
|
2602 | |
+ return FALSE;
|
2603 | |
+ }
|
2604 | |
+ }
|
2605 | |
+
|
2606 | |
+ return TRUE;
|
2607 | |
+}
|
2608 | |
+
|
2609 | |
+static void
|
2610 | |
+apply_desktop_settings (void)
|
2611 | |
+{
|
2612 | |
+ if (!inited_ok)
|
2613 | |
+ return;
|
2614 | |
+
|
2615 | |
+ gsd_keyboard_manager_apply_settings (manager);
|
2616 | |
+ gkbd_desktop_config_load (¤t_config);
|
2617 | |
+ /* again, probably it would be nice to compare things
|
2618 | |
+ before activating them */
|
2619 | |
+ gkbd_desktop_config_activate (¤t_config);
|
2620 | |
+}
|
2621 | |
+
|
2622 | |
+static void
|
2623 | |
+popup_menu_launch_capplet ()
|
2624 | |
+{
|
2625 | |
+ GAppInfo *info;
|
2626 | |
+ GdkAppLaunchContext *ctx;
|
2627 | |
+ GError *error = NULL;
|
2628 | |
+
|
2629 | |
+ info =
|
2630 | |
+ g_app_info_create_from_commandline
|
2631 | |
+ ("gnome-control-center region", NULL, 0, &error);
|
2632 | |
+
|
2633 | |
+ if (info != NULL) {
|
2634 | |
+ ctx =
|
2635 | |
+ gdk_display_get_app_launch_context
|
2636 | |
+ (gdk_display_get_default ());
|
2637 | |
+
|
2638 | |
+ if (g_app_info_launch (info, NULL,
|
2639 | |
+ G_APP_LAUNCH_CONTEXT (ctx), &error) == FALSE) {
|
2640 | |
+ g_warning
|
2641 | |
+ ("Could not execute keyboard properties capplet: [%s]\n",
|
2642 | |
+ error->message);
|
2643 | |
+ g_error_free (error);
|
2644 | |
+ }
|
2645 | |
+
|
2646 | |
+ g_object_unref (info);
|
2647 | |
+ g_object_unref (ctx);
|
2648 | |
+ }
|
2649 | |
+
|
2650 | |
+}
|
2651 | |
+
|
2652 | |
+static void
|
2653 | |
+show_layout_destroy (GtkWidget * dialog, gint group)
|
2654 | |
+{
|
2655 | |
+ g_hash_table_remove (preview_dialogs, GINT_TO_POINTER (group));
|
2656 | |
+}
|
2657 | |
+
|
2658 | |
+static void
|
2659 | |
+popup_menu_show_layout ()
|
2660 | |
+{
|
2661 | |
+ GtkWidget *dialog;
|
2662 | |
+ XklEngine *engine =
|
2663 | |
+ xkl_engine_get_instance (GDK_DISPLAY_XDISPLAY
|
2664 | |
+ (gdk_display_get_default ()));
|
2665 | |
+ XklState *xkl_state = xkl_engine_get_current_state (engine);
|
2666 | |
+#ifdef HAVE_APPINDICATOR
|
2667 | |
+ gchar **group_names = gkbd_configuration_get_group_names (gkbd_configuration);
|
2668 | |
+#else
|
2669 | |
+ gchar **group_names = gkbd_status_get_group_names ();
|
2670 | |
+#endif
|
2671 | |
+ gpointer p = g_hash_table_lookup (preview_dialogs,
|
2672 | |
+ GINT_TO_POINTER
|
2673 | |
+ (xkl_state->group));
|
2674 | |
+
|
2675 | |
+ if (xkl_state->group < 0
|
2676 | |
+ || xkl_state->group >= g_strv_length (group_names)) {
|
2677 | |
+ return;
|
2678 | |
+ }
|
2679 | |
+
|
2680 | |
+ if (p != NULL) {
|
2681 | |
+ /* existing window */
|
2682 | |
+ gtk_window_present (GTK_WINDOW (p));
|
2683 | |
+ return;
|
2684 | |
+ }
|
2685 | |
+
|
2686 | |
+ if (!ensure_xkl_registry ())
|
2687 | |
+ return;
|
2688 | |
+
|
2689 | |
+ dialog = gkbd_keyboard_drawing_dialog_new ();
|
2690 | |
+ gkbd_keyboard_drawing_dialog_set_group (dialog, xkl_registry, xkl_state->group);
|
2691 | |
+
|
2692 | |
+ g_signal_connect (dialog, "destroy",
|
2693 | |
+ G_CALLBACK (show_layout_destroy),
|
2694 | |
+ GINT_TO_POINTER (xkl_state->group));
|
2695 | |
+ g_hash_table_insert (preview_dialogs,
|
2696 | |
+ GINT_TO_POINTER (xkl_state->group), dialog);
|
2697 | |
+ gtk_widget_show_all (dialog);
|
2698 | |
+}
|
2699 | |
+
|
2700 | |
+static void
|
2701 | |
+popup_menu_set_group (gint group_number, gboolean only_menu)
|
2702 | |
+{
|
2703 | |
+#ifdef HAVE_APPINDICATOR
|
2704 | |
+ XklEngine *engine = gkbd_configuration_get_xkl_engine (gkbd_configuration);
|
2705 | |
+#else
|
2706 | |
+ XklEngine *engine = gkbd_status_get_xkl_engine ();
|
2707 | |
+#endif
|
2708 | |
+ XklState *st = xkl_engine_get_current_state(engine);
|
2709 | |
+ Window cur;
|
2710 | |
+ st->group = group_number;
|
2711 | |
+ xkl_engine_allow_one_switch_to_secondary_group (engine);
|
2712 | |
+ cur = xkl_engine_get_current_window (engine);
|
2713 | |
+ if (cur != (Window) NULL) {
|
2714 | |
+ xkl_debug (150, "Enforcing the state %d for window %lx\n",
|
2715 | |
+ st->group, cur);
|
2716 | |
+#ifdef HAVE_APPINDICATOR
|
2717 | |
+ // Setting the state may trigger state_callback to be called, which will then
|
2718 | |
+ // cause popup_menu_set_group to be called again.
|
2719 | |
+ g_signal_handlers_block_by_func (engine, G_CALLBACK (state_callback), NULL);
|
2720 | |
+#endif
|
2721 | |
+ xkl_engine_save_state (engine,
|
2722 | |
+ xkl_engine_get_current_window
|
2723 | |
+ (engine), st);
|
2724 | |
+#ifdef HAVE_APPINDICATOR
|
2725 | |
+ g_signal_handlers_unblock_by_func (engine, G_CALLBACK (state_callback), NULL);
|
2726 | |
+#endif
|
2727 | |
+/* XSetInputFocus( GDK_DISPLAY(), cur, RevertToNone, CurrentTime );*/
|
2728 | |
+ } else {
|
2729 | |
+ xkl_debug (150,
|
2730 | |
+ "??? Enforcing the state %d for unknown window\n",
|
2731 | |
+ st->group);
|
2732 | |
+ /* strange situation - bad things can happen */
|
2733 | |
+ }
|
2734 | |
+ if (!only_menu)
|
2735 | |
+ xkl_engine_lock_group (engine, st->group);
|
2736 | |
+#ifdef HAVE_APPINDICATOR
|
2737 | |
+ XklConfigRec * xklrec = xkl_config_rec_new();
|
2738 | |
+ xkl_config_rec_get_from_server (xklrec, engine);
|
2739 | |
+ XklConfigRegistry *registry = xkl_config_registry_get_instance(engine);
|
2740 | |
+
|
2741 | |
+ gkbd_keyboard_config_load_from_x_current (¤t_kbd_config, xklrec);
|
2742 | |
+ xkl_config_registry_load (registry, current_config.load_extra_items);
|
2743 | |
+
|
2744 | |
+ int g;
|
2745 | |
+
|
2746 | |
+ if (current_ind_config.show_flags) {
|
2747 | |
+ gchar *image_file = gkbd_indicator_config_get_images_file (¤t_ind_config,
|
2748 | |
+ ¤t_kbd_config,
|
2749 | |
+ st->group);
|
2750 | |
+
|
2751 | |
+
|
2752 | |
+ app_indicator_set_icon_full(app_indicator, image_file, _("Keyboard"));
|
2753 | |
+ app_indicator_set_label(app_indicator, NULL, NULL);
|
2754 | |
+ g_free(image_file);
|
2755 | |
+ } else {
|
2756 | |
+ gchar * guide = "XXX";
|
2757 | |
+ gchar ** shortnames;
|
2758 | |
+ gchar ** longnames;
|
2759 | |
+ gchar * layout_name = NULL;
|
2760 | |
+ gchar * lname = NULL;
|
2761 | |
+ GHashTable *ln2cnt_map = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL);
|
2762 | |
+
|
2763 | |
+ gkbd_desktop_config_load_group_descriptions(¤t_config, registry,
|
2764 | |
+ (const gchar **) xklrec->layouts,
|
2765 | |
+ (const gchar **) xklrec->variants,
|
2766 | |
+ &shortnames,
|
2767 | |
+ &longnames);
|
2768 | |
+
|
2769 | |
+ for (g = 0; g < g_strv_length (shortnames);g++) {
|
2770 | |
+ gpointer pcounter = NULL;
|
2771 | |
+ gchar *prev_layout_name = NULL;
|
2772 | |
+ int counter = 0;
|
2773 | |
+
|
2774 | |
+ if (g < g_strv_length (shortnames)) {
|
2775 | |
+ if (xkl_engine_get_features (engine) &
|
2776 | |
+ XKLF_MULTIPLE_LAYOUTS_SUPPORTED) {
|
2777 | |
+ gchar *longname = (gchar *) current_kbd_config.layouts_variants[g];
|
2778 | |
+ gchar *variant_name;
|
2779 | |
+ if (!gkbd_keyboard_config_split_items (longname, &lname, &variant_name))
|
2780 | |
+ /* just in case */
|
2781 | |
+ lname = longname;
|
2782 | |
+
|
2783 | |
+ if (shortnames != NULL) {
|
2784 | |
+ gchar *shortname = shortnames[g];
|
2785 | |
+ if (shortname != NULL && *shortname != '\0') {
|
2786 | |
+ lname = shortname;
|
2787 | |
+ }
|
2788 | |
+ }
|
2789 | |
+ } else {
|
2790 | |
+ lname = longnames[g];
|
2791 | |
+ }
|
2792 | |
+ }
|
2793 | |
+ if (lname == NULL)
|
2794 | |
+ lname = "";
|
2795 | |
+
|
2796 | |
+ /* Process layouts with repeating description */
|
2797 | |
+ if (g_hash_table_lookup_extended (ln2cnt_map, lname, (gpointer *) & prev_layout_name, &pcounter)) {
|
2798 | |
+ /* "next" same description */
|
2799 | |
+ counter = GPOINTER_TO_INT (pcounter);
|
2800 | |
+ guide = "XXX1";
|
2801 | |
+ }
|
2802 | |
+ g_hash_table_insert (ln2cnt_map, g_strdup (lname), GINT_TO_POINTER (counter+1));
|
2803 | |
+
|
2804 | |
+ if (st->group == g) {
|
2805 | |
+ if (counter > 0) {
|
2806 | |
+ gchar appendix[10] = "";
|
2807 | |
+ gint utf8length;
|
2808 | |
+ gunichar cidx;
|
2809 | |
+ /* Unicode subscript 2, 3, 4 */
|
2810 | |
+ cidx = 0x2081 + counter;
|
2811 | |
+ utf8length = g_unichar_to_utf8 (cidx, appendix);
|
2812 | |
+ appendix[utf8length] = '\0';
|
2813 | |
+ layout_name = g_strconcat (lname, appendix, NULL);
|
2814 | |
+ } else {
|
2815 | |
+ layout_name = g_strdup(lname);
|
2816 | |
+ }
|
2817 | |
+ }
|
2818 | |
+ }
|
2819 | |
+
|
2820 | |
+ // Guide of 3 wide-ish and one thin
|
2821 | |
+ app_indicator_set_label(app_indicator, layout_name, guide);
|
2822 | |
+ g_hash_table_destroy(ln2cnt_map);
|
2823 | |
+ g_free(layout_name);
|
2824 | |
+ g_strfreev(longnames);
|
2825 | |
+ g_strfreev(shortnames);
|
2826 | |
+ }
|
2827 | |
+
|
2828 | |
+ // Refresh popup menu
|
2829 | |
+ gsd_keyboard_configuration_changed (gkbd_configuration);
|
2830 | |
+
|
2831 | |
+ g_object_unref (G_OBJECT (xklrec));
|
2832 | |
+ g_object_unref (G_OBJECT (registry));
|
2833 | |
+#endif
|
2834 | |
+}
|
2835 | |
+
|
2836 | |
+static void
|
2837 | |
+popup_menu_set_group_cb (GtkMenuItem * item, gpointer param)
|
2838 | |
+{
|
2839 | |
+ gint group_number = GPOINTER_TO_INT (param);
|
2840 | |
+
|
2841 | |
+#ifdef HAVE_APPINDICATOR
|
2842 | |
+ if ((item) != NULL && (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item))))
|
2843 | |
+ return;
|
2844 | |
+#endif
|
2845 | |
+
|
2846 | |
+ popup_menu_set_group(group_number, FALSE);
|
2847 | |
+}
|
2848 | |
+
|
2849 | |
+#ifdef HAVE_APPINDICATOR
|
2850 | |
+static void
|
2851 | |
+state_callback (XklEngine * engine,
|
2852 | |
+ XklEngineStateChange changeType,
|
2853 | |
+ gint group, gboolean restore)
|
2854 | |
+{
|
2855 | |
+ if ((changeType == GROUP_CHANGED) || (changeType == INDICATORS_CHANGED))
|
2856 | |
+ popup_menu_set_group (GINT_TO_POINTER(group), TRUE);
|
2857 | |
+}
|
2858 | |
+
|
2859 | |
+static int
|
2860 | |
+get_current_group(void)
|
2861 | |
+{
|
2862 | |
+ XklEngine *engine = gkbd_configuration_get_xkl_engine (gkbd_configuration);
|
2863 | |
+ return xkl_engine_get_current_window_group (engine);
|
2864 | |
+}
|
2865 | |
+#endif
|
2866 | |
+
|
2867 | |
+static GtkMenu *
|
2868 | |
+create_status_menu (void)
|
2869 | |
+{
|
2870 | |
+ GtkMenu *popup_menu = GTK_MENU (gtk_menu_new ());
|
2871 | |
+ int i = 0;
|
2872 | |
+#ifdef HAVE_APPINDICATOR
|
2873 | |
+ const char * const *current_name = gkbd_configuration_get_group_names (gkbd_configuration);
|
2874 | |
+ groups_items_group = NULL;
|
2875 | |
+ GtkWidget *item;
|
2876 | |
+ int group = get_current_group();
|
2877 | |
+ lang_menu_items = 0;
|
2878 | |
+#else
|
2879 | |
+ GtkMenu *groups_menu = GTK_MENU (gtk_menu_new ());
|
2880 | |
+ gchar **current_name = gkbd_status_get_group_names ();
|
2881 | |
+
|
2882 | |
+ GtkWidget *item = gtk_menu_item_new_with_mnemonic (_("_Layouts"));
|
2883 | |
+ gtk_widget_show (item);
|
2884 | |
+ gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item);
|
2885 | |
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (item),
|
2886 | |
+ GTK_WIDGET (groups_menu));
|
2887 | |
+
|
2888 | |
+ item = gtk_menu_item_new_with_mnemonic (_("Show _Keyboard Layout..."));
|
2889 | |
+ gtk_widget_show (item);
|
2890 | |
+ g_signal_connect (item, "activate", popup_menu_show_layout, NULL);
|
2891 | |
+ gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item);
|
2892 | |
+
|
2893 | |
+ /* translators note:
|
2894 | |
+ * This is the name of the gnome-control-center "region" panel */
|
2895 | |
+ item = gtk_menu_item_new_with_mnemonic (_("Region and Language Settings"));
|
2896 | |
+ gtk_widget_show (item);
|
2897 | |
+ g_signal_connect (item, "activate", popup_menu_launch_capplet, NULL);
|
2898 | |
+ gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item);
|
2899 | |
+#endif
|
2900 | |
+
|
2901 | |
+ for (i = 0; current_name && *current_name; i++, current_name++) {
|
2902 | |
+#ifdef HAVE_APPINDICATOR
|
2903 | |
+ item = gtk_radio_menu_item_new_with_label (groups_items_group, *current_name);
|
2904 | |
+ groups_items_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
|
2905 | |
+
|
2906 | |
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item),
|
2907 | |
+ i == group);
|
2908 | |
+
|
2909 | |
+ gtk_widget_show (item);
|
2910 | |
+ gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item);
|
2911 | |
+ g_signal_connect (item, "activate",
|
2912 | |
+ G_CALLBACK (popup_menu_set_group_cb),
|
2913 | |
+ GINT_TO_POINTER (i));
|
2914 | |
+ lang_menu_items++;
|
2915 | |
+#else
|
2916 | |
+ gchar *image_file = gkbd_status_get_image_filename (i);
|
2917 | |
+
|
2918 | |
+ if (image_file == NULL) {
|
2919 | |
+ item =
|
2920 | |
+ gtk_menu_item_new_with_label (*current_name);
|
2921 | |
+ } else {
|
2922 | |
+ GdkPixbuf *pixbuf =
|
2923 | |
+ gdk_pixbuf_new_from_file_at_size (image_file,
|
2924 | |
+ 24, 24,
|
2925 | |
+ NULL);
|
2926 | |
+ GtkWidget *img =
|
2927 | |
+ gtk_image_new_from_pixbuf (pixbuf);
|
2928 | |
+ item =
|
2929 | |
+ gtk_image_menu_item_new_with_label
|
2930 | |
+ (*current_name);
|
2931 | |
+ gtk_widget_show (img);
|
2932 | |
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM
|
2933 | |
+ (item), img);
|
2934 | |
+ gtk_image_menu_item_set_always_show_image
|
2935 | |
+ (GTK_IMAGE_MENU_ITEM (item), TRUE);
|
2936 | |
+ g_free (image_file);
|
2937 | |
+ }
|
2938 | |
+ gtk_widget_show (item);
|
2939 | |
+ gtk_menu_shell_append (GTK_MENU_SHELL (groups_menu), item);
|
2940 | |
+ g_signal_connect (item, "activate",
|
2941 | |
+ G_CALLBACK (popup_menu_set_group_cb),
|
2942 | |
+ GINT_TO_POINTER (i));
|
2943 | |
+#endif
|
2944 | |
+ }
|
2945 | |
+
|
2946 | |
+#ifdef HAVE_APPINDICATOR
|
2947 | |
+ item = gtk_separator_menu_item_new();
|
2948 | |
+ gtk_widget_show(item);
|
2949 | |
+ gtk_menu_shell_append(GTK_MENU_SHELL (popup_menu), item);
|
2950 | |
+
|
2951 | |
+ item =
|
2952 | |
+ gtk_menu_item_new_with_mnemonic (_("Show _Layout Chart"));
|
2953 | |
+ gtk_widget_show (item);
|
2954 | |
+ g_signal_connect (item, "activate", popup_menu_show_layout,
|
2955 | |
+ NULL);
|
2956 | |
+ gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item);
|
2957 | |
+
|
2958 | |
+ item = gtk_menu_item_new_with_mnemonic (_("Keyboard Layout _Settings..."));
|
2959 | |
+ gtk_widget_show (item);
|
2960 | |
+ g_signal_connect (item, "activate", popup_menu_launch_capplet, NULL);
|
2961 | |
+ gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item);
|
2962 | |
+#endif
|
2963 | |
+
|
2964 | |
+ return popup_menu;
|
2965 | |
+}
|
2966 | |
+
|
2967 | |
+#ifndef HAVE_APPINDICATOR
|
2968 | |
+static void
|
2969 | |
+status_icon_popup_menu_cb (GtkStatusIcon * icon, guint button, guint time)
|
2970 | |
+{
|
2971 | |
+ GtkMenu *popup_menu = create_status_menu ();
|
2972 | |
+
|
2973 | |
+ gtk_menu_popup (popup_menu, NULL, NULL,
|
2974 | |
+ gtk_status_icon_position_menu,
|
2975 | |
+ (gpointer) icon, button, time);
|
2976 | |
+}
|
2977 | |
+#endif
|
2978 | |
+
|
2979 | |
+#ifdef HAVE_APPINDICATOR
|
2980 | |
+static void
|
2981 | |
+scroll_event (AppIndicator *indicator, gint delta, guint direction)
|
2982 | |
+{
|
2983 | |
+ g_return_if_fail(IS_APP_INDICATOR(indicator));
|
2984 | |
+ int group = get_current_group();
|
2985 | |
+
|
2986 | |
+ if ((direction == 0 && group == 0) ||
|
2987 | |
+ (direction == 1 && group == lang_menu_items-1))
|
2988 | |
+ return;
|
2989 | |
+
|
2990 | |
+ popup_menu_set_group((direction == 0 ? group-1 : group+1), FALSE);
|
2991 | |
+}
|
2992 | |
+#endif
|
2993 | |
+
|
2994 | |
+static void
|
2995 | |
+show_hide_icon ()
|
2996 | |
+{
|
2997 | |
+ if (g_strv_length (current_kbd_config.layouts_variants) > 1) {
|
2998 | |
+#ifdef HAVE_APPINDICATOR
|
2999 | |
+ if (app_indicator == NULL) {
|
3000 | |
+ GtkMenu *popup_menu = create_status_menu ();
|
3001 | |
+
|
3002 | |
+ app_indicator = app_indicator_new ("keyboard",
|
3003 | |
+ "keyboard",
|
3004 | |
+ APP_INDICATOR_CATEGORY_HARDWARE);
|
3005 | |
+ int group = get_current_group();
|
3006 | |
+ popup_menu_set_group(GINT_TO_POINTER(group), TRUE);
|
3007 | |
+ app_indicator_set_status (app_indicator,
|
3008 | |
+ APP_INDICATOR_STATUS_ACTIVE);
|
3009 | |
+ app_indicator_set_menu (app_indicator,
|
3010 | |
+ popup_menu);
|
3011 | |
+ app_indicator_set_title (app_indicator, _("Keyboard"));
|
3012 | |
+ g_signal_connect (app_indicator, "scroll-event", G_CALLBACK (scroll_event), NULL);
|
3013 | |
+ } else {
|
3014 | |
+ XklEngine *engine = gkbd_configuration_get_xkl_engine (gkbd_configuration);
|
3015 | |
+ XklState *st = xkl_engine_get_current_state(engine);
|
3016 | |
+ popup_menu_set_group(GINT_TO_POINTER(st->group), TRUE);
|
3017 | |
+ }
|
3018 | |
+#else
|
3019 | |
+ if (icon == NULL) {
|
3020 | |
+ xkl_debug (150, "Creating keyboard status icon\n");
|
3021 | |
+ icon = gkbd_status_new ();
|
3022 | |
+ g_signal_connect (icon, "popup-menu",
|
3023 | |
+ G_CALLBACK
|
3024 | |
+ (status_icon_popup_menu_cb),
|
3025 | |
+ NULL);
|
3026 | |
+
|
3027 | |
+ }
|
3028 | |
+#endif
|
3029 | |
+ } else {
|
3030 | |
+#ifdef HAVE_APPINDICATOR
|
3031 | |
+ g_clear_object (&app_indicator);
|
3032 | |
+#else
|
3033 | |
+ if (icon != NULL) {
|
3034 | |
+ xkl_debug (150, "Destroying icon\n");
|
3035 | |
+ g_object_unref (icon);
|
3036 | |
+ icon = NULL;
|
3037 | |
+ }
|
3038 | |
+#endif
|
3039 | |
+ }
|
3040 | |
+}
|
3041 | |
+
|
3042 | |
+static gboolean
|
3043 | |
+try_activating_xkb_config_if_new (GkbdKeyboardConfig *
|
3044 | |
+ current_sys_kbd_config)
|
3045 | |
+{
|
3046 | |
+ /* Activate - only if different! */
|
3047 | |
+ if (!gkbd_keyboard_config_equals
|
3048 | |
+ (¤t_kbd_config, current_sys_kbd_config)) {
|
3049 | |
+ if (gkbd_keyboard_config_activate (¤t_kbd_config)) {
|
3050 | |
+ if (pa_callback != NULL) {
|
3051 | |
+ (*pa_callback) (pa_callback_user_data);
|
3052 | |
+ return TRUE;
|
3053 | |
+ }
|
3054 | |
+ } else {
|
3055 | |
+ return FALSE;
|
3056 | |
+ }
|
3057 | |
+ }
|
3058 | |
+ return TRUE;
|
3059 | |
+}
|
3060 | |
+
|
3061 | |
+static gboolean
|
3062 | |
+filter_xkb_config (void)
|
3063 | |
+{
|
3064 | |
+ XklConfigItem *item;
|
3065 | |
+ gchar *lname;
|
3066 | |
+ gchar *vname;
|
3067 | |
+ gchar **lv;
|
3068 | |
+ gboolean any_change = FALSE;
|
3069 | |
+
|
3070 | |
+ xkl_debug (100, "Filtering configuration against the registry\n");
|
3071 | |
+ if (!ensure_xkl_registry ())
|
3072 | |
+ return FALSE;
|
3073 | |
+
|
3074 | |
+ lv = current_kbd_config.layouts_variants;
|
3075 | |
+ item = xkl_config_item_new ();
|
3076 | |
+ while (*lv) {
|
3077 | |
+ xkl_debug (100, "Checking [%s]\n", *lv);
|
3078 | |
+ if (gkbd_keyboard_config_split_items (*lv, &lname, &vname)) {
|
3079 | |
+ gboolean should_be_dropped = FALSE;
|
3080 | |
+ g_snprintf (item->name, sizeof (item->name), "%s",
|
3081 | |
+ lname);
|
3082 | |
+ if (!xkl_config_registry_find_layout
|
3083 | |
+ (xkl_registry, item)) {
|
3084 | |
+ xkl_debug (100, "Bad layout [%s]\n",
|
3085 | |
+ lname);
|
3086 | |
+ should_be_dropped = TRUE;
|
3087 | |
+ } else if (vname) {
|
3088 | |
+ g_snprintf (item->name,
|
3089 | |
+ sizeof (item->name), "%s",
|
3090 | |
+ vname);
|
3091 | |
+ if (!xkl_config_registry_find_variant
|
3092 | |
+ (xkl_registry, lname, item)) {
|
3093 | |
+ xkl_debug (100,
|
3094 | |
+ "Bad variant [%s(%s)]\n",
|
3095 | |
+ lname, vname);
|
3096 | |
+ should_be_dropped = TRUE;
|
3097 | |
+ }
|
3098 | |
+ }
|
3099 | |
+ if (should_be_dropped) {
|
3100 | |
+ gkbd_strv_behead (lv);
|
3101 | |
+ any_change = TRUE;
|
3102 | |
+ continue;
|
3103 | |
+ }
|
3104 | |
+ }
|
3105 | |
+ lv++;
|
3106 | |
+ }
|
3107 | |
+ g_object_unref (item);
|
3108 | |
+ return any_change;
|
3109 | |
+}
|
3110 | |
+
|
3111 | |
+static void
|
3112 | |
+apply_xkb_settings (void)
|
3113 | |
+{
|
3114 | |
+ GkbdKeyboardConfig current_sys_kbd_config;
|
3115 | |
+
|
3116 | |
+ if (!inited_ok)
|
3117 | |
+ return;
|
3118 | |
+
|
3119 | |
+ gkbd_keyboard_config_init (¤t_sys_kbd_config, xkl_engine);
|
3120 | |
+
|
3121 | |
+ gkbd_keyboard_config_load (¤t_kbd_config,
|
3122 | |
+ &initial_sys_kbd_config);
|
3123 | |
+
|
3124 | |
+ gkbd_keyboard_config_load_from_x_current (¤t_sys_kbd_config,
|
3125 | |
+ NULL);
|
3126 | |
+
|
3127 | |
+#ifdef HAVE_APPINDICATOR
|
3128 | |
+ gkbd_indicator_config_init (¤t_ind_config, xkl_engine);
|
3129 | |
+ gkbd_indicator_config_load (¤t_ind_config);
|
3130 | |
+
|
3131 | |
+ gkbd_indicator_config_load_image_filenames (¤t_ind_config,
|
3132 | |
+ ¤t_kbd_config);
|
3133 | |
+ gkbd_indicator_config_activate (¤t_ind_config);
|
3134 | |
+#endif /* HAVE_APPINDICATOR */
|
3135 | |
+
|
3136 | |
+ if (!try_activating_xkb_config_if_new (¤t_sys_kbd_config)) {
|
3137 | |
+ if (filter_xkb_config ()) {
|
3138 | |
+ if (!try_activating_xkb_config_if_new
|
3139 | |
+ (¤t_sys_kbd_config)) {
|
3140 | |
+ g_warning
|
3141 | |
+ ("Could not activate the filtered XKB configuration");
|
3142 | |
+ activation_error ();
|
3143 | |
+ }
|
3144 | |
+ } else {
|
3145 | |
+ g_warning
|
3146 | |
+ ("Could not activate the XKB configuration");
|
3147 | |
+ activation_error ();
|
3148 | |
+ }
|
3149 | |
+ } else
|
3150 | |
+ xkl_debug (100,
|
3151 | |
+ "Actual KBD configuration was not changed: redundant notification\n");
|
3152 | |
+
|
3153 | |
+ gkbd_keyboard_config_term (¤t_sys_kbd_config);
|
3154 | |
+ show_hide_icon ();
|
3155 | |
+}
|
3156 | |
+
|
3157 | |
+static void
|
3158 | |
+gsd_keyboard_xkb_analyze_sysconfig (void)
|
3159 | |
+{
|
3160 | |
+ if (!inited_ok)
|
3161 | |
+ return;
|
3162 | |
+
|
3163 | |
+ gkbd_keyboard_config_init (&initial_sys_kbd_config, xkl_engine);
|
3164 | |
+ gkbd_keyboard_config_load_from_x_initial (&initial_sys_kbd_config,
|
3165 | |
+ NULL);
|
3166 | |
+}
|
3167 | |
+
|
3168 | |
+#ifdef HAVE_APPINDICATOR
|
3169 | |
+/* When the configuration changed update the indicator */
|
3170 | |
+static void
|
3171 | |
+gsd_keyboard_configuration_changed (GkbdConfiguration *configuration)
|
3172 | |
+{
|
3173 | |
+ GtkMenu *popup_menu;
|
3174 | |
+
|
3175 | |
+ if (!app_indicator)
|
3176 | |
+ return;
|
3177 | |
+
|
3178 | |
+ popup_menu = create_status_menu ();
|
3179 | |
+ app_indicator_set_menu (app_indicator,
|
3180 | |
+ popup_menu);
|
3181 | |
+}
|
3182 | |
+#endif
|
3183 | |
+
|
3184 | |
+void
|
3185 | |
+gsd_keyboard_xkb_set_post_activation_callback (PostActivationCallback fun,
|
3186 | |
+ void *user_data)
|
3187 | |
+{
|
3188 | |
+ pa_callback = fun;
|
3189 | |
+ pa_callback_user_data = user_data;
|
3190 | |
+}
|
3191 | |
+
|
3192 | |
+static GdkFilterReturn
|
3193 | |
+gsd_keyboard_xkb_evt_filter (GdkXEvent * xev, GdkEvent * event)
|
3194 | |
+{
|
3195 | |
+ XEvent *xevent = (XEvent *) xev;
|
3196 | |
+ xkl_engine_filter_events (xkl_engine, xevent);
|
3197 | |
+ return GDK_FILTER_CONTINUE;
|
3198 | |
+}
|
3199 | |
+
|
3200 | |
+/* When new Keyboard is plugged in - reload the settings */
|
3201 | |
+static void
|
3202 | |
+gsd_keyboard_new_device (XklEngine * engine)
|
3203 | |
+{
|
3204 | |
+ apply_desktop_settings ();
|
3205 | |
+ apply_xkb_settings ();
|
3206 | |
+}
|
3207 | |
+
|
3208 | |
+void
|
3209 | |
+gsd_keyboard_xkb_init (GsdKeyboardManager * kbd_manager)
|
3210 | |
+{
|
3211 | |
+ Display *display =
|
3212 | |
+ GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
3213 | |
+ gnome_settings_profile_start (NULL);
|
3214 | |
+
|
3215 | |
+ gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
|
3216 | |
+ DATADIR G_DIR_SEPARATOR_S
|
3217 | |
+ "icons");
|
3218 | |
+
|
3219 | |
+#ifdef HAVE_APPINDICATOR
|
3220 | |
+ gkbd_configuration = gkbd_configuration_get ();
|
3221 | |
+ g_signal_connect (gkbd_configuration, "changed",
|
3222 | |
+ G_CALLBACK (gsd_keyboard_configuration_changed), NULL);
|
3223 | |
+ g_signal_connect (gkbd_configuration, "group-changed",
|
3224 | |
+ G_CALLBACK (gsd_keyboard_configuration_changed), NULL);
|
3225 | |
+#endif
|
3226 | |
+ manager = kbd_manager;
|
3227 | |
+ gnome_settings_profile_start ("xkl_engine_get_instance");
|
3228 | |
+ xkl_engine = xkl_engine_get_instance (display);
|
3229 | |
+ gnome_settings_profile_end ("xkl_engine_get_instance");
|
3230 | |
+ if (xkl_engine) {
|
3231 | |
+ inited_ok = TRUE;
|
3232 | |
+
|
3233 | |
+ gkbd_desktop_config_init (¤t_config, xkl_engine);
|
3234 | |
+ gkbd_keyboard_config_init (¤t_kbd_config,
|
3235 | |
+ xkl_engine);
|
3236 | |
+ xkl_engine_backup_names_prop (xkl_engine);
|
3237 | |
+ gsd_keyboard_xkb_analyze_sysconfig ();
|
3238 | |
+
|
3239 | |
+ settings_desktop = g_settings_new (GKBD_DESKTOP_SCHEMA);
|
3240 | |
+ settings_keyboard = g_settings_new (GKBD_KEYBOARD_SCHEMA);
|
3241 | |
+ g_signal_connect (settings_desktop, "changed",
|
3242 | |
+ (GCallback) apply_desktop_settings,
|
3243 | |
+ NULL);
|
3244 | |
+ g_signal_connect (settings_keyboard, "changed",
|
3245 | |
+ (GCallback) apply_xkb_settings, NULL);
|
3246 | |
+
|
3247 | |
+#ifdef HAVE_APPINDICATOR
|
3248 | |
+ g_signal_connect (xkl_engine, "X-state-changed", G_CALLBACK (state_callback), NULL);
|
3249 | |
+#endif
|
3250 | |
+ gdk_window_add_filter (NULL, (GdkFilterFunc)
|
3251 | |
+ gsd_keyboard_xkb_evt_filter, NULL);
|
3252 | |
+
|
3253 | |
+ if (xkl_engine_get_features (xkl_engine) &
|
3254 | |
+ XKLF_DEVICE_DISCOVERY)
|
3255 | |
+ g_signal_connect (xkl_engine, "X-new-device",
|
3256 | |
+ G_CALLBACK
|
3257 | |
+ (gsd_keyboard_new_device), NULL);
|
3258 | |
+
|
3259 | |
+ gnome_settings_profile_start ("xkl_engine_start_listen");
|
3260 | |
+ xkl_engine_start_listen (xkl_engine,
|
3261 | |
+ XKLL_MANAGE_LAYOUTS |
|
3262 | |
+ XKLL_MANAGE_WINDOW_STATES);
|
3263 | |
+ gnome_settings_profile_end ("xkl_engine_start_listen");
|
3264 | |
+
|
3265 | |
+ gnome_settings_profile_start ("apply_desktop_settings");
|
3266 | |
+ apply_desktop_settings ();
|
3267 | |
+ gnome_settings_profile_end ("apply_desktop_settings");
|
3268 | |
+ gnome_settings_profile_start ("apply_xkb_settings");
|
3269 | |
+ apply_xkb_settings ();
|
3270 | |
+ gnome_settings_profile_end ("apply_xkb_settings");
|
3271 | |
+ }
|
3272 | |
+ preview_dialogs = g_hash_table_new (g_direct_hash, g_direct_equal);
|
3273 | |
+
|
3274 | |
+ gnome_settings_profile_end (NULL);
|
3275 | |
+}
|
3276 | |
+
|
3277 | |
+void
|
3278 | |
+gsd_keyboard_xkb_shutdown (void)
|
3279 | |
+{
|
3280 | |
+ if (!inited_ok)
|
3281 | |
+ return;
|
3282 | |
+
|
3283 | |
+ pa_callback = NULL;
|
3284 | |
+ pa_callback_user_data = NULL;
|
3285 | |
+ manager = NULL;
|
3286 | |
+
|
3287 | |
+ if (preview_dialogs != NULL)
|
3288 | |
+ g_hash_table_destroy (preview_dialogs);
|
3289 | |
+
|
3290 | |
+ if (!inited_ok)
|
3291 | |
+ return;
|
3292 | |
+
|
3293 | |
+ xkl_engine_stop_listen (xkl_engine,
|
3294 | |
+ XKLL_MANAGE_LAYOUTS |
|
3295 | |
+ XKLL_MANAGE_WINDOW_STATES);
|
3296 | |
+
|
3297 | |
+ gdk_window_remove_filter (NULL, (GdkFilterFunc)
|
3298 | |
+ gsd_keyboard_xkb_evt_filter, NULL);
|
3299 | |
+
|
3300 | |
+ g_object_unref (settings_desktop);
|
3301 | |
+ settings_desktop = NULL;
|
3302 | |
+ g_object_unref (settings_keyboard);
|
3303 | |
+ settings_keyboard = NULL;
|
3304 | |
+
|
3305 | |
+ if (xkl_registry) {
|
3306 | |
+ g_object_unref (xkl_registry);
|
3307 | |
+ }
|
3308 | |
+
|
3309 | |
+ g_object_unref (xkl_engine);
|
3310 | |
+
|
3311 | |
+ xkl_engine = NULL;
|
3312 | |
+
|
3313 | |
+#ifdef HAVE_APPINDICATOR
|
3314 | |
+ g_clear_object (&gkbd_configuration);
|
3315 | |
+#endif
|
3316 | |
+
|
3317 | |
+ inited_ok = FALSE;
|
3318 | |
+}
|
3319 | |
Index: gnome-settings-daemon-3.6.4/plugins/keyboard/gsd-keyboard-xkb.h
|
3320 | |
===================================================================
|
3321 | |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
3322 | |
+++ gnome-settings-daemon-3.6.4/plugins/keyboard/gsd-keyboard-xkb.h 2013-04-17 17:52:29.760040153 +0200
|
3323 | |
@@ -0,0 +1,39 @@
|
3324 | |
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
3325 | |
+ * gnome-settings-keyboard-xkb.h
|
3326 | |
+ *
|
3327 | |
+ * Copyright (C) 2001 Udaltsoft
|
3328 | |
+ *
|
3329 | |
+ * Written by Sergey V. Oudaltsov <svu@users.sourceforge.net>
|
3330 | |
+ *
|
3331 | |
+ * This program is free software; you can redistribute it and/or modify
|
3332 | |
+ * it under the terms of the GNU General Public License as published by
|
3333 | |
+ * the Free Software Foundation; either version 2, or (at your option)
|
3334 | |
+ * any later version.
|
3335 | |
+ *
|
3336 | |
+ * This program is distributed in the hope that it will be useful,
|
3337 | |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
3338 | |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
3339 | |
+ * GNU General Public License for more details.
|
3340 | |
+ *
|
3341 | |
+ * You should have received a copy of the GNU General Public License
|
3342 | |
+ * along with this program; if not, write to the Free Software
|
3343 | |
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
3344 | |
+ * 02111-1307, USA.
|
3345 | |
+ */
|
3346 | |
+
|
3347 | |
+#ifndef __GSD_KEYBOARD_XKB_H
|
3348 | |
+#define __GSD_KEYBOARD_XKB_H
|
3349 | |
+
|
3350 | |
+#include <libxklavier/xklavier.h>
|
3351 | |
+#include "gsd-keyboard-manager.h"
|
3352 | |
+
|
3353 | |
+void gsd_keyboard_xkb_init (GsdKeyboardManager *manager);
|
3354 | |
+void gsd_keyboard_xkb_shutdown (void);
|
3355 | |
+
|
3356 | |
+typedef void (*PostActivationCallback) (void *userData);
|
3357 | |
+
|
3358 | |
+void
|
3359 | |
+gsd_keyboard_xkb_set_post_activation_callback (PostActivationCallback fun,
|
3360 | |
+ void *userData);
|
3361 | |
+
|
3362 | |
+#endif
|
3363 | |
Index: gnome-settings-daemon-3.6.4/plugins/keyboard/Makefile.am
|
3364 | |
===================================================================
|
3365 | |
--- gnome-settings-daemon-3.6.4.orig/plugins/keyboard/Makefile.am 2013-04-17 17:52:29.768040154 +0200
|
3366 | |
+++ gnome-settings-daemon-3.6.4/plugins/keyboard/Makefile.am 2013-04-17 17:52:29.760040153 +0200
|
3367 | |
@@ -20,20 +20,25 @@
|
3368 | |
gsd-keyboard-plugin.c \
|
3369 | |
gsd-keyboard-manager.h \
|
3370 | |
gsd-keyboard-manager.c \
|
3371 | |
+ gsd-keyboard-xkb.h \
|
3372 | |
+ gsd-keyboard-xkb.c \
|
3373 | |
+ delayed-dialog.h \
|
3374 | |
+ delayed-dialog.c \
|
3375 | |
+ gkbd-configuration.c \
|
3376 | |
+ gkbd-configuration.h \
|
3377 | |
$(NULL)
|
3378 | |
|
3379 | |
libkeyboard_la_CPPFLAGS = \
|
3380 | |
-I$(top_srcdir)/gnome-settings-daemon \
|
3381 | |
-I$(top_srcdir)/data \
|
3382 | |
- -I$(top_srcdir)/plugins/common \
|
3383 | |
-DDATADIR=\""$(pkgdatadir)"\" \
|
3384 | |
- -DLIBEXECDIR=\""$(libexecdir)"\" \
|
3385 | |
-DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
|
3386 | |
$(AM_CPPFLAGS)
|
3387 | |
|
3388 | |
libkeyboard_la_CFLAGS = \
|
3389 | |
$(PLUGIN_CFLAGS) \
|
3390 | |
$(SETTINGS_PLUGIN_CFLAGS) \
|
3391 | |
+ $(APPINDICATOR_CFLAGS) \
|
3392 | |
$(KEYBOARD_CFLAGS) \
|
3393 | |
$(AM_CFLAGS)
|
3394 | |
|
3395 | |
@@ -41,63 +46,19 @@
|
3396 | |
$(GSD_PLUGIN_LDFLAGS) \
|
3397 | |
$(NULL)
|
3398 | |
|
3399 | |
-libkeyboard_la_LIBADD = \
|
3400 | |
- $(top_builddir)/plugins/common/libcommon.la \
|
3401 | |
- $(SETTINGS_PLUGIN_LIBS) \
|
3402 | |
- $(XF86MISC_LIBS) \
|
3403 | |
- $(KEYBOARD_LIBS) \
|
3404 | |
+libkeyboard_la_LIBADD = \
|
3405 | |
+ $(SETTINGS_PLUGIN_LIBS) \
|
3406 | |
+ $(XF86MISC_LIBS) \
|
3407 | |
+ $(KEYBOARD_LIBS) \
|
3408 | |
+ $(APPINDICATOR_LIBS) \
|
3409 | |
$(NULL)
|
3410 | |
|
3411 | |
-libexec_PROGRAMS = gsd-test-keyboard
|
3412 | |
-gsd_test_keyboard_SOURCES = \
|
3413 | |
- test-keyboard.c \
|
3414 | |
- gsd-keyboard-manager.h \
|
3415 | |
- gsd-keyboard-manager.c \
|
3416 | |
- $(NULL)
|
3417 | |
-
|
3418 | |
-gsd_test_keyboard_CFLAGS = $(libkeyboard_la_CFLAGS)
|
3419 | |
-gsd_test_keyboard_CPPFLAGS = $(libkeyboard_la_CPPFLAGS)
|
3420 | |
-gsd_test_keyboard_LDADD = $(libkeyboard_la_LIBADD) $(top_builddir)/gnome-settings-daemon/libgsd.la
|
3421 | |
-
|
3422 | |
plugin_in_files = \
|
3423 | |
keyboard.gnome-settings-plugin.in \
|
3424 | |
$(NULL)
|
3425 | |
|
3426 | |
plugin_DATA = $(plugin_in_files:.gnome-settings-plugin.in=.gnome-settings-plugin)
|
3427 | |
|
3428 | |
-if HAVE_IBUS
|
3429 | |
-noinst_PROGRAMS = test-keyboard-ibus-utils
|
3430 | |
-test_keyboard_ibus_utils_SOURCES = test-keyboard-ibus-utils.c
|
3431 | |
-test_keyboard_ibus_utils_CFLAGS = $(libkeyboard_la_CFLAGS)
|
3432 | |
-test_keyboard_ibus_utils_CPPFLAGS = $(libkeyboard_la_CPPFLAGS)
|
3433 | |
-test_keyboard_ibus_utils_LDADD = $(libkeyboard_la_LIBADD) $(top_builddir)/gnome-settings-daemon/libgsd.la
|
3434 | |
-
|
3435 | |
-check-local: test-keyboard-ibus-utils
|
3436 | |
- $(builddir)/test-keyboard-ibus-utils > /dev/null
|
3437 | |
-endif
|
3438 | |
-
|
3439 | |
-libexec_PROGRAMS += gsd-input-sources-switcher
|
3440 | |
-
|
3441 | |
-gsd_input_sources_switcher_SOURCES = \
|
3442 | |
- gsd-input-sources-switcher.c \
|
3443 | |
- $(NULL)
|
3444 | |
-
|
3445 | |
-gsd_input_sources_switcher_CPPFLAGS = \
|
3446 | |
- -I$(top_srcdir)/data \
|
3447 | |
- -I$(top_srcdir)/plugins/common \
|
3448 | |
- $(AM_CPPFLAGS) \
|
3449 | |
- $(NULL)
|
3450 | |
-
|
3451 | |
-gsd_input_sources_switcher_CFLAGS = \
|
3452 | |
- $(SETTINGS_PLUGIN_CFLAGS) \
|
3453 | |
- $(AM_CFLAGS) \
|
3454 | |
- $(NULL)
|
3455 | |
-
|
3456 | |
-gsd_input_sources_switcher_LDADD = \
|
3457 | |
- $(top_builddir)/plugins/common/libcommon.la \
|
3458 | |
- $(SETTINGS_PLUGIN_LIBS) \
|
3459 | |
- $(NULL)
|
3460 | |
-
|
3461 | |
EXTRA_DIST = \
|
3462 | |
$(icons_DATA) \
|
3463 | |
$(plugin_in_files) \
|
3464 | |
Index: gnome-settings-daemon-3.6.4/plugins/keyboard/Makefile.in
|
3465 | |
===================================================================
|
3466 | |
--- gnome-settings-daemon-3.6.4.orig/plugins/keyboard/Makefile.in 2013-04-17 17:52:29.768040154 +0200
|
3467 | |
+++ gnome-settings-daemon-3.6.4/plugins/keyboard/Makefile.in 2013-04-17 17:52:29.760040153 +0200
|
3468 | |
@@ -1,8 +1,9 @@
|
3469 | |
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
|
3470 | |
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
|
3471 | |
# @configure_input@
|
3472 | |
|
3473 | |
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
3474 | |
-
|
3475 | |
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
3476 | |
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
3477 | |
+# Foundation, Inc.
|
3478 | |
# This Makefile.in is free software; the Free Software Foundation
|
3479 | |
# gives unlimited permission to copy and/or distribute it,
|
3480 | |
# with or without modifications, as long as this notice is preserved.
|
3481 | |
@@ -15,25 +16,7 @@
|
3482 | |
@SET_MAKE@
|
3483 | |
|
3484 | |
|
3485 | |
-
|
3486 | |
VPATH = @srcdir@
|
3487 | |
-am__make_dryrun = \
|
3488 | |
- { \
|
3489 | |
- am__dry=no; \
|
3490 | |
- case $$MAKEFLAGS in \
|
3491 | |
- *\\[\ \ ]*) \
|
3492 | |
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
3493 | |
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
3494 | |
- *) \
|
3495 | |
- for am__flg in $$MAKEFLAGS; do \
|
3496 | |
- case $$am__flg in \
|
3497 | |
- *=*|--*) ;; \
|
3498 | |
- *n*) am__dry=yes; break;; \
|
3499 | |
- esac; \
|
3500 | |
- done;; \
|
3501 | |
- esac; \
|
3502 | |
- test $$am__dry = yes; \
|
3503 | |
- }
|
3504 | |
pkgdatadir = $(datadir)/@PACKAGE@
|
3505 | |
pkgincludedir = $(includedir)/@PACKAGE@
|
3506 | |
pkglibdir = $(libdir)/@PACKAGE@
|
3507 | |
@@ -52,12 +35,8 @@
|
3508 | |
POST_UNINSTALL = :
|
3509 | |
build_triplet = @build@
|
3510 | |
host_triplet = @host@
|
3511 | |
-libexec_PROGRAMS = gsd-test-keyboard$(EXEEXT) \
|
3512 | |
- gsd-input-sources-switcher$(EXEEXT)
|
3513 | |
-@HAVE_IBUS_TRUE@noinst_PROGRAMS = test-keyboard-ibus-utils$(EXEEXT)
|
3514 | |
subdir = plugins/keyboard
|
3515 | |
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
3516 | |
- $(top_srcdir)/depcomp $(top_srcdir)/mkinstalldirs
|
3517 | |
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
3518 | |
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
3519 | |
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
3520 | |
$(top_srcdir)/configure.ac
|
3521 | |
@@ -94,76 +73,25 @@
|
3522 | |
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
3523 | |
$(am__cd) "$$dir" && rm -f $$files; }; \
|
3524 | |
}
|
3525 | |
-am__installdirs = "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(libexecdir)" \
|
3526 | |
- "$(DESTDIR)$(iconsdir)" "$(DESTDIR)$(plugindir)"
|
3527 | |
+am__installdirs = "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(iconsdir)" \
|
3528 | |
+ "$(DESTDIR)$(plugindir)"
|
3529 | |
LTLIBRARIES = $(plugin_LTLIBRARIES)
|
3530 | |
am__DEPENDENCIES_1 =
|
3531 | |
-libkeyboard_la_DEPENDENCIES = \
|
3532 | |
- $(top_builddir)/plugins/common/libcommon.la \
|
3533 | |
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
|
3534 | |
- $(am__DEPENDENCIES_1)
|
3535 | |
+libkeyboard_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
|
3536 | |
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
3537 | |
am__objects_1 =
|
3538 | |
am_libkeyboard_la_OBJECTS = libkeyboard_la-gsd-keyboard-plugin.lo \
|
3539 | |
- libkeyboard_la-gsd-keyboard-manager.lo $(am__objects_1)
|
3540 | |
+ libkeyboard_la-gsd-keyboard-manager.lo \
|
3541 | |
+ libkeyboard_la-gsd-keyboard-xkb.lo \
|
3542 | |
+ libkeyboard_la-delayed-dialog.lo $(am__objects_1)
|
3543 | |
libkeyboard_la_OBJECTS = $(am_libkeyboard_la_OBJECTS)
|
3544 | |
AM_V_lt = $(am__v_lt_@AM_V@)
|
3545 | |
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
3546 | |
am__v_lt_0 = --silent
|
3547 | |
-am__v_lt_1 =
|
3548 | |
libkeyboard_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
3549 | |
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
3550 | |
$(libkeyboard_la_CFLAGS) $(CFLAGS) $(libkeyboard_la_LDFLAGS) \
|
3551 | |
$(LDFLAGS) -o $@
|
3552 | |
-PROGRAMS = $(libexec_PROGRAMS) $(noinst_PROGRAMS)
|
3553 | |
-am_gsd_input_sources_switcher_OBJECTS = gsd_input_sources_switcher-gsd-input-sources-switcher.$(OBJEXT) \
|
3554 | |
- $(am__objects_1)
|
3555 | |
-gsd_input_sources_switcher_OBJECTS = \
|
3556 | |
- $(am_gsd_input_sources_switcher_OBJECTS)
|
3557 | |
-gsd_input_sources_switcher_DEPENDENCIES = \
|
3558 | |
- $(top_builddir)/plugins/common/libcommon.la \
|
3559 | |
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
3560 | |
-gsd_input_sources_switcher_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
3561 | |
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
3562 | |
- $(gsd_input_sources_switcher_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
3563 | |
- $(LDFLAGS) -o $@
|
3564 | |
-am_gsd_test_keyboard_OBJECTS = \
|
3565 | |
- gsd_test_keyboard-test-keyboard.$(OBJEXT) \
|
3566 | |
- gsd_test_keyboard-gsd-keyboard-manager.$(OBJEXT) \
|
3567 | |
- $(am__objects_1)
|
3568 | |
-gsd_test_keyboard_OBJECTS = $(am_gsd_test_keyboard_OBJECTS)
|
3569 | |
-am__DEPENDENCIES_2 = $(top_builddir)/plugins/common/libcommon.la \
|
3570 | |
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
|
3571 | |
- $(am__DEPENDENCIES_1)
|
3572 | |
-gsd_test_keyboard_DEPENDENCIES = $(am__DEPENDENCIES_2) \
|
3573 | |
- $(top_builddir)/gnome-settings-daemon/libgsd.la
|
3574 | |
-gsd_test_keyboard_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
3575 | |
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
3576 | |
- $(gsd_test_keyboard_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
|
3577 | |
- -o $@
|
3578 | |
-am__test_keyboard_ibus_utils_SOURCES_DIST = \
|
3579 | |
- test-keyboard-ibus-utils.c
|
3580 | |
-@HAVE_IBUS_TRUE@am_test_keyboard_ibus_utils_OBJECTS = test_keyboard_ibus_utils-test-keyboard-ibus-utils.$(OBJEXT)
|
3581 | |
-test_keyboard_ibus_utils_OBJECTS = \
|
3582 | |
- $(am_test_keyboard_ibus_utils_OBJECTS)
|
3583 | |
-@HAVE_IBUS_TRUE@test_keyboard_ibus_utils_DEPENDENCIES = \
|
3584 | |
-@HAVE_IBUS_TRUE@ $(am__DEPENDENCIES_2) \
|
3585 | |
-@HAVE_IBUS_TRUE@ $(top_builddir)/gnome-settings-daemon/libgsd.la
|
3586 | |
-test_keyboard_ibus_utils_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
3587 | |
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
3588 | |
- $(test_keyboard_ibus_utils_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
3589 | |
- $(LDFLAGS) -o $@
|
3590 | |
-AM_V_P = $(am__v_P_@AM_V@)
|
3591 | |
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
3592 | |
-am__v_P_0 = false
|
3593 | |
-am__v_P_1 = :
|
3594 | |
-AM_V_GEN = $(am__v_GEN_@AM_V@)
|
3595 | |
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
3596 | |
-am__v_GEN_0 = @echo " GEN " $@;
|
3597 | |
-am__v_GEN_1 =
|
3598 | |
-AM_V_at = $(am__v_at_@AM_V@)
|
3599 | |
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
3600 | |
-am__v_at_0 = @
|
3601 | |
-am__v_at_1 =
|
3602 | |
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
3603 | |
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
3604 | |
am__depfiles_maybe = depfiles
|
3605 | |
@@ -176,29 +104,22 @@
|
3606 | |
$(AM_CFLAGS) $(CFLAGS)
|
3607 | |
AM_V_CC = $(am__v_CC_@AM_V@)
|
3608 | |
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
3609 | |
-am__v_CC_0 = @echo " CC " $@;
|
3610 | |
-am__v_CC_1 =
|
3611 | |
+am__v_CC_0 = @echo " CC " $@;
|
3612 | |
+AM_V_at = $(am__v_at_@AM_V@)
|
3613 | |
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
3614 | |
+am__v_at_0 = @
|
3615 | |
CCLD = $(CC)
|
3616 | |
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
3617 | |
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
3618 | |
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
3619 | |
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
3620 | |
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
3621 | |
-am__v_CCLD_0 = @echo " CCLD " $@;
|
3622 | |
-am__v_CCLD_1 =
|
3623 | |
-SOURCES = $(libkeyboard_la_SOURCES) \
|
3624 | |
- $(gsd_input_sources_switcher_SOURCES) \
|
3625 | |
- $(gsd_test_keyboard_SOURCES) \
|
3626 | |
- $(test_keyboard_ibus_utils_SOURCES)
|
3627 | |
-DIST_SOURCES = $(libkeyboard_la_SOURCES) \
|
3628 | |
- $(gsd_input_sources_switcher_SOURCES) \
|
3629 | |
- $(gsd_test_keyboard_SOURCES) \
|
3630 | |
- $(am__test_keyboard_ibus_utils_SOURCES_DIST)
|
3631 | |
-am__can_run_installinfo = \
|
3632 | |
- case $$AM_UPDATE_INFO_DIR in \
|
3633 | |
- n|no|NO) false;; \
|
3634 | |
- *) (install-info --version) >/dev/null 2>&1;; \
|
3635 | |
- esac
|
3636 | |
+am__v_CCLD_0 = @echo " CCLD " $@;
|
3637 | |
+AM_V_GEN = $(am__v_GEN_@AM_V@)
|
3638 | |
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
3639 | |
+am__v_GEN_0 = @echo " GEN " $@;
|
3640 | |
+SOURCES = $(libkeyboard_la_SOURCES)
|
3641 | |
+DIST_SOURCES = $(libkeyboard_la_SOURCES)
|
3642 | |
DATA = $(icons_DATA) $(plugin_DATA)
|
3643 | |
ETAGS = etags
|
3644 | |
CTAGS = ctags
|
3645 | |
@@ -252,6 +173,8 @@
|
3646 | |
EGREP = @EGREP@
|
3647 | |
EXEEXT = @EXEEXT@
|
3648 | |
FGREP = @FGREP@
|
3649 | |
+FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
|
3650 | |
+FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
|
3651 | |
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
|
3652 | |
GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@
|
3653 | |
GIOUNIX_LIBS = @GIOUNIX_LIBS@
|
3654 | |
@@ -316,8 +239,6 @@
|
3655 | |
NSS_LIBS = @NSS_LIBS@
|
3656 | |
OBJDUMP = @OBJDUMP@
|
3657 | |
OBJEXT = @OBJEXT@
|
3658 | |
-ORIENTATION_CFLAGS = @ORIENTATION_CFLAGS@
|
3659 | |
-ORIENTATION_LIBS = @ORIENTATION_LIBS@
|
3660 | |
OTOOL = @OTOOL@
|
3661 | |
OTOOL64 = @OTOOL64@
|
3662 | |
PACKAGE = @PACKAGE@
|
3663 | |
@@ -336,8 +257,6 @@
|
3664 | |
PLUGIN_CFLAGS = @PLUGIN_CFLAGS@
|
3665 | |
POFILES = @POFILES@
|
3666 | |
POSUB = @POSUB@
|
3667 | |
-POWER_CFLAGS = @POWER_CFLAGS@
|
3668 | |
-POWER_LIBS = @POWER_LIBS@
|
3669 | |
PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
|
3670 | |
PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
|
3671 | |
RANLIB = @RANLIB@
|
3672 | |
@@ -348,22 +267,17 @@
|
3673 | |
SETTINGS_PLUGIN_LIBS = @SETTINGS_PLUGIN_LIBS@
|
3674 | |
SET_MAKE = @SET_MAKE@
|
3675 | |
SHELL = @SHELL@
|
3676 | |
-SOUND_CFLAGS = @SOUND_CFLAGS@
|
3677 | |
-SOUND_LIBS = @SOUND_LIBS@
|
3678 | |
STRIP = @STRIP@
|
3679 | |
SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
|
3680 | |
SYSTEMD_LIBS = @SYSTEMD_LIBS@
|
3681 | |
+UPOWER_CFLAGS = @UPOWER_CFLAGS@
|
3682 | |
+UPOWER_LIBS = @UPOWER_LIBS@
|
3683 | |
USE_NLS = @USE_NLS@
|
3684 | |
VERSION = @VERSION@
|
3685 | |
WACOM_CFLAGS = @WACOM_CFLAGS@
|
3686 | |
WACOM_LIBS = @WACOM_LIBS@
|
3687 | |
WARN_CFLAGS = @WARN_CFLAGS@
|
3688 | |
XGETTEXT = @XGETTEXT@
|
3689 | |
-XRANDR_CFLAGS = @XRANDR_CFLAGS@
|
3690 | |
-XRANDR_LIBS = @XRANDR_LIBS@
|
3691 | |
-XSETTINGS_CFLAGS = @XSETTINGS_CFLAGS@
|
3692 | |
-XSETTINGS_LIBS = @XSETTINGS_LIBS@
|
3693 | |
-XSLTPROC = @XSLTPROC@
|
3694 | |
abs_builddir = @abs_builddir@
|
3695 | |
abs_srcdir = @abs_srcdir@
|
3696 | |
abs_top_builddir = @abs_top_builddir@
|
3697 | |
@@ -440,14 +354,16 @@
|
3698 | |
gsd-keyboard-plugin.c \
|
3699 | |
gsd-keyboard-manager.h \
|
3700 | |
gsd-keyboard-manager.c \
|
3701 | |
+ gsd-keyboard-xkb.h \
|
3702 | |
+ gsd-keyboard-xkb.c \
|
3703 | |
+ delayed-dialog.h \
|
3704 | |
+ delayed-dialog.c \
|
3705 | |
$(NULL)
|
3706 | |
|
3707 | |
libkeyboard_la_CPPFLAGS = \
|
3708 | |
-I$(top_srcdir)/gnome-settings-daemon \
|
3709 | |
-I$(top_srcdir)/data \
|
3710 | |
- -I$(top_srcdir)/plugins/common \
|
3711 | |
-DDATADIR=\""$(pkgdatadir)"\" \
|
3712 | |
- -DLIBEXECDIR=\""$(libexecdir)"\" \
|
3713 | |
-DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
|
3714 | |
$(AM_CPPFLAGS)
|
3715 | |
|
3716 | |
@@ -462,50 +378,16 @@
|
3717 | |
$(NULL)
|
3718 | |
|
3719 | |
libkeyboard_la_LIBADD = \
|
3720 | |
- $(top_builddir)/plugins/common/libcommon.la \
|
3721 | |
- $(SETTINGS_PLUGIN_LIBS) \
|
3722 | |
- $(XF86MISC_LIBS) \
|
3723 | |
- $(KEYBOARD_LIBS) \
|
3724 | |
- $(NULL)
|
3725 | |
-
|
3726 | |
-gsd_test_keyboard_SOURCES = \
|
3727 | |
- test-keyboard.c \
|
3728 | |
- gsd-keyboard-manager.h \
|
3729 | |
- gsd-keyboard-manager.c \
|
3730 | |
+ $(SETTINGS_PLUGIN_LIBS) \
|
3731 | |
+ $(XF86MISC_LIBS) \
|
3732 | |
+ $(KEYBOARD_LIBS) \
|
3733 | |
$(NULL)
|
3734 | |
|
3735 | |
-gsd_test_keyboard_CFLAGS = $(libkeyboard_la_CFLAGS)
|
3736 | |
-gsd_test_keyboard_CPPFLAGS = $(libkeyboard_la_CPPFLAGS)
|
3737 | |
-gsd_test_keyboard_LDADD = $(libkeyboard_la_LIBADD) $(top_builddir)/gnome-settings-daemon/libgsd.la
|
3738 | |
plugin_in_files = \
|
3739 | |
keyboard.gnome-settings-plugin.in \
|
3740 | |
$(NULL)
|
3741 | |
|
3742 | |
plugin_DATA = $(plugin_in_files:.gnome-settings-plugin.in=.gnome-settings-plugin)
|
3743 | |
-@HAVE_IBUS_TRUE@test_keyboard_ibus_utils_SOURCES = test-keyboard-ibus-utils.c
|
3744 | |
-@HAVE_IBUS_TRUE@test_keyboard_ibus_utils_CFLAGS = $(libkeyboard_la_CFLAGS)
|
3745 | |
-@HAVE_IBUS_TRUE@test_keyboard_ibus_utils_CPPFLAGS = $(libkeyboard_la_CPPFLAGS)
|
3746 | |
-@HAVE_IBUS_TRUE@test_keyboard_ibus_utils_LDADD = $(libkeyboard_la_LIBADD) $(top_builddir)/gnome-settings-daemon/libgsd.la
|
3747 | |
-gsd_input_sources_switcher_SOURCES = \
|
3748 | |
- gsd-input-sources-switcher.c \
|
3749 | |
- $(NULL)
|
3750 | |
-
|
3751 | |
-gsd_input_sources_switcher_CPPFLAGS = \
|
3752 | |
- -I$(top_srcdir)/data \
|
3753 | |
- -I$(top_srcdir)/plugins/common \
|
3754 | |
- $(AM_CPPFLAGS) \
|
3755 | |
- $(NULL)
|
3756 | |
-
|
3757 | |
-gsd_input_sources_switcher_CFLAGS = \
|
3758 | |
- $(SETTINGS_PLUGIN_CFLAGS) \
|
3759 | |
- $(AM_CFLAGS) \
|
3760 | |
- $(NULL)
|
3761 | |
-
|
3762 | |
-gsd_input_sources_switcher_LDADD = \
|
3763 | |
- $(top_builddir)/plugins/common/libcommon.la \
|
3764 | |
- $(SETTINGS_PLUGIN_LIBS) \
|
3765 | |
- $(NULL)
|
3766 | |
-
|
3767 | |
EXTRA_DIST = \
|
3768 | |
$(icons_DATA) \
|
3769 | |
$(plugin_in_files) \
|
3770 | |
@@ -556,6 +438,7 @@
|
3771 | |
$(am__aclocal_m4_deps):
|
3772 | |
install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES)
|
3773 | |
@$(NORMAL_INSTALL)
|
3774 | |
+ test -z "$(plugindir)" || $(MKDIR_P) "$(DESTDIR)$(plugindir)"
|
3775 | |
@list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \
|
3776 | |
list2=; for p in $$list; do \
|
3777 | |
if test -f $$p; then \
|
3778 | |
@@ -563,8 +446,6 @@
|
3779 | |
else :; fi; \
|
3780 | |
done; \
|
3781 | |
test -z "$$list2" || { \
|
3782 | |
- echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \
|
3783 | |
- $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \
|
3784 | |
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \
|
3785 | |
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \
|
3786 | |
}
|
3787 | |
@@ -580,80 +461,14 @@
|
3788 | |
|
3789 | |
clean-pluginLTLIBRARIES:
|
3790 | |
-test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES)
|
3791 | |
- @list='$(plugin_LTLIBRARIES)'; \
|
3792 | |
- locs=`for p in $$list; do echo $$p; done | \
|
3793 | |
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
3794 | |
- sort -u`; \
|
3795 | |
- test -z "$$locs" || { \
|
3796 | |
- echo rm -f $${locs}; \
|
3797 | |
- rm -f $${locs}; \
|
3798 | |
- }
|
3799 | |
+ @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \
|
3800 | |
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
3801 | |
+ test "$$dir" != "$$p" || dir=.; \
|
3802 | |
+ echo "rm -f \"$${dir}/so_locations\""; \
|
3803 | |
+ rm -f "$${dir}/so_locations"; \
|
3804 | |
+ done
|
3805 | |
libkeyboard.la: $(libkeyboard_la_OBJECTS) $(libkeyboard_la_DEPENDENCIES) $(EXTRA_libkeyboard_la_DEPENDENCIES)
|
3806 | |
$(AM_V_CCLD)$(libkeyboard_la_LINK) -rpath $(plugindir) $(libkeyboard_la_OBJECTS) $(libkeyboard_la_LIBADD) $(LIBS)
|
3807 | |
-install-libexecPROGRAMS: $(libexec_PROGRAMS)
|
3808 | |
- @$(NORMAL_INSTALL)
|
3809 | |
- @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
|
3810 | |
- if test -n "$$list"; then \
|
3811 | |
- echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \
|
3812 | |
- $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \
|
3813 | |
- fi; \
|
3814 | |
- for p in $$list; do echo "$$p $$p"; done | \
|
3815 | |
- sed 's/$(EXEEXT)$$//' | \
|
3816 | |
- while read p p1; do if test -f $$p || test -f $$p1; \
|
3817 | |
- then echo "$$p"; echo "$$p"; else :; fi; \
|
3818 | |
- done | \
|
3819 | |
- sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
|
3820 | |
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
|
3821 | |
- sed 'N;N;N;s,\n, ,g' | \
|
3822 | |
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
|
3823 | |
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
|
3824 | |
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
|
3825 | |
- else { print "f", $$3 "/" $$4, $$1; } } \
|
3826 | |
- END { for (d in files) print "f", d, files[d] }' | \
|
3827 | |
- while read type dir files; do \
|
3828 | |
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
|
3829 | |
- test -z "$$files" || { \
|
3830 | |
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
|
3831 | |
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
|
3832 | |
- } \
|
3833 | |
- ; done
|
3834 | |
-
|
3835 | |
-uninstall-libexecPROGRAMS:
|
3836 | |
- @$(NORMAL_UNINSTALL)
|
3837 | |
- @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
|
3838 | |
- files=`for p in $$list; do echo "$$p"; done | \
|
3839 | |
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
|
3840 | |
- -e 's/$$/$(EXEEXT)/' `; \
|
3841 | |
- test -n "$$list" || exit 0; \
|
3842 | |
- echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
|
3843 | |
- cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
|
3844 | |
-
|
3845 | |
-clean-libexecPROGRAMS:
|
3846 | |
- @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
|
3847 | |
- echo " rm -f" $$list; \
|
3848 | |
- rm -f $$list || exit $$?; \
|
3849 | |
- test -n "$(EXEEXT)" || exit 0; \
|
3850 | |
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
3851 | |
- echo " rm -f" $$list; \
|
3852 | |
- rm -f $$list
|
3853 | |
-
|
3854 | |
-clean-noinstPROGRAMS:
|
3855 | |
- @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
|
3856 | |
- echo " rm -f" $$list; \
|
3857 | |
- rm -f $$list || exit $$?; \
|
3858 | |
- test -n "$(EXEEXT)" || exit 0; \
|
3859 | |
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
3860 | |
- echo " rm -f" $$list; \
|
3861 | |
- rm -f $$list
|
3862 | |
-gsd-input-sources-switcher$(EXEEXT): $(gsd_input_sources_switcher_OBJECTS) $(gsd_input_sources_switcher_DEPENDENCIES) $(EXTRA_gsd_input_sources_switcher_DEPENDENCIES)
|
3863 | |
- @rm -f gsd-input-sources-switcher$(EXEEXT)
|
3864 | |
- $(AM_V_CCLD)$(gsd_input_sources_switcher_LINK) $(gsd_input_sources_switcher_OBJECTS) $(gsd_input_sources_switcher_LDADD) $(LIBS)
|
3865 | |
-gsd-test-keyboard$(EXEEXT): $(gsd_test_keyboard_OBJECTS) $(gsd_test_keyboard_DEPENDENCIES) $(EXTRA_gsd_test_keyboard_DEPENDENCIES)
|
3866 | |
- @rm -f gsd-test-keyboard$(EXEEXT)
|
3867 | |
- $(AM_V_CCLD)$(gsd_test_keyboard_LINK) $(gsd_test_keyboard_OBJECTS) $(gsd_test_keyboard_LDADD) $(LIBS)
|
3868 | |
-test-keyboard-ibus-utils$(EXEEXT): $(test_keyboard_ibus_utils_OBJECTS) $(test_keyboard_ibus_utils_DEPENDENCIES) $(EXTRA_test_keyboard_ibus_utils_DEPENDENCIES)
|
3869 | |
- @rm -f test-keyboard-ibus-utils$(EXEEXT)
|
3870 | |
- $(AM_V_CCLD)$(test_keyboard_ibus_utils_LINK) $(test_keyboard_ibus_utils_OBJECTS) $(test_keyboard_ibus_utils_LDADD) $(LIBS)
|
3871 | |
|
3872 | |
mostlyclean-compile:
|
3873 | |
-rm -f *.$(OBJEXT)
|
3874 | |
@@ -661,12 +476,10 @@
|
3875 | |
distclean-compile:
|
3876 | |
-rm -f *.tab.c
|
3877 | |
|
3878 | |
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsd_input_sources_switcher-gsd-input-sources-switcher.Po@am__quote@
|
3879 | |
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsd_test_keyboard-gsd-keyboard-manager.Po@am__quote@
|
3880 | |
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsd_test_keyboard-test-keyboard.Po@am__quote@
|
3881 | |
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkeyboard_la-delayed-dialog.Plo@am__quote@
|
3882 | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkeyboard_la-gsd-keyboard-manager.Plo@am__quote@
|
3883 | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkeyboard_la-gsd-keyboard-plugin.Plo@am__quote@
|
3884 | |
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_keyboard_ibus_utils-test-keyboard-ibus-utils.Po@am__quote@
|
3885 | |
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkeyboard_la-gsd-keyboard-xkb.Plo@am__quote@
|
3886 | |
|
3887 | |
.c.o:
|
3888 | |
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
3889 | |
@@ -703,61 +516,19 @@
|
3890 | |
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
3891 | |
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkeyboard_la_CPPFLAGS) $(CPPFLAGS) $(libkeyboard_la_CFLAGS) $(CFLAGS) -c -o libkeyboard_la-gsd-keyboard-manager.lo `test -f 'gsd-keyboard-manager.c' || echo '$(srcdir)/'`gsd-keyboard-manager.c
|
3892 | |
|
3893 | |
-gsd_input_sources_switcher-gsd-input-sources-switcher.o: gsd-input-sources-switcher.c
|
3894 | |
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gsd_input_sources_switcher_CPPFLAGS) $(CPPFLAGS) $(gsd_input_sources_switcher_CFLAGS) $(CFLAGS) -MT gsd_input_sources_switcher-gsd-input-sources-switcher.o -MD -MP -MF $(DEPDIR)/gsd_input_sources_switcher-gsd-input-sources-switcher.Tpo -c -o gsd_input_sources_switcher-gsd-input-sources-switcher.o `test -f 'gsd-input-sources-switcher.c' || echo '$(srcdir)/'`gsd-input-sources-switcher.c
|
3895 | |
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsd_input_sources_switcher-gsd-input-sources-switcher.Tpo $(DEPDIR)/gsd_input_sources_switcher-gsd-input-sources-switcher.Po
|
3896 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsd-input-sources-switcher.c' object='gsd_input_sources_switcher-gsd-input-sources-switcher.o' libtool=no @AMDEPBACKSLASH@
|
3897 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
3898 | |
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gsd_input_sources_switcher_CPPFLAGS) $(CPPFLAGS) $(gsd_input_sources_switcher_CFLAGS) $(CFLAGS) -c -o gsd_input_sources_switcher-gsd-input-sources-switcher.o `test -f 'gsd-input-sources-switcher.c' || echo '$(srcdir)/'`gsd-input-sources-switcher.c
|
3899 | |
-
|
3900 | |
-gsd_input_sources_switcher-gsd-input-sources-switcher.obj: gsd-input-sources-switcher.c
|
3901 | |
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gsd_input_sources_switcher_CPPFLAGS) $(CPPFLAGS) $(gsd_input_sources_switcher_CFLAGS) $(CFLAGS) -MT gsd_input_sources_switcher-gsd-input-sources-switcher.obj -MD -MP -MF $(DEPDIR)/gsd_input_sources_switcher-gsd-input-sources-switcher.Tpo -c -o gsd_input_sources_switcher-gsd-input-sources-switcher.obj `if test -f 'gsd-input-sources-switcher.c'; then $(CYGPATH_W) 'gsd-input-sources-switcher.c'; else $(CYGPATH_W) '$(srcdir)/gsd-input-sources-switcher.c'; fi`
|
3902 | |
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsd_input_sources_switcher-gsd-input-sources-switcher.Tpo $(DEPDIR)/gsd_input_sources_switcher-gsd-input-sources-switcher.Po
|
3903 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsd-input-sources-switcher.c' object='gsd_input_sources_switcher-gsd-input-sources-switcher.obj' libtool=no @AMDEPBACKSLASH@
|
3904 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
3905 | |
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gsd_input_sources_switcher_CPPFLAGS) $(CPPFLAGS) $(gsd_input_sources_switcher_CFLAGS) $(CFLAGS) -c -o gsd_input_sources_switcher-gsd-input-sources-switcher.obj `if test -f 'gsd-input-sources-switcher.c'; then $(CYGPATH_W) 'gsd-input-sources-switcher.c'; else $(CYGPATH_W) '$(srcdir)/gsd-input-sources-switcher.c'; fi`
|
3906 | |
-
|
3907 | |
-gsd_test_keyboard-test-keyboard.o: test-keyboard.c
|
3908 | |
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gsd_test_keyboard_CPPFLAGS) $(CPPFLAGS) $(gsd_test_keyboard_CFLAGS) $(CFLAGS) -MT gsd_test_keyboard-test-keyboard.o -MD -MP -MF $(DEPDIR)/gsd_test_keyboard-test-keyboard.Tpo -c -o gsd_test_keyboard-test-keyboard.o `test -f 'test-keyboard.c' || echo '$(srcdir)/'`test-keyboard.c
|
3909 | |
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsd_test_keyboard-test-keyboard.Tpo $(DEPDIR)/gsd_test_keyboard-test-keyboard.Po
|
3910 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-keyboard.c' object='gsd_test_keyboard-test-keyboard.o' libtool=no @AMDEPBACKSLASH@
|
3911 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
3912 | |
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gsd_test_keyboard_CPPFLAGS) $(CPPFLAGS) $(gsd_test_keyboard_CFLAGS) $(CFLAGS) -c -o gsd_test_keyboard-test-keyboard.o `test -f 'test-keyboard.c' || echo '$(srcdir)/'`test-keyboard.c
|
3913 | |
-
|
3914 | |
-gsd_test_keyboard-test-keyboard.obj: test-keyboard.c
|
3915 | |
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gsd_test_keyboard_CPPFLAGS) $(CPPFLAGS) $(gsd_test_keyboard_CFLAGS) $(CFLAGS) -MT gsd_test_keyboard-test-keyboard.obj -MD -MP -MF $(DEPDIR)/gsd_test_keyboard-test-keyboard.Tpo -c -o gsd_test_keyboard-test-keyboard.obj `if test -f 'test-keyboard.c'; then $(CYGPATH_W) 'test-keyboard.c'; else $(CYGPATH_W) '$(srcdir)/test-keyboard.c'; fi`
|
3916 | |
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsd_test_keyboard-test-keyboard.Tpo $(DEPDIR)/gsd_test_keyboard-test-keyboard.Po
|
3917 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-keyboard.c' object='gsd_test_keyboard-test-keyboard.obj' libtool=no @AMDEPBACKSLASH@
|
3918 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
3919 | |
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gsd_test_keyboard_CPPFLAGS) $(CPPFLAGS) $(gsd_test_keyboard_CFLAGS) $(CFLAGS) -c -o gsd_test_keyboard-test-keyboard.obj `if test -f 'test-keyboard.c'; then $(CYGPATH_W) 'test-keyboard.c'; else $(CYGPATH_W) '$(srcdir)/test-keyboard.c'; fi`
|
3920 | |
-
|
3921 | |
-gsd_test_keyboard-gsd-keyboard-manager.o: gsd-keyboard-manager.c
|
3922 | |
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gsd_test_keyboard_CPPFLAGS) $(CPPFLAGS) $(gsd_test_keyboard_CFLAGS) $(CFLAGS) -MT gsd_test_keyboard-gsd-keyboard-manager.o -MD -MP -MF $(DEPDIR)/gsd_test_keyboard-gsd-keyboard-manager.Tpo -c -o gsd_test_keyboard-gsd-keyboard-manager.o `test -f 'gsd-keyboard-manager.c' || echo '$(srcdir)/'`gsd-keyboard-manager.c
|
3923 | |
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsd_test_keyboard-gsd-keyboard-manager.Tpo $(DEPDIR)/gsd_test_keyboard-gsd-keyboard-manager.Po
|
3924 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsd-keyboard-manager.c' object='gsd_test_keyboard-gsd-keyboard-manager.o' libtool=no @AMDEPBACKSLASH@
|
3925 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
3926 | |
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gsd_test_keyboard_CPPFLAGS) $(CPPFLAGS) $(gsd_test_keyboard_CFLAGS) $(CFLAGS) -c -o gsd_test_keyboard-gsd-keyboard-manager.o `test -f 'gsd-keyboard-manager.c' || echo '$(srcdir)/'`gsd-keyboard-manager.c
|
3927 | |
-
|
3928 | |
-gsd_test_keyboard-gsd-keyboard-manager.obj: gsd-keyboard-manager.c
|
3929 | |
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gsd_test_keyboard_CPPFLAGS) $(CPPFLAGS) $(gsd_test_keyboard_CFLAGS) $(CFLAGS) -MT gsd_test_keyboard-gsd-keyboard-manager.obj -MD -MP -MF $(DEPDIR)/gsd_test_keyboard-gsd-keyboard-manager.Tpo -c -o gsd_test_keyboard-gsd-keyboard-manager.obj `if test -f 'gsd-keyboard-manager.c'; then $(CYGPATH_W) 'gsd-keyboard-manager.c'; else $(CYGPATH_W) '$(srcdir)/gsd-keyboard-manager.c'; fi`
|
3930 | |
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/gsd_test_keyboard-gsd-keyboard-manager.Tpo $(DEPDIR)/gsd_test_keyboard-gsd-keyboard-manager.Po
|
3931 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsd-keyboard-manager.c' object='gsd_test_keyboard-gsd-keyboard-manager.obj' libtool=no @AMDEPBACKSLASH@
|
3932 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
3933 | |
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gsd_test_keyboard_CPPFLAGS) $(CPPFLAGS) $(gsd_test_keyboard_CFLAGS) $(CFLAGS) -c -o gsd_test_keyboard-gsd-keyboard-manager.obj `if test -f 'gsd-keyboard-manager.c'; then $(CYGPATH_W) 'gsd-keyboard-manager.c'; else $(CYGPATH_W) '$(srcdir)/gsd-keyboard-manager.c'; fi`
|
3934 | |
-
|
3935 | |
-test_keyboard_ibus_utils-test-keyboard-ibus-utils.o: test-keyboard-ibus-utils.c
|
3936 | |
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_keyboard_ibus_utils_CPPFLAGS) $(CPPFLAGS) $(test_keyboard_ibus_utils_CFLAGS) $(CFLAGS) -MT test_keyboard_ibus_utils-test-keyboard-ibus-utils.o -MD -MP -MF $(DEPDIR)/test_keyboard_ibus_utils-test-keyboard-ibus-utils.Tpo -c -o test_keyboard_ibus_utils-test-keyboard-ibus-utils.o `test -f 'test-keyboard-ibus-utils.c' || echo '$(srcdir)/'`test-keyboard-ibus-utils.c
|
3937 | |
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyboard_ibus_utils-test-keyboard-ibus-utils.Tpo $(DEPDIR)/test_keyboard_ibus_utils-test-keyboard-ibus-utils.Po
|
3938 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-keyboard-ibus-utils.c' object='test_keyboard_ibus_utils-test-keyboard-ibus-utils.o' libtool=no @AMDEPBACKSLASH@
|
3939 | |
+libkeyboard_la-gsd-keyboard-xkb.lo: gsd-keyboard-xkb.c
|
3940 | |
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkeyboard_la_CPPFLAGS) $(CPPFLAGS) $(libkeyboard_la_CFLAGS) $(CFLAGS) -MT libkeyboard_la-gsd-keyboard-xkb.lo -MD -MP -MF $(DEPDIR)/libkeyboard_la-gsd-keyboard-xkb.Tpo -c -o libkeyboard_la-gsd-keyboard-xkb.lo `test -f 'gsd-keyboard-xkb.c' || echo '$(srcdir)/'`gsd-keyboard-xkb.c
|
3941 | |
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkeyboard_la-gsd-keyboard-xkb.Tpo $(DEPDIR)/libkeyboard_la-gsd-keyboard-xkb.Plo
|
3942 | |
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gsd-keyboard-xkb.c' object='libkeyboard_la-gsd-keyboard-xkb.lo' libtool=yes @AMDEPBACKSLASH@
|
3943 | |
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
3944 | |
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkeyboard_la_CPPFLAGS) $(CPPFLAGS) $(libkeyboard_la_CFLAGS) $(CFLAGS) -c -o libkeyboard_la-gsd-keyboard-xkb.lo `test -f 'gsd-keyboard-xkb.c' || echo '$(srcdir)/'`gsd-keyboard-xkb.c
|
3945 | |
+
|
3946 | |
+libkeyboard_la-delayed-dialog.lo: delayed-dialog.c
|
3947 | |
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkeyboard_la_CPPFLAGS) $(CPPFLAGS) $(libkeyboard_la_CFLAGS) $(CFLAGS) -MT libkeyboard_la-delayed-dialog.lo -MD -MP -MF $(DEPDIR)/libkeyboard_la-delayed-dialog.Tpo -c -o libkeyboard_la-delayed-dialog.lo `test -f 'delayed-dialog.c' || echo '$(srcdir)/'`delayed-dialog.c
|
3948 | |
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libkeyboard_la-delayed-dialog.Tpo $(DEPDIR)/libkeyboard_la-delayed-dialog.Plo
|
3949 | |
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='delayed-dialog.c' object='libkeyboard_la-delayed-dialog.lo' libtool=yes @AMDEPBACKSLASH@
|
3950 | |
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
3951 | |
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_keyboard_ibus_utils_CPPFLAGS) $(CPPFLAGS) $(test_keyboard_ibus_utils_CFLAGS) $(CFLAGS) -c -o test_keyboard_ibus_utils-test-keyboard-ibus-utils.o `test -f 'test-keyboard-ibus-utils.c' || echo '$(srcdir)/'`test-keyboard-ibus-utils.c
|
3952 | |
-
|
3953 | |
-test_keyboard_ibus_utils-test-keyboard-ibus-utils.obj: test-keyboard-ibus-utils.c
|
3954 | |
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_keyboard_ibus_utils_CPPFLAGS) $(CPPFLAGS) $(test_keyboard_ibus_utils_CFLAGS) $(CFLAGS) -MT test_keyboard_ibus_utils-test-keyboard-ibus-utils.obj -MD -MP -MF $(DEPDIR)/test_keyboard_ibus_utils-test-keyboard-ibus-utils.Tpo -c -o test_keyboard_ibus_utils-test-keyboard-ibus-utils.obj `if test -f 'test-keyboard-ibus-utils.c'; then $(CYGPATH_W) 'test-keyboard-ibus-utils.c'; else $(CYGPATH_W) '$(srcdir)/test-keyboard-ibus-utils.c'; fi`
|
3955 | |
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyboard_ibus_utils-test-keyboard-ibus-utils.Tpo $(DEPDIR)/test_keyboard_ibus_utils-test-keyboard-ibus-utils.Po
|
3956 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-keyboard-ibus-utils.c' object='test_keyboard_ibus_utils-test-keyboard-ibus-utils.obj' libtool=no @AMDEPBACKSLASH@
|
3957 | |
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
3958 | |
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_keyboard_ibus_utils_CPPFLAGS) $(CPPFLAGS) $(test_keyboard_ibus_utils_CFLAGS) $(CFLAGS) -c -o test_keyboard_ibus_utils-test-keyboard-ibus-utils.obj `if test -f 'test-keyboard-ibus-utils.c'; then $(CYGPATH_W) 'test-keyboard-ibus-utils.c'; else $(CYGPATH_W) '$(srcdir)/test-keyboard-ibus-utils.c'; fi`
|
3959 | |
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkeyboard_la_CPPFLAGS) $(CPPFLAGS) $(libkeyboard_la_CFLAGS) $(CFLAGS) -c -o libkeyboard_la-delayed-dialog.lo `test -f 'delayed-dialog.c' || echo '$(srcdir)/'`delayed-dialog.c
|
3960 | |
|
3961 | |
mostlyclean-libtool:
|
3962 | |
-rm -f *.lo
|
3963 | |
@@ -766,11 +537,8 @@
|
3964 | |
-rm -rf .libs _libs
|
3965 | |
install-iconsDATA: $(icons_DATA)
|
3966 | |
@$(NORMAL_INSTALL)
|
3967 | |
+ test -z "$(iconsdir)" || $(MKDIR_P) "$(DESTDIR)$(iconsdir)"
|
3968 | |
@list='$(icons_DATA)'; test -n "$(iconsdir)" || list=; \
|
3969 | |
- if test -n "$$list"; then \
|
3970 | |
- echo " $(MKDIR_P) '$(DESTDIR)$(iconsdir)'"; \
|
3971 | |
- $(MKDIR_P) "$(DESTDIR)$(iconsdir)" || exit 1; \
|
3972 | |
- fi; \
|
3973 | |
for p in $$list; do \
|
3974 | |
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
3975 | |
echo "$$d$$p"; \
|
3976 | |
@@ -787,11 +555,8 @@
|
3977 | |
dir='$(DESTDIR)$(iconsdir)'; $(am__uninstall_files_from_dir)
|
3978 | |
install-pluginDATA: $(plugin_DATA)
|
3979 | |
@$(NORMAL_INSTALL)
|
3980 | |
+ test -z "$(plugindir)" || $(MKDIR_P) "$(DESTDIR)$(plugindir)"
|
3981 | |
@list='$(plugin_DATA)'; test -n "$(plugindir)" || list=; \
|
3982 | |
- if test -n "$$list"; then \
|
3983 | |
- echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \
|
3984 | |
- $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \
|
3985 | |
- fi; \
|
3986 | |
for p in $$list; do \
|
3987 | |
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
3988 | |
echo "$$d$$p"; \
|
3989 | |
@@ -856,20 +621,6 @@
|
3990 | |
&& $(am__cd) $(top_srcdir) \
|
3991 | |
&& gtags -i $(GTAGS_ARGS) "$$here"
|
3992 | |
|
3993 | |
-cscopelist: $(HEADERS) $(SOURCES) $(LISP)
|
3994 | |
- list='$(SOURCES) $(HEADERS) $(LISP)'; \
|
3995 | |
- case "$(srcdir)" in \
|
3996 | |
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
3997 | |
- *) sdir=$(subdir)/$(srcdir) ;; \
|
3998 | |
- esac; \
|
3999 | |
- for i in $$list; do \
|
4000 | |
- if test -f "$$i"; then \
|
4001 | |
- echo "$(subdir)/$$i"; \
|
4002 | |
- else \
|
4003 | |
- echo "$$sdir/$$i"; \
|
4004 | |
- fi; \
|
4005 | |
- done >> $(top_builddir)/cscope.files
|
4006 | |
-
|
4007 | |
distclean-tags:
|
4008 | |
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
4009 | |
|
4010 | |
@@ -903,13 +654,11 @@
|
4011 | |
|| exit 1; \
|
4012 | |
fi; \
|
4013 | |
done
|
4014 | |
-@HAVE_IBUS_FALSE@check-local:
|
4015 | |
check-am: all-am
|
4016 | |
- $(MAKE) $(AM_MAKEFLAGS) check-local
|
4017 | |
check: check-am
|
4018 | |
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA)
|
4019 | |
+all-am: Makefile $(LTLIBRARIES) $(DATA)
|
4020 | |
installdirs:
|
4021 | |
- for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(iconsdir)" "$(DESTDIR)$(plugindir)"; do \
|
4022 | |
+ for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(iconsdir)" "$(DESTDIR)$(plugindir)"; do \
|
4023 | |
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
4024 | |
done
|
4025 | |
install: install-am
|
4026 | |
@@ -946,8 +695,8 @@
|
4027 | |
@echo "it deletes files that may require special tools to rebuild."
|
4028 | |
clean: clean-am
|
4029 | |
|
4030 | |
-clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \
|
4031 | |
- clean-noinstPROGRAMS clean-pluginLTLIBRARIES mostlyclean-am
|
4032 | |
+clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \
|
4033 | |
+ mostlyclean-am
|
4034 | |
|
4035 | |
distclean: distclean-am
|
4036 | |
-rm -rf ./$(DEPDIR)
|
4037 | |
@@ -974,7 +723,7 @@
|
4038 | |
|
4039 | |
install-dvi-am:
|
4040 | |
|
4041 | |
-install-exec-am: install-libexecPROGRAMS
|
4042 | |
+install-exec-am:
|
4043 | |
|
4044 | |
install-html: install-html-am
|
4045 | |
|
4046 | |
@@ -1014,32 +763,27 @@
|
4047 | |
|
4048 | |
ps-am:
|
4049 | |
|
4050 | |
-uninstall-am: uninstall-iconsDATA uninstall-libexecPROGRAMS \
|
4051 | |
- uninstall-pluginDATA uninstall-pluginLTLIBRARIES
|
4052 | |
+uninstall-am: uninstall-iconsDATA uninstall-pluginDATA \
|
4053 | |
+ uninstall-pluginLTLIBRARIES
|
4054 | |
|
4055 | |
-.MAKE: check-am install-am install-strip
|
4056 | |
+.MAKE: install-am install-strip
|
4057 | |
|
4058 | |
-.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
|
4059 | |
- clean-generic clean-libexecPROGRAMS clean-libtool \
|
4060 | |
- clean-noinstPROGRAMS clean-pluginLTLIBRARIES cscopelist ctags \
|
4061 | |
- distclean distclean-compile distclean-generic \
|
4062 | |
- distclean-libtool distclean-tags distdir dvi dvi-am html \
|
4063 | |
- html-am info info-am install install-am install-data \
|
4064 | |
- install-data-am install-dvi install-dvi-am install-exec \
|
4065 | |
- install-exec-am install-html install-html-am install-iconsDATA \
|
4066 | |
- install-info install-info-am install-libexecPROGRAMS \
|
4067 | |
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
4068 | |
+ clean-libtool clean-pluginLTLIBRARIES ctags distclean \
|
4069 | |
+ distclean-compile distclean-generic distclean-libtool \
|
4070 | |
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
|
4071 | |
+ install install-am install-data install-data-am install-dvi \
|
4072 | |
+ install-dvi-am install-exec install-exec-am install-html \
|
4073 | |
+ install-html-am install-iconsDATA install-info install-info-am \
|
4074 | |
install-man install-pdf install-pdf-am install-pluginDATA \
|
4075 | |
install-pluginLTLIBRARIES install-ps install-ps-am \
|
4076 | |
install-strip installcheck installcheck-am installdirs \
|
4077 | |
maintainer-clean maintainer-clean-generic mostlyclean \
|
4078 | |
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
4079 | |
pdf pdf-am ps ps-am tags uninstall uninstall-am \
|
4080 | |
- uninstall-iconsDATA uninstall-libexecPROGRAMS \
|
4081 | |
- uninstall-pluginDATA uninstall-pluginLTLIBRARIES
|
4082 | |
-
|
4083 | |
+ uninstall-iconsDATA uninstall-pluginDATA \
|
4084 | |
+ uninstall-pluginLTLIBRARIES
|
4085 | |
|
4086 | |
-@HAVE_IBUS_TRUE@check-local: test-keyboard-ibus-utils
|
4087 | |
-@HAVE_IBUS_TRUE@ $(builddir)/test-keyboard-ibus-utils > /dev/null
|
4088 | |
|
4089 | |
@GSD_INTLTOOL_PLUGIN_RULE@
|
4090 | |
|
4091 | |
Index: gnome-settings-daemon-3.6.4/plugins/keyboard/test-keyboard.c
|
4092 | |
===================================================================
|
4093 | |
--- gnome-settings-daemon-3.6.4.orig/plugins/keyboard/test-keyboard.c 2013-04-17 17:52:29.768040154 +0200
|
4094 | |
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
|
4095 | |
@@ -1,7 +0,0 @@
|
4096 | |
-#define NEW gsd_keyboard_manager_new
|
4097 | |
-#define START gsd_keyboard_manager_start
|
4098 | |
-#define STOP gsd_keyboard_manager_stop
|
4099 | |
-#define MANAGER GsdKeyboardManager
|
4100 | |
-#include "gsd-keyboard-manager.h"
|
4101 | |
-
|
4102 | |
-#include "test-plugin.h"
|
4103 | |
Index: gnome-settings-daemon-3.6.4/plugins/keyboard/test-keyboard-ibus-utils.c
|
4104 | |
===================================================================
|
4105 | |
--- gnome-settings-daemon-3.6.4.orig/plugins/keyboard/test-keyboard-ibus-utils.c 2013-04-17 17:52:29.768040154 +0200
|
4106 | |
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
|
4107 | |
@@ -1,116 +0,0 @@
|
4108 | |
-#include "gsd-keyboard-manager.c"
|
4109 | |
-
|
4110 | |
-static void
|
4111 | |
-test_make_xkb_source_id (void)
|
4112 | |
-{
|
4113 | |
- gint i;
|
4114 | |
- const gchar *test_strings[][2] = {
|
4115 | |
- /* input output */
|
4116 | |
- { "xkb:aa:bb:cc", "aa+bb" },
|
4117 | |
- { "xkb:aa:bb:", "aa+bb" },
|
4118 | |
- { "xkb:aa::cc", "aa" },
|
4119 | |
- { "xkb:aa::", "aa" },
|
4120 | |
- { "xkb::bb:cc", "+bb" },
|
4121 | |
- { "xkb::bb:", "+bb" },
|
4122 | |
- { "xkb:::cc", "" },
|
4123 | |
- { "xkb:::", "" },
|
4124 | |
- };
|
4125 | |
-
|
4126 | |
- for (i = 0; i < G_N_ELEMENTS (test_strings); ++i)
|
4127 | |
- g_assert_cmpstr (make_xkb_source_id (test_strings[i][0]), ==, test_strings[i][1]);
|
4128 | |
-}
|
4129 | |
-
|
4130 | |
-static void
|
4131 | |
-test_layout_from_ibus_layout (void)
|
4132 | |
-{
|
4133 | |
- gint i;
|
4134 | |
- const gchar *test_strings[][2] = {
|
4135 | |
- /* input output */
|
4136 | |
- { "", "" },
|
4137 | |
- { "a", "a" },
|
4138 | |
- { "a(", "a" },
|
4139 | |
- { "a[", "a" },
|
4140 | |
- };
|
4141 | |
-
|
4142 | |
- for (i = 0; i < G_N_ELEMENTS (test_strings); ++i)
|
4143 | |
- g_assert_cmpstr (layout_from_ibus_layout (test_strings[i][0]), ==, test_strings[i][1]);
|
4144 | |
-}
|
4145 | |
-
|
4146 | |
-static void
|
4147 | |
-test_variant_from_ibus_layout (void)
|
4148 | |
-{
|
4149 | |
- gint i;
|
4150 | |
- const gchar *test_strings[][2] = {
|
4151 | |
- /* input output */
|
4152 | |
- { "", NULL },
|
4153 | |
- { "a", NULL },
|
4154 | |
- { "(", NULL },
|
4155 | |
- { "()", "" },
|
4156 | |
- { "(b)", "b" },
|
4157 | |
- { "a(", NULL },
|
4158 | |
- { "a()", "" },
|
4159 | |
- { "a(b)", "b" },
|
4160 | |
- };
|
4161 | |
-
|
4162 | |
- for (i = 0; i < G_N_ELEMENTS (test_strings); ++i)
|
4163 | |
- g_assert_cmpstr (variant_from_ibus_layout (test_strings[i][0]), ==, test_strings[i][1]);
|
4164 | |
-}
|
4165 | |
-
|
4166 | |
-static void
|
4167 | |
-test_options_from_ibus_layout (void)
|
4168 | |
-{
|
4169 | |
- gint i, j;
|
4170 | |
- gchar *output_0[] = {
|
4171 | |
- NULL
|
4172 | |
- };
|
4173 | |
- gchar *output_1[] = {
|
4174 | |
- "",
|
4175 | |
- NULL
|
4176 | |
- };
|
4177 | |
- gchar *output_2[] = {
|
4178 | |
- "b",
|
4179 | |
- NULL
|
4180 | |
- };
|
4181 | |
- gchar *output_3[] = {
|
4182 | |
- "b", "",
|
4183 | |
- NULL
|
4184 | |
- };
|
4185 | |
- gchar *output_4[] = {
|
4186 | |
- "b", "c",
|
4187 | |
- NULL
|
4188 | |
- };
|
4189 | |
- const gpointer tests[][2] = {
|
4190 | |
- /* input output */
|
4191 | |
- { "", NULL },
|
4192 | |
- { "a", NULL },
|
4193 | |
- { "a[", output_0 },
|
4194 | |
- { "a[]", output_1 },
|
4195 | |
- { "a[b]", output_2 },
|
4196 | |
- { "a[b,]", output_3 },
|
4197 | |
- { "a[b,c]", output_4 },
|
4198 | |
- };
|
4199 | |
-
|
4200 | |
- for (i = 0; i < G_N_ELEMENTS (tests); ++i) {
|
4201 | |
- if (tests[i][1] == NULL) {
|
4202 | |
- g_assert (options_from_ibus_layout (tests[i][0]) == NULL);
|
4203 | |
- } else {
|
4204 | |
- gchar **strv_a = options_from_ibus_layout (tests[i][0]);
|
4205 | |
- gchar **strv_b = tests[i][1];
|
4206 | |
-
|
4207 | |
- g_assert (g_strv_length (strv_a) == g_strv_length (strv_b));
|
4208 | |
- for (j = 0; j < g_strv_length (strv_a); ++j)
|
4209 | |
- g_assert_cmpstr (strv_a[j], ==, strv_b[j]);
|
4210 | |
- }
|
4211 | |
- }
|
4212 | |
-}
|
4213 | |
-
|
4214 | |
-int
|
4215 | |
-main (void)
|
4216 | |
-{
|
4217 | |
- test_make_xkb_source_id ();
|
4218 | |
- test_layout_from_ibus_layout ();
|
4219 | |
- test_variant_from_ibus_layout ();
|
4220 | |
- test_options_from_ibus_layout ();
|
4221 | |
-
|
4222 | |
- return 0;
|
4223 | |
-}
|
4224 | |
Index: gnome-settings-daemon-3.6.4/plugins/media-keys/gsd-media-keys-manager.c
|
4225 | |
===================================================================
|
4226 | |
--- gnome-settings-daemon-3.6.4.orig/plugins/media-keys/gsd-media-keys-manager.c 2013-04-17 17:52:29.768040154 +0200
|
4227 | |
+++ gnome-settings-daemon-3.6.4/plugins/media-keys/gsd-media-keys-manager.c 2013-04-17 17:52:29.764040154 +0200
|
4228 | |
@@ -103,10 +103,6 @@
|
4229 | |
#define VOLUME_STEP 6 /* percents for one volume button press */
|
4230 | |
#define MAX_VOLUME 65536.0
|
4231 | |
|
4232 | |
-#define GNOME_DESKTOP_INPUT_SOURCES_DIR "org.gnome.desktop.input-sources"
|
4233 | |
-#define KEY_CURRENT_INPUT_SOURCE "current"
|
4234 | |
-#define KEY_INPUT_SOURCES "sources"
|
4235 | |
-
|
4236 | |
#define GSD_MEDIA_KEYS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_MEDIA_KEYS_MANAGER, GsdMediaKeysManagerPrivate))
|
4237 | |
|
4238 | |
typedef struct {
|
4239 | |
@@ -1990,40 +1986,6 @@
|
4240 | |
}
|
4241 | |
|
4242 | |
static void
|
4243 | |
-do_switch_input_source_action (GsdMediaKeysManager *manager,
|
4244 | |
- MediaKeyType type)
|
4245 | |
-{
|
4246 | |
- GSettings *settings;
|
4247 | |
- GVariant *sources;
|
4248 | |
- gint i, n;
|
4249 | |
-
|
4250 | |
- settings = g_settings_new (GNOME_DESKTOP_INPUT_SOURCES_DIR);
|
4251 | |
- sources = g_settings_get_value (settings, KEY_INPUT_SOURCES);
|
4252 | |
-
|
4253 | |
- n = g_variant_n_children (sources);
|
4254 | |
- if (n < 2)
|
4255 | |
- goto out;
|
4256 | |
-
|
4257 | |
- i = g_settings_get_uint (settings, KEY_CURRENT_INPUT_SOURCE);
|
4258 | |
-
|
4259 | |
- if (type == SWITCH_INPUT_SOURCE_KEY)
|
4260 | |
- i += 1;
|
4261 | |
- else
|
4262 | |
- i -= 1;
|
4263 | |
-
|
4264 | |
- if (i < 0)
|
4265 | |
- i = n - 1;
|
4266 | |
- else if (i >= n)
|
4267 | |
- i = 0;
|
4268 | |
-
|
4269 | |
- g_settings_set_uint (settings, KEY_CURRENT_INPUT_SOURCE, i);
|
4270 | |
-
|
4271 | |
- out:
|
4272 | |
- g_variant_unref (sources);
|
4273 | |
- g_object_unref (settings);
|
4274 | |
-}
|
4275 | |
-
|
4276 | |
-static void
|
4277 | |
do_custom_action (GsdMediaKeysManager *manager,
|
4278 | |
MediaKey *key,
|
4279 | |
gint64 timestamp)
|
4280 | |
@@ -2189,10 +2151,6 @@
|
4281 | |
case BATTERY_KEY:
|
4282 | |
do_execute_desktop (manager, "gnome-power-statistics.desktop", timestamp);
|
4283 | |
break;
|
4284 | |
- case SWITCH_INPUT_SOURCE_KEY:
|
4285 | |
- case SWITCH_INPUT_SOURCE_BACKWARD_KEY:
|
4286 | |
- do_switch_input_source_action (manager, type);
|
4287 | |
- break;
|
4288 | |
/* Note, no default so compiler catches missing keys */
|
4289 | |
case CUSTOM_KEY:
|
4290 | |
g_assert_not_reached ();
|
4291 | |
Index: gnome-settings-daemon-3.6.4/plugins/media-keys/shortcuts-list.h
|
4292 | |
===================================================================
|
4293 | |
--- gnome-settings-daemon-3.6.4.orig/plugins/media-keys/shortcuts-list.h 2013-04-17 17:52:29.768040154 +0200
|
4294 | |
+++ gnome-settings-daemon-3.6.4/plugins/media-keys/shortcuts-list.h 2013-04-17 17:52:29.764040154 +0200
|
4295 | |
@@ -81,8 +81,6 @@
|
4296 | |
KEYBOARD_BRIGHTNESS_DOWN_KEY,
|
4297 | |
KEYBOARD_BRIGHTNESS_TOGGLE_KEY,
|
4298 | |
BATTERY_KEY,
|
4299 | |
- SWITCH_INPUT_SOURCE_KEY,
|
4300 | |
- SWITCH_INPUT_SOURCE_BACKWARD_KEY,
|
4301 | |
CUSTOM_KEY
|
4302 | |
} MediaKeyType;
|
4303 | |
|
4304 | |
@@ -150,8 +148,6 @@
|
4305 | |
{ KEYBOARD_BRIGHTNESS_UP_KEY, NULL, "XF86KbdBrightnessUp" },
|
4306 | |
{ KEYBOARD_BRIGHTNESS_DOWN_KEY, NULL, "XF86KbdBrightnessDown" },
|
4307 | |
{ KEYBOARD_BRIGHTNESS_TOGGLE_KEY, NULL, "XF86KbdLightOnOff" },
|
4308 | |
- { SWITCH_INPUT_SOURCE_KEY, "switch-input-source", NULL },
|
4309 | |
- { SWITCH_INPUT_SOURCE_BACKWARD_KEY, "switch-input-source-backward", NULL },
|
4310 | |
{ BATTERY_KEY, NULL, "XF86Battery" },
|
4311 | |
};
|
4312 | |
|
4313 | |
Index: gnome-settings-daemon-3.6.4/po/POTFILES.in
|
4314 | |
===================================================================
|
4315 | |
--- gnome-settings-daemon-3.6.4.orig/po/POTFILES.in 2013-01-10 14:37:58.000000000 +0100
|
4316 | |
+++ gnome-settings-daemon-3.6.4/po/POTFILES.in 2013-04-17 17:53:04.860041210 +0200
|
4317 | |
@@ -31,6 +31,7 @@
|
4318 | |
plugins/housekeeping/gsd-disk-space.c
|
4319 | |
plugins/housekeeping/gsd-ldsm-dialog.c
|
4320 | |
plugins/keyboard/gsd-keyboard-manager.c
|
4321 | |
+plugins/keyboard/gsd-keyboard-xkb.c
|
4322 | |
[type: gettext/ini]plugins/keyboard/keyboard.gnome-settings-plugin.in
|
4323 | |
plugins/media-keys/cut-n-paste/gvc-mixer-control.c
|
4324 | |
plugins/media-keys/gsd-media-keys-manager.c
|