~cyphermox/gnome-control-center/lp829673

« back to all changes in this revision

Viewing changes to debian/patches/26_add_touchpad_to_mouse_settings.patch

  • Committer: Michael Vogt
  • Date: 2008-09-09 10:33:15 UTC
  • Revision ID: michael.vogt@ubuntu.com-20080909103315-hwq84ewim3j47sas
initial checking

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -Nur -x '*.orig' -x '*~' gnome-control-center-2.21.90/capplets/mouse/gnome-mouse-properties.c gnome-control-center-2.21.90.new/capplets/mouse/gnome-mouse-properties.c
 
2
--- gnome-control-center-2.21.90/capplets/mouse/gnome-mouse-properties.c        2008-02-14 09:15:50.000000000 +0000
 
3
+++ gnome-control-center-2.21.90.new/capplets/mouse/gnome-mouse-properties.c    2008-02-14 09:18:13.000000000 +0000
 
4
@@ -41,6 +41,7 @@
 
5
 #include <sys/types.h>
 
6
 #include <sys/stat.h>
 
7
 #include <dirent.h>
 
8
+#include <X11/extensions/XInput.h>
 
9
 
 
10
 #ifdef HAVE_XCURSOR
 
11
 #include <X11/Xcursor/Xcursor.h>
 
12
@@ -341,6 +342,35 @@
 
13
        return new_value;
 
14
 }
 
15
 
 
16
+static gboolean
 
17
+find_synaptics()
 
18
+{
 
19
+        int numdevices, i;      
 
20
+        gboolean ret = FALSE;
 
21
+        XDeviceInfo *devicelist = XListInputDevices (GDK_DISPLAY(), &numdevices);
 
22
+        for (i = 0; i < numdevices; i++) {
 
23
+                if (strcmp (devicelist[i].name, "Synaptics Touchpad") == 0)
 
24
+                        ret = TRUE;
 
25
+        }
 
26
+        
 
27
+        XFreeDeviceList(devicelist);
 
28
+        return ret;
 
29
+}
 
30
+
 
31
+
 
32
+static void
 
33
+touchpad_enabled_toggle_cb (GtkToggleButton *button, GladeXML *dialog)
 
34
+{
 
35
+       gboolean active;
 
36
+
 
37
+       active = gtk_toggle_button_get_active (button);
 
38
+
 
39
+       gtk_widget_set_sensitive (WID ("tap_to_click_toggle"), active);
 
40
+       gtk_widget_set_sensitive (WID ("vert_scroll_toggle"), active);
 
41
+       gtk_widget_set_sensitive (WID ("horiz_scroll_toggle"), active);
 
42
+       
 
43
+}
 
44
+
 
45
 /* Set up the property editors in the dialog. */
 
46
 static void
 
47
 setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
 
48
@@ -387,6 +417,23 @@
 
49
                (changeset, "/desktop/gnome/peripherals/mouse/drag_threshold", WID ("drag_threshold_scale"),
 
50
                 "conv-to-widget-cb", drag_threshold_from_gconf,
 
51
                 NULL);
 
52
+
 
53
+       /* Trackpad page */
 
54
+       if (find_synaptics() == FALSE)
 
55
+               gtk_notebook_remove_page (GTK_NOTEBOOK(WID("prefs_widget")),-1);
 
56
+       else {
 
57
+               g_signal_connect (G_OBJECT (WID ("touchpad_enabled_toggle")), "toggled", (GCallback) touchpad_enabled_toggle_cb, dialog);
 
58
+
 
59
+               peditor = gconf_peditor_new_boolean
 
60
+                       (changeset, "/desktop/gnome/peripherals/mouse/touchpad_enabled", WID ("touchpad_enabled_toggle"), NULL);
 
61
+               peditor = gconf_peditor_new_boolean
 
62
+                       (changeset, "/desktop/gnome/peripherals/mouse/tap_to_click", WID ("tap_to_click_toggle"), NULL);
 
63
+               peditor = gconf_peditor_new_boolean
 
64
+                       (changeset, "/desktop/gnome/peripherals/mouse/pad_vert_scroll", WID ("vert_scroll_toggle"), NULL);
 
65
+               peditor = gconf_peditor_new_boolean
 
66
+                       (changeset, "/desktop/gnome/peripherals/mouse/pad_horiz_scroll", WID ("horiz_scroll_toggle"), NULL);
 
67
+       }
 
68
+
 
69
 }
 
70
 
 
71
 /* Construct the dialog */
 
72
diff -Nur -x '*.orig' -x '*~' gnome-control-center-2.21.90/capplets/mouse/gnome-mouse-properties.glade gnome-control-center-2.21.90.new/capplets/mouse/gnome-mouse-properties.glade
 
73
--- gnome-control-center-2.21.90/capplets/mouse/gnome-mouse-properties.glade    2008-02-14 09:15:50.000000000 +0000
 
