summaryrefslogtreecommitdiff
path: root/community/gnome-settings-daemon-compat/revert-input-sources.patch
blob: dc769de4ea0d5fbe29cda472d2d8490f58eaca7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
From cc45fec342713745f391533a202976e97670f9e5 Mon Sep 17 00:00:00 2001
From: Rui Matos <tiagomatos@gmail.com>
Date: Wed, 12 Dec 2012 09:31:40 +0000
Subject: Revert "media-keys: Add key bindings to switch input sources"

These are now provided by gnome-shell.

This reverts commit fc58c347900f906e304591135ca6c13d9950ab4d.

https://bugzilla.gnome.org/show_bug.cgi?id=690106
---
diff --git a/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in b/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
index b56b5d1..25e5f3e 100644
--- a/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
+++ b/data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in.in
@@ -175,16 +175,6 @@
       <_summary>Magnifier zoom out</_summary>
       <_description>Binding for the magnifier to zoom out</_description>
     </key>
-    <key name="switch-input-source" type="s">
-      <default>''</default>
-      <_summary>Switch input source</_summary>
-      <_description>Binding to select the next input source</_description>
-    </key>
-    <key name="switch-input-source-backward" type="s">
-      <default>''</default>
-      <_summary>Switch input source backward</_summary>
-      <_description>Binding to select the previous input source</_description>
-    </key>
   </schema>
 
   <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.settings-daemon.plugins.media-keys.custom-keybinding">
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index e5977d0..cd6fbc2 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -98,10 +98,6 @@ static const gchar introspection_xml[] =
 #define VOLUME_STEP 6           /* percents for one volume button press */
 #define MAX_VOLUME 65536.0
 
-#define GNOME_DESKTOP_INPUT_SOURCES_DIR "org.gnome.desktop.input-sources"
-#define KEY_CURRENT_INPUT_SOURCE "current"
-#define KEY_INPUT_SOURCES        "sources"
-
 #define GSD_MEDIA_KEYS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_MEDIA_KEYS_MANAGER, GsdMediaKeysManagerPrivate))
 
 typedef struct {
@@ -1807,40 +1803,6 @@ do_keyboard_brightness_action (GsdMediaKeysManager *manager,
 }
 
 static void
-do_switch_input_source_action (GsdMediaKeysManager *manager,
-                               MediaKeyType         type)
-{
-        GSettings *settings;
-        GVariant *sources;
-        gint i, n;
-
-        settings = g_settings_new (GNOME_DESKTOP_INPUT_SOURCES_DIR);
-        sources = g_settings_get_value (settings, KEY_INPUT_SOURCES);
-
-        n = g_variant_n_children (sources);
-        if (n < 2)
-                goto out;
-
-        i = g_settings_get_uint (settings, KEY_CURRENT_INPUT_SOURCE);
-
-        if (type == SWITCH_INPUT_SOURCE_KEY)
-                i += 1;
-        else
-                i -= 1;
-
-        if (i < 0)
-                i = n - 1;
-        else if (i >= n)
-                i = 0;
-
-        g_settings_set_uint (settings, KEY_CURRENT_INPUT_SOURCE, i);
-
- out:
-        g_variant_unref (sources);
-        g_object_unref (settings);
-}
-
-static void
 do_custom_action (GsdMediaKeysManager *manager,
                   MediaKey            *key,
                   gint64               timestamp)
@@ -1999,10 +1961,6 @@ do_action (GsdMediaKeysManager *manager,
         case BATTERY_KEY:
                 do_execute_desktop (manager, "gnome-power-statistics.desktop", timestamp);
                 break;
-        case SWITCH_INPUT_SOURCE_KEY:
-        case SWITCH_INPUT_SOURCE_BACKWARD_KEY:
-                do_switch_input_source_action (manager, type);
-                break;
         /* Note, no default so compiler catches missing keys */
         case CUSTOM_KEY:
                 g_assert_not_reached ();
diff --git a/plugins/media-keys/shortcuts-list.h b/plugins/media-keys/shortcuts-list.h
index a16d0e7..437ed2c 100644
--- a/plugins/media-keys/shortcuts-list.h
+++ b/plugins/media-keys/shortcuts-list.h
@@ -80,8 +80,6 @@ typedef enum {
         KEYBOARD_BRIGHTNESS_DOWN_KEY,
         KEYBOARD_BRIGHTNESS_TOGGLE_KEY,
         BATTERY_KEY,
-        SWITCH_INPUT_SOURCE_KEY,
-        SWITCH_INPUT_SOURCE_BACKWARD_KEY,
         CUSTOM_KEY
 } MediaKeyType;
 
@@ -148,8 +146,6 @@ static struct {
         { KEYBOARD_BRIGHTNESS_UP_KEY, NULL, "XF86KbdBrightnessUp" },
         { KEYBOARD_BRIGHTNESS_DOWN_KEY, NULL, "XF86KbdBrightnessDown" },
         { KEYBOARD_BRIGHTNESS_TOGGLE_KEY, NULL, "XF86KbdLightOnOff" },
-        { SWITCH_INPUT_SOURCE_KEY, "switch-input-source", NULL },
-        { SWITCH_INPUT_SOURCE_BACKWARD_KEY, "switch-input-source-backward", NULL },
         { BATTERY_KEY, NULL, "XF86Battery" },
 };
 
--
cgit v0.9.1