summaryrefslogtreecommitdiff
path: root/plugins/media-keys
diff options
context:
space:
mode:
authorPerberos <[email protected]>2011-12-08 14:09:44 -0300
committerPerberos <[email protected]>2011-12-08 14:09:44 -0300
commit283de05cf3b8bed9dcde9e80875b860520de392a (patch)
tree0447d2c7e271ed05493794670fac0d6f05d0d475 /plugins/media-keys
parent81ea15d1ce166e69e7fff11c88e16c42d8db190d (diff)
downloadmate-settings-daemon-283de05cf3b8bed9dcde9e80875b860520de392a.tar.bz2
mate-settings-daemon-283de05cf3b8bed9dcde9e80875b860520de392a.tar.xz
GDK_DISPLAY() is deprecated
Diffstat (limited to 'plugins/media-keys')
-rw-r--r--plugins/media-keys/gsd-media-keys-manager.c93
1 files changed, 50 insertions, 43 deletions
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index ae6383a..ae7d3e2 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -327,60 +327,67 @@ update_kbd_cb (MateConfClient *client,
g_warning ("Grab failed for some keys, another application may already have access the them.");
}
-static void
-init_kbd (GsdMediaKeysManager *manager)
+static void init_kbd(GsdMediaKeysManager* manager)
{
- int i;
- gboolean need_flush = FALSE;
+ int i;
+ gboolean need_flush = FALSE;
- mate_settings_profile_start (NULL);
+ mate_settings_profile_start(NULL);
- gdk_error_trap_push ();
+ gdk_error_trap_push();
- for (i = 0; i < HANDLED_KEYS; i++) {
- char *tmp;
- Key *key;
-
- manager->priv->notify[i] =
- mateconf_client_notify_add (manager->priv->conf_client,
- keys[i].mateconf_key,
- (MateConfClientNotifyFunc) update_kbd_cb,
- manager,
- NULL,
- NULL);
-
- tmp = mateconf_client_get_string (manager->priv->conf_client,
- keys[i].mateconf_key,
- NULL);
+ for (i = 0; i < HANDLED_KEYS; i++)
+ {
+ char* tmp;
+ Key* key;
- if (!is_valid_shortcut (tmp)) {
- g_debug ("Not a valid shortcut: '%s'", tmp);
- g_free (tmp);
- continue;
- }
+ manager->priv->notify[i] = mateconf_client_notify_add(manager->priv->conf_client,
+ keys[i].mateconf_key,
+ (MateConfClientNotifyFunc) update_kbd_cb,
+ manager,
+ NULL,
+ NULL);
- key = g_new0 (Key, 1);
- if (!egg_accelerator_parse_virtual (tmp, &key->keysym, &key->keycodes, &key->state)) {
- g_debug ("Unable to parse: '%s'", tmp);
- g_free (tmp);
- g_free (key);
- continue;
- }
+ tmp = mateconf_client_get_string(manager->priv->conf_client,
+ keys[i].mateconf_key,
+ NULL);
- g_free (tmp);
+ if (!is_valid_shortcut(tmp))
+ {
+ g_debug("Not a valid shortcut: '%s'", tmp);
+ g_free(tmp);
+ continue;
+ }
- keys[i].key = key;
+ key = g_new0(Key, 1);
- need_flush = TRUE;
- grab_key_unsafe (key, TRUE, manager->priv->screens);
- }
+ if (!egg_accelerator_parse_virtual(tmp, &key->keysym, &key->keycodes, &key->state))
+ {
+ g_debug("Unable to parse: '%s'", tmp);
+ g_free(tmp);
+ g_free(key);
+ continue;
+ }
- if (need_flush)
- gdk_flush ();
- if (gdk_error_trap_pop ())
- g_warning ("Grab failed for some keys, another application may already have access the them.");
+ g_free(tmp);
- mate_settings_profile_end (NULL);
+ keys[i].key = key;
+
+ need_flush = TRUE;
+ grab_key_unsafe(key, TRUE, manager->priv->screens);
+ }
+
+ if (need_flush)
+ {
+ gdk_flush();
+ }
+
+ if (gdk_error_trap_pop ())
+ {
+ g_warning("Grab failed for some keys, another application may already have access the them.");
+ }
+
+ mate_settings_profile_end(NULL);
}
static void