74
+++ gnome-control-center-2.21.90.new/capplets/mouse/gnome-mouse-properties.glade        2008-02-14 09:17:39.000000000 +0000
 
75
@@ -1288,6 +1288,235 @@
 
76
                 <property name="tab_fill">False</property>
 
77
               </packing>
 
78
             </child>
 
79
+            <child>
 
80
+              <widget class="GtkVBox" id="vbox3">
 
81
+                <property name="visible">True</property>
 
82
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
83
+                <property name="border_width">12</property>
 
84
+                <property name="spacing">18</property>
 
85
+                <child>
 
86
+                  <widget class="GtkVBox" id="vbox15">
 
87
+                    <property name="visible">True</property>
 
88
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
89
+                    <property name="spacing">6</property>
 
90
+                    <child>
 
91
+                      <widget class="GtkLabel" id="label18">
 
92
+                        <property name="visible">True</property>
 
93
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
94
+                        <property name="xalign">0</property>
 
95
+                        <property name="yalign">0</property>
 
96
+                        <property name="label" translatable="yes">&lt;b&gt;General&lt;/b&gt;</property>
 
97
+                        <property name="use_markup">True</property>
 
98
+                      </widget>
 
99
+                      <packing>
 
100
+                        <property name="expand">False</property>
 
101
+                        <property name="fill">False</property>
 
102
+                      </packing>
 
103
+                    </child>
 
104
+                    <child>
 
105
+                      <widget class="GtkHBox" id="hbox3">
 
106
+                        <property name="visible">True</property>
 
107
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
108
+                        <child>
 
109
+                          <widget class="GtkLabel" id="label19">
 
110
+                            <property name="visible">True</property>
 
111
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
112
+                            <property name="xalign">0</property>
 
113
+                            <property name="yalign">0</property>
 
114
+                            <property name="label">    </property>
 
115
+                          </widget>
 
116
+                          <packing>
 
117
+                            <property name="expand">False</property>
 
118
+                            <property name="fill">False</property>
 
119
+                          </packing>
 
120
+                        </child>
 
121
+                        <child>
 
122
+                          <widget class="GtkCheckButton" id="touchpad_enabled_toggle">
 
123
+                            <property name="visible">True</property>
 
124
+                            <property name="can_focus">True</property>
 
125
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
126
+                            <property name="label" translatable="yes">Enable _touchpad</property>
 
127
+                            <property name="use_underline">True</property>
 
128
+                            <property name="response_id">0</property>
 
129
+                            <property name="active">True</property>
 
130
+                            <property name="draw_indicator">True</property>
 
131
+                          </widget>
 
132
+                          <packing>
 
133
+                            <property name="position">1</property>
 
134
+                          </packing>
 
135
+                        </child>
 
136
+                      </widget>
 
137
+                      <packing>
 
138
+                        <property name="expand">False</property>
 
139
+                        <property name="fill">False</property>
 
140
+                        <property name="position">1</property>
 
141
+                      </packing>
 
142
+                    </child>
 
143
+                    <child>
 
144
+                      <widget class="GtkHBox" id="hbox11">
 
145
+                        <property name="visible">True</property>
 
146
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
147
+                        <child>
 
148
+                          <widget class="GtkLabel" id="label22">
 
149
+                            <property name="visible">True</property>
 
150
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
151
+                            <property name="xalign">0</property>
 
152
+                            <property name="yalign">0</property>
 
153
+                            <property name="label">    </property>
 
154
+                          </widget>
 
155
+                          <packing>
 
156
+                            <property name="expand">False</property>
 
157
+                            <property name="fill">False</property>
 
158
+                          </packing>
 
159
+                        </child>
 
160
+                        <child>
 
161
+                          <widget class="GtkCheckButton" id="tap_to_click_toggle">
 
162
+                            <property name="visible">True</property>
 
163
+                            <property name="can_focus">True</property>
 
164
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
165
+                            <property name="label" translatable="yes">Enable mouse _clicks with touchpad</property>
 
166
+                            <property name="use_underline">True</property>
 
167
+                            <property name="response_id">0</property>
 
168
+                            <property name="active">True</property>
 
169
+                            <property name="draw_indicator">True</property>
 
170
+                          </widget>
 
171
+                          <packing>
 
172
+                            <property name="position">1</property>
 
173
+                          </packing>
 
174
+                        </child>
 
175
+                      </widget>
 
176
+                      <packing>
 
177
+                        <property name="expand">False</property>
 
178
+                        <property name="fill">False</property>
 
179
+                        <property name="position">2</property>
 
180
+                      </packing>
 
181
+                    </child>
 
182
+                  </widget>
 
183
+                  <packing>
 
184
+                    <property name="expand">False</property>
 
185
+                    <property name="fill">False</property>
 
186
+                  </packing>
 
187
+                </child>
 
188
+                <child>
 
189
+                  <widget class="GtkVBox" id="vbox19">
 
190
+                    <property name="visible">True</property>
 
191
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
192
+                    <property name="spacing">6</property>
 
193
+                    <child>
 
194
+                      <widget class="GtkLabel" id="label34">
 
195
+                        <property name="visible">True</property>
 
196
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
197
+                        <property name="xalign">0</property>
 
198
+                        <property name="yalign">0</property>
 
199
+                        <property name="label" translatable="yes">&lt;b&gt;Scrolling&lt;/b&gt;</property>
 
200
+                        <property name="use_markup">True</property>
 
201
+                      </widget>
 
202
+                      <packing>
 
203
+                        <property name="expand">False</property>
 
204
+                        <property name="fill">False</property>
 
205
+                      </packing>
 
206
+                    </child>
 
207
+                    <child>
 
208
+                      <widget class="GtkHBox" id="hbox15">
 
209
+                        <property name="visible">True</property>
 
210
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
211
+                        <child>
 
212
+                          <widget class="GtkLabel" id="label35">
 
213
+                            <property name="visible">True</property>
 
214
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
215
+                            <property name="xalign">0</property>
 
216
+                            <property name="yalign">0</property>
 
217
+                            <property name="label">    </property>
 
218
+                          </widget>
 
219
+                          <packing>
 
220
+                            <property name="expand">False</property>
 
221
+                            <property name="fill">False</property>
 
222
+                          </packing>
 
223
+                        </child>
 
224
+                        <child>
 
225
+                          <widget class="GtkCheckButton" id="vert_scroll_toggle">
 
226
+                            <property name="visible">True</property>
 
227
+                            <property name="can_focus">True</property>
 
228
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
229
+                            <property name="label" translatable="yes">Enable _vertical scrolling</property>
 
230
+                            <property name="use_underline">True</property>
 
231
+                            <property name="response_id">0</property>
 
232
+                            <property name="active">True</property>
 
233
+                            <property name="draw_indicator">True</property>
 
234
+                          </widget>
 
235
+                          <packing>
 
236
+                            <property name="position">1</property>
 
237
+                          </packing>
 
238
+                        </child>
 
239
+                      </widget>
 
240
+                      <packing>
 
241
+                        <property name="expand">False</property>
 
242
+                        <property name="fill">False</property>
 
243
+                        <property name="position">1</property>
 
244
+                      </packing>
 
245
+                    </child>
 
246
+                    <child>
 
247
+                      <widget class="GtkHBox" id="hbox16">
 
248
+                        <property name="visible">True</property>
 
249
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
250
+                        <child>
 
251
+                          <widget class="GtkLabel" id="label36">
 
252
+                            <property name="visible">True</property>
 
253
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
254
+                            <property name="xalign">0</property>
 
255
+                            <property name="yalign">0</property>
 
256
+                            <property name="label">    </property>
 
257
+                          </widget>
 
258
+                          <packing>
 
259
+                            <property name="expand">False</property>
 
260
+                            <property name="fill">False</property>
 
261
+                          </packing>
 
262
+                        </child>
 
263
+                        <child>
 
264
+                          <widget class="GtkCheckButton" id="horiz_scroll_toggle">
 
265
+                            <property name="visible">True</property>
 
266
+                            <property name="can_focus">True</property>
 
267
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
 
268
+                            <property name="label" translatable="yes">Enable _horizontal scrolling</property>
 
269
+                            <property name="use_underline">True</property>
 
270
+                            <property name="response_id">0</property>
 
271
+                            <property name="draw_indicator">True</property>
 
272
+                          </widget>
 
273
+                          <packing>
 
274
+                            <property name="position">1</property>
 
275
+                          </packing>
 
276
+                        </child>
 
277
+                      </widget>
 
278
+                      <packing>
 
279
+                        <property name="expand">False</property>
 
280
+                        <property name="fill">False</property>
 
281
+                        <property name="position">2</property>
 
282
+                      </packing>
 
283
+                    </child>
 
284
+                  </widget>
 
285
+                  <packing>
 
286
+                    <property name="expand">False</property>
 
287
+                    <property name="fill">False</property>
 
288
+                    <property name="position">1</property>
 
289
+                  </packing>
 
290
+                </child>
 
291
+              </widget>
 
292
+              <packing>
 
293
+                <property name="position">2</property>
 
294
+              </packing>
 
295
+            </child>
 
296
+            <child>
 
297
+              <widget class="GtkLabel" id="label4">
 
298
+                <property name="visible">True</property>
 
299
+                <property name="label" translatable="yes">Touchpad</property>
 
300
+                <property name="justify">GTK_JUSTIFY_CENTER</property>
 
301
+              </widget>
 
302
+              <packing>
 
303
+                <property name="type">tab</property>
 
304
+                <property name="position">2</property>
 
305
+                <property name="tab_fill">False</property>
 
306
+              </packing>
 
307
+            </child>
 
308
           </widget>
 
309
           <packing>
 
310
             <property name="position">1</property>