summaryrefslogtreecommitdiffstats
path: root/meta-gnome/recipes-gnome/gdm/gdm
diff options
context:
space:
mode:
Diffstat (limited to 'meta-gnome/recipes-gnome/gdm/gdm')
-rw-r--r--meta-gnome/recipes-gnome/gdm/gdm/%gconf-tree.xml492
-rw-r--r--meta-gnome/recipes-gnome/gdm/gdm/0001-Remove-user-switch-applet.patch2281
-rw-r--r--meta-gnome/recipes-gnome/gdm/gdm/0002-gdm-user-manager.c-avoid-displaying-system-users-in-.patch34
-rwxr-xr-xmeta-gnome/recipes-gnome/gdm/gdm/Default96
-rw-r--r--meta-gnome/recipes-gnome/gdm/gdm/cross-xdetection.diff96
-rwxr-xr-xmeta-gnome/recipes-gnome/gdm/gdm/gdm89
-rw-r--r--meta-gnome/recipes-gnome/gdm/gdm/gdm-pam11
-rw-r--r--meta-gnome/recipes-gnome/gdm/gdm/gdm.conf80
-rw-r--r--meta-gnome/recipes-gnome/gdm/gdm/gdm.service.in10
-rw-r--r--meta-gnome/recipes-gnome/gdm/gdm/sysrooted-pkg-config.patch37
10 files changed, 3226 insertions, 0 deletions
diff --git a/meta-gnome/recipes-gnome/gdm/gdm/%gconf-tree.xml b/meta-gnome/recipes-gnome/gdm/gdm/%gconf-tree.xml
new file mode 100644
index 000000000..f8c2e9cc2
--- /dev/null
+++ b/meta-gnome/recipes-gnome/gdm/gdm/%gconf-tree.xml
@@ -0,0 +1,492 @@
1<?xml version="1.0"?>
2<gconf>
3 <dir name="desktop">
4 <dir name="gnome">
5 <dir name="url-handlers">
6 <dir name="ymsgr">
7 <entry name="command" mtime="1227173197" type="string">
8 <stringvalue>/bin/true</stringvalue>
9 </entry>
10 </dir>
11 <dir name="xmpp">
12 <entry name="command" mtime="1227173197" type="string">
13 <stringvalue>/bin/true</stringvalue>
14 </entry>
15 </dir>
16 <dir name="webcal">
17 <entry name="command" mtime="1227173197" type="string">
18 <stringvalue>/bin/true</stringvalue>
19 </entry>
20 </dir>
21 <dir name="uvox">
22 <entry name="command" mtime="1227173197" type="string">
23 <stringvalue>/bin/true</stringvalue>
24 </entry>
25 </dir>
26 <dir name="trash">
27 <entry name="command" mtime="1227173197" type="string">
28 <stringvalue>/bin/true</stringvalue>
29 </entry>
30 </dir>
31 <dir name="sip">
32 <entry name="command" mtime="1227173197" type="string">
33 <stringvalue>/bin/true</stringvalue>
34 </entry>
35 </dir>
36 <dir name="rtsp">
37 <entry name="command" mtime="1227173197" type="string">
38 <stringvalue>/bin/true</stringvalue>
39 </entry>
40 </dir>
41 <dir name="rtp">
42 <entry name="command" mtime="1227173197" type="string">
43 <stringvalue>/bin/true</stringvalue>
44 </entry>
45 </dir>
46 <dir name="pnm">
47 <entry name="command" mtime="1227173197" type="string">
48 <stringvalue>/bin/true</stringvalue>
49 </entry>
50 </dir>
51 <dir name="note">
52 <entry name="command" mtime="1227173197" type="string">
53 <stringvalue>/bin/true</stringvalue>
54 </entry>
55 </dir>
56 <dir name="net">
57 <entry name="command" mtime="1227173197" type="string">
58 <stringvalue>/bin/true</stringvalue>
59 </entry>
60 </dir>
61 <dir name="msnim">
62 <entry name="command" mtime="1227173197" type="string">
63 <stringvalue>/bin/true</stringvalue>
64 </entry>
65 </dir>
66 <dir name="mmsh">
67 <entry name="command" mtime="1227173197" type="string">
68 <stringvalue>/bin/true</stringvalue>
69 </entry>
70 </dir>
71 <dir name="mms">
72 <entry name="command" mtime="1227173197" type="string">
73 <stringvalue>/bin/true</stringvalue>
74 </entry>
75 </dir>
76 <dir name="man">
77 <entry name="command" mtime="1227173197" type="string">
78 <stringvalue>/bin/true</stringvalue>
79 </entry>
80 </dir>
81 <dir name="mailto">
82 <entry name="command" mtime="1227173197" type="string">
83 <stringvalue>/bin/true</stringvalue>
84 </entry>
85 </dir>
86 <dir name="lastfm">
87 <entry name="command" mtime="1227173197" type="string">
88 <stringvalue>/bin/true</stringvalue>
89 </entry>
90 </dir>
91 <dir name="itpc">
92 <entry name="command" mtime="1227173197" type="string">
93 <stringvalue>/bin/true</stringvalue>
94 </entry>
95 </dir>
96 <dir name="itms">
97 <entry name="command" mtime="1227173197" type="string">
98 <stringvalue>/bin/true</stringvalue>
99 </entry>
100 </dir>
101 <dir name="irc">
102 <entry name="command" mtime="1227173197" type="string">
103 <stringvalue>/bin/true</stringvalue>
104 </entry>
105 </dir>
106 <dir name="info">
107 <entry name="command" mtime="1227173197" type="string">
108 <stringvalue>/bin/true</stringvalue>
109 </entry>
110 </dir>
111 <dir name="icyx">
112 <entry name="command" mtime="1227173197" type="string">
113 <stringvalue>/bin/true</stringvalue>
114 </entry>
115 </dir>
116 <dir name="icy">
117 <entry name="command" mtime="1227173197" type="string">
118 <stringvalue>/bin/true</stringvalue>
119 </entry>
120 </dir>
121 <dir name="icq">
122 <entry name="command" mtime="1227173197" type="string">
123 <stringvalue>/bin/true</stringvalue>
124 </entry>
125 </dir>
126 <dir name="https">
127 <entry name="command" mtime="1227173197" type="string">
128 <stringvalue>/bin/true</stringvalue>
129 </entry>
130 </dir>
131 <dir name="http">
132 <entry name="command" mtime="1227173197" type="string">
133 <stringvalue>/bin/true</stringvalue>
134 </entry>
135 </dir>
136 <dir name="h323">
137 <entry name="command" mtime="1227173197" type="string">
138 <stringvalue>/bin/true</stringvalue>
139 </entry>
140 </dir>
141 <dir name="ghelp">
142 <entry name="command" mtime="1227173197" type="string">
143 <stringvalue>/bin/true</stringvalue>
144 </entry>
145 </dir>
146 <dir name="gg">
147 <entry name="command" mtime="1227173197" type="string">
148 <stringvalue>/bin/true</stringvalue>
149 </entry>
150 </dir>
151 <dir name="ftp">
152 <entry name="command" mtime="1227173197" type="string">
153 <stringvalue>/bin/true</stringvalue>
154 </entry>
155 </dir>
156 <dir name="file">
157 <entry name="command" mtime="1227173197" type="string">
158 <stringvalue>/bin/true</stringvalue>
159 </entry>
160 </dir>
161 <dir name="feed">
162 <entry name="command" mtime="1227173197" type="string">
163 <stringvalue>/bin/true</stringvalue>
164 </entry>
165 </dir>
166 <dir name="cdda">
167 <entry name="command" mtime="1227173197" type="string">
168 <stringvalue>/bin/true</stringvalue>
169 </entry>
170 </dir>
171 <dir name="callto">
172 <entry name="command" mtime="1227173197" type="string">
173 <stringvalue>/bin/true</stringvalue>
174 </entry>
175 </dir>
176 <dir name="aim">
177 <entry name="command" mtime="1227173197" type="string">
178 <stringvalue>/bin/true</stringvalue>
179 </entry>
180 </dir>
181 <dir name="about">
182 <entry name="command" mtime="1227173197" type="string">
183 <stringvalue>/bin/true</stringvalue>
184 </entry>
185 </dir>
186 </dir>
187 <dir name="lockdown">
188 <entry name="disable_url_handlers" mtime="1227173197" type="bool" value="true">
189 </entry>
190 <entry name="disable_save_to_disk" mtime="1227173197" type="bool" value="true">
191 </entry>
192 <entry name="disable_print_setup" mtime="1227173197" type="bool" value="true">
193 </entry>
194 <entry name="disable_printing" mtime="1227173197" type="bool" value="true">
195 </entry>
196 <entry name="disable_lock_screen" mtime="1227173197" type="bool" value="true">
197 </entry>
198 <entry name="disable_command_line" mtime="1227173197" type="bool" value="true">
199 </entry>
200 </dir>
201 <dir name="applications">
202 <dir name="terminal">
203 <entry name="exec" mtime="1227173197" type="string">
204 <stringvalue>/bin/true</stringvalue>
205 </entry>
206 </dir>
207 </dir>
208 <dir name="accessibility">
209 <dir name="keyboard">
210 <entry name="enable" mtime="1227173197" type="bool" value="true">
211 </entry>
212 </dir>
213 </dir>
214 </dir>
215 </dir>
216 <dir name="apps">
217 <dir name="gnome_settings_daemon">
218 <dir name="keybindings">
219 <entry name="www" mtime="1227173197" type="string">
220 <stringvalue></stringvalue>
221 </entry>
222 <entry name="stop" mtime="1227173197" type="string">
223 <stringvalue></stringvalue>
224 </entry>
225 <entry name="sleep" mtime="1227173197" type="string">
226 <stringvalue></stringvalue>
227 </entry>
228 <entry name="search" mtime="1227173197" type="string">
229 <stringvalue></stringvalue>
230 </entry>
231 <entry name="screensaver" mtime="1227173197" type="string">
232 <stringvalue></stringvalue>
233 </entry>
234 <entry name="previous" mtime="1227173197" type="string">
235 <stringvalue></stringvalue>
236 </entry>
237 <entry name="power" mtime="1227173197" type="string">
238 <stringvalue></stringvalue>
239 </entry>
240 <entry name="play" mtime="1227173197" type="string">
241 <stringvalue></stringvalue>
242 </entry>
243 <entry name="pause" mtime="1227173197" type="string">
244 <stringvalue></stringvalue>
245 </entry>
246 <entry name="next" mtime="1227173197" type="string">
247 <stringvalue></stringvalue>
248 </entry>
249 <entry name="media" mtime="1227173197" type="string">
250 <stringvalue></stringvalue>
251 </entry>
252 <entry name="home" mtime="1227173197" type="string">
253 <stringvalue></stringvalue>
254 </entry>
255 <entry name="help" mtime="1227173197" type="string">
256 <stringvalue></stringvalue>
257 </entry>
258 <entry name="email" mtime="1227173197" type="string">
259 <stringvalue></stringvalue>
260 </entry>
261 <entry name="calculator" mtime="1227173197" type="string">
262 <stringvalue></stringvalue>
263 </entry>
264 <entry name="eject" mtime="1227173197" type="string">
265 <stringvalue></stringvalue>
266 </entry>
267 </dir>
268 </dir>
269 <dir name="metacity">
270 <dir name="keybinding_commands">
271 <entry name="command_window_screenshot" mtime="1227173197" type="string">
272 <stringvalue>/bin/true</stringvalue>
273 </entry>
274 <entry name="command_screenshot" mtime="1227173197" type="string">
275 <stringvalue>gdm-screenshot</stringvalue>
276 </entry>
277 </dir>
278 <dir name="global_keybindings">
279 <entry name="switch_to_workspace_up" mtime="1227173197" type="string">
280 <stringvalue>disabled</stringvalue>
281 </entry>
282 <entry name="switch_to_workspace_right" mtime="1227173197" type="string">
283 <stringvalue>disabled</stringvalue>
284 </entry>
285 <entry name="switch_to_workspace_left" mtime="1227173197" type="string">
286 <stringvalue>disabled</stringvalue>
287 </entry>
288 <entry name="switch_to_workspace_down" mtime="1227173197" type="string">
289 <stringvalue>disabled</stringvalue>
290 </entry>
291 <entry name="switch_group" mtime="1227173197" type="string">
292 <stringvalue>disabled</stringvalue>
293 </entry>
294 <entry name="show_desktop" mtime="1227173197" type="string">
295 <stringvalue>disabled</stringvalue>
296 </entry>
297 <entry name="run_command_window_screenshot" mtime="1227173197" type="string">
298 <stringvalue>disabled</stringvalue>
299 </entry>
300 <entry name="run_command_screenshot" mtime="1227173197" type="string">
301 <stringvalue>Print</stringvalue>
302 </entry>
303 <entry name="panel_run_dialog" mtime="1227173197" type="string">
304 <stringvalue>disabled</stringvalue>
305 </entry>
306 <entry name="panel_main_menu" mtime="1227173197" type="string">
307 <stringvalue>disabled</stringvalue>
308 </entry>
309 </dir>
310 <dir name="general">
311 <entry name="num_workspaces" mtime="1227173197" type="int" value="1">
312 </entry>
313 </dir>
314 </dir>
315 <dir name="compiz">
316 <dir name="general">
317 <dir name="allscreens">
318 <dir name="options">
319 <entry name="run_command11_key" mtime="1227173197" type="string">
320 <stringvalue>Disabled</stringvalue>
321 </entry>
322 <entry name="run_command11_button" mtime="1227173197" type="string">
323 <stringvalue>Disabled</stringvalue>
324 </entry>
325 <entry name="run_command10_key" mtime="1227173197" type="string">
326 <stringvalue>Disabled</stringvalue>
327 </entry>
328 <entry name="run_command10_button" mtime="1227173197" type="string">
329 <stringvalue>Disabled</stringvalue>
330 </entry>
331 <entry name="run_command8_key" mtime="1227173197" type="string">
332 <stringvalue>Disabled</stringvalue>
333 </entry>
334 <entry name="run_command8_button" mtime="1227173197" type="string">
335 <stringvalue>Disabled</stringvalue>
336 </entry>
337 <entry name="run_command7_key" mtime="1227173197" type="string">
338 <stringvalue>Disabled</stringvalue>
339 </entry>
340 <entry name="run_command7_button" mtime="1227173197" type="string">
341 <stringvalue>Disabled</stringvalue>
342 </entry>
343 <entry name="run_command6_key" mtime="1227173197" type="string">
344 <stringvalue>Disabled</stringvalue>
345 </entry>
346 <entry name="run_command6_button" mtime="1227173197" type="string">
347 <stringvalue>Disabled</stringvalue>
348 </entry>
349 <entry name="run_command5_key" mtime="1227173197" type="string">
350 <stringvalue>Disabled</stringvalue>
351 </entry>
352 <entry name="run_command5_button" mtime="1227173197" type="string">
353 <stringvalue>Disabled</stringvalue>
354 </entry>
355 <entry name="run_command4_key" mtime="1227173197" type="string">
356 <stringvalue>Disabled</stringvalue>
357 </entry>
358 <entry name="run_command4_button" mtime="1227173197" type="string">
359 <stringvalue>Disabled</stringvalue>
360 </entry>
361 <entry name="run_command3_key" mtime="1227173197" type="string">
362 <stringvalue>Disabled</stringvalue>
363 </entry>
364 <entry name="run_command3_button" mtime="1227173197" type="string">
365 <stringvalue>Disabled</stringvalue>
366 </entry>
367 <entry name="run_command2_key" mtime="1227173197" type="string">
368 <stringvalue>Disabled</stringvalue>
369 </entry>
370 <entry name="run_command2_button" mtime="1227173197" type="string">
371 <stringvalue>Disabled</stringvalue>
372 </entry>
373 <entry name="run_command1_key" mtime="1227173197" type="string">
374 <stringvalue>Disabled</stringvalue>
375 </entry>
376 <entry name="run_command1_button" mtime="1227173197" type="string">
377 <stringvalue>Disabled</stringvalue>
378 </entry>
379 <entry name="run_command0_key" mtime="1227173197" type="string">
380 <stringvalue>Disabled</stringvalue>
381 </entry>
382 <entry name="run_command0_button" mtime="1227173197" type="string">
383 <stringvalue>Disabled</stringvalue>
384 </entry>
385 <entry name="run_key" mtime="1227173197" type="string">
386 <stringvalue>Disabled</stringvalue>
387 </entry>
388 <entry name="run_button" mtime="1227173197" type="string">
389 <stringvalue>Disabled</stringvalue>
390 </entry>
391 <entry name="main_menu_key" mtime="1227173197" type="string">
392 <stringvalue>Disabled</stringvalue>
393 </entry>
394 <entry name="main_menu_button" mtime="1227173197" type="string">
395 <stringvalue>Disabled</stringvalue>
396 </entry>
397 <entry name="command_window_screenshot" mtime="1227173197" type="string">
398 <stringvalue></stringvalue>
399 </entry>
400 <entry name="command11" mtime="1227173197" type="string">
401 <stringvalue></stringvalue>
402 </entry>
403 <entry name="command10" mtime="1227173197" type="string">
404 <stringvalue></stringvalue>
405 </entry>
406 <entry name="command9" mtime="1227173197" type="string">
407 <stringvalue></stringvalue>
408 </entry>
409 <entry name="command8" mtime="1227173197" type="string">
410 <stringvalue></stringvalue>
411 </entry>
412 <entry name="command7" mtime="1227173197" type="string">
413 <stringvalue></stringvalue>
414 </entry>
415 <entry name="command6" mtime="1227173197" type="string">
416 <stringvalue></stringvalue>
417 </entry>
418 <entry name="command5" mtime="1227173197" type="string">
419 <stringvalue></stringvalue>
420 </entry>
421 <entry name="command4" mtime="1227173197" type="string">
422 <stringvalue></stringvalue>
423 </entry>
424 <entry name="command3" mtime="1227173197" type="string">
425 <stringvalue></stringvalue>
426 </entry>
427 <entry name="command2" mtime="1227173197" type="string">
428 <stringvalue></stringvalue>
429 </entry>
430 <entry name="command1" mtime="1227173197" type="string">
431 <stringvalue></stringvalue>
432 </entry>
433 <entry name="command0" mtime="1227173197" type="string">
434 <stringvalue></stringvalue>
435 </entry>
436 <entry name="command_terminal" mtime="1227173197" type="string">
437 <stringvalue></stringvalue>
438 </entry>
439 <entry name="command_screenshot" mtime="1227173197" type="string">
440 <stringvalue>gdm-screenshot</stringvalue>
441 </entry>
442 <entry name="active_plugins" mtime="1227173197" type="list" ltype="string">
443 <li type="string">
444 <stringvalue>cube</stringvalue>
445 </li>
446 <li type="string">
447 <stringvalue>decoration</stringvalue>
448 </li>
449 <li type="string">
450 <stringvalue>gconf</stringvalue>
451 </li>
452 <li type="string">
453 <stringvalue>glib</stringvalue>
454 </li>
455 <li type="string">
456 <stringvalue>move</stringvalue>
457 </li>
458 <li type="string">
459 <stringvalue>place</stringvalue>
460 </li>
461 <li type="string">
462 <stringvalue>resize</stringvalue>
463 </li>
464 <li type="string">
465 <stringvalue>screenshot</stringvalue>
466 </li>
467 <li type="string">
468 <stringvalue>wobbly</stringvalue>
469 </li>
470 </entry>
471 </dir>
472 </dir>
473 </dir>
474 </dir>
475 <dir name="gnome-power-manager">
476 <dir name="ui">
477 <entry name="show_context_menu" mtime="1227173197" type="bool" value="false">
478 </entry>
479 </dir>
480 </dir>
481 <dir name="gnome-screensaver">
482 <entry name="power_management_delay" mtime="1227173197" type="int" value="30">
483 </entry>
484 </dir>
485 <dir name="nautilus">
486 <dir name="preferences">
487 <entry name="show_desktop" mtime="1227173197" type="bool" value="false">
488 </entry>
489 </dir>
490 </dir>
491 </dir>
492</gconf>
diff --git a/meta-gnome/recipes-gnome/gdm/gdm/0001-Remove-user-switch-applet.patch b/meta-gnome/recipes-gnome/gdm/gdm/0001-Remove-user-switch-applet.patch
new file mode 100644
index 000000000..75aff5d7c
--- /dev/null
+++ b/meta-gnome/recipes-gnome/gdm/gdm/0001-Remove-user-switch-applet.patch
@@ -0,0 +1,2281 @@
1From 0a4fe802edbd2e8a016161f08283e4b467c6762e Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Tue, 21 Jun 2011 12:48:39 +0200
4Subject: [PATCH] Remove user switch applet
5
6This hasn't been updated to work with gnome-panel > 2.30.0, so just drop it
7
8Upstream-Status: unacceptable, backport
9
10Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
11---
12 configure.ac | 8 -
13 gui/Makefile.am | 2 -
14 .../GNOME_FastUserSwitchApplet.server.in.in | 38 -
15 .../GNOME_FastUserSwitchApplet.xml | 20 -
16 gui/user-switch-applet/Makefile.am | 67 -
17 gui/user-switch-applet/applet.c | 1662 --------------------
18 gui/user-switch-applet/gdm-entry-menu-item.c | 304 ----
19 gui/user-switch-applet/gdm-entry-menu-item.h | 51 -
20 po/POTFILES.in | 4 -
21 po/POTFILES.skip | 1 -
22 10 files changed, 0 insertions(+), 2157 deletions(-)
23 delete mode 100644 gui/user-switch-applet/GNOME_FastUserSwitchApplet.server.in.in
24 delete mode 100644 gui/user-switch-applet/GNOME_FastUserSwitchApplet.xml
25 delete mode 100644 gui/user-switch-applet/Makefile.am
26 delete mode 100644 gui/user-switch-applet/applet.c
27 delete mode 100644 gui/user-switch-applet/gdm-entry-menu-item.c
28 delete mode 100644 gui/user-switch-applet/gdm-entry-menu-item.h
29
30diff --git a/configure.ac b/configure.ac
31index 841efe0..a834110 100644
32--- a/configure.ac
33+++ b/configure.ac
34@@ -149,13 +149,6 @@ PKG_CHECK_MODULES(SIMPLE_CHOOSER,
35 AC_SUBST(SIMPLE_CHOOSER_CFLAGS)
36 AC_SUBST(SIMPLE_CHOOSER_LIBS)
37
38-PKG_CHECK_MODULES(APPLET,
39- dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
40- gtk+-2.0 >= $GTK_REQUIRED_VERSION
41- libpanelapplet-2.0 >= $GNOME_PANEL_REQUIRED_VERSION)
42-AC_SUBST(APPLET_CFLAGS)
43-AC_SUBST(APPLET_LIBS)
44-
45 PLUGIN_LIBTOOL_FLAGS="-export_dynamic -module -avoid-version"
46 AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
47
48@@ -1340,7 +1333,6 @@ gui/Makefile
49 gui/simple-greeter/Makefile
50 gui/simple-greeter/libnotificationarea/Makefile
51 gui/simple-chooser/Makefile
52-gui/user-switch-applet/Makefile
53 utils/Makefile
54 data/gdm.conf
55 data/Makefile
56diff --git a/gui/Makefile.am b/gui/Makefile.am
57index 326239f..bda3f7a 100644
58--- a/gui/Makefile.am
59+++ b/gui/Makefile.am
60@@ -2,7 +2,6 @@ NULL =
61
62 SUBDIRS = \
63 simple-greeter \
64- user-switch-applet \
65 $(NULL)
66
67 if XDMCP_SUPPORT
68@@ -12,5 +11,4 @@ endif
69 DIST_SUBDIRS = \
70 simple-chooser \
71 simple-greeter \
72- user-switch-applet \
73 $(NULL)
74diff --git a/gui/user-switch-applet/GNOME_FastUserSwitchApplet.server.in.in b/gui/user-switch-applet/GNOME_FastUserSwitchApplet.server.in.in
75deleted file mode 100644
76index a9b775f..0000000
77--- a/gui/user-switch-applet/GNOME_FastUserSwitchApplet.server.in.in
78+++ /dev/null
79@@ -1,38 +0,0 @@
80-<oaf_info>
81- <oaf_server iid="OAFIID:GNOME_FastUserSwitchApplet_Factory" type="exe"
82- location="@LIBEXECDIR@/gdm-user-switch-applet">
83-
84- <oaf_attribute name="repo_ids" type="stringv">
85- <item value="IDL:Bonobo/GenericFactory:1.0"/>
86- <item value="IDL:Bonobo/Unknown:1.0"/>
87- </oaf_attribute>
88- <oaf_attribute name="name" type="string" _value="User Switcher Applet Factory"/>
89- <oaf_attribute name="description" type="string" _value="User Switcher Applet Factory"/>
90- <oaf_attribute name="bonobo:environment" type="stringv">
91- <item value="DBUS_SESSION_BUS_ADDRESS"/>
92- <oaf_attribute name="bugzilla:bugzilla" type="string" value="GNOME"/>
93- <oaf_attribute name="bugzilla:product" type="string" value="gdm"/>
94- <oaf_attribute name="bugzilla:component" type="string" value="general"/>
95- <oaf_attribute name="bugzilla:version" type="string" value="@VERSION@"/>
96- <oaf_attribute name="bugzilla:other_binaries" type="string" value="gdm-user-switch-applet"/>
97- </oaf_attribute>
98- </oaf_server>
99-
100- <oaf_server iid="OAFIID:GNOME_FastUserSwitchApplet" type="factory"
101- location="OAFIID:GNOME_FastUserSwitchApplet_Factory">
102-
103- <oaf_attribute name="repo_ids" type="stringv">
104- <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/>
105- <item value="IDL:Bonobo/Control:1.0"/>
106- <item value="IDL:Bonobo/Unknown:1.0"/>
107- </oaf_attribute>
108- <oaf_attribute name="name" type="string" _value="User Switcher"/>
109- <oaf_attribute name="description" type="string" _value="A menu to quickly switch between users"/>
110- <oaf_attribute name="panel:icon" type="string" value="stock_people"/>
111- <oaf_attribute name="bugzilla:bugzilla" type="string" value="GNOME"/>
112- <oaf_attribute name="bugzilla:product" type="string" value="gdm"/>
113- <oaf_attribute name="bugzilla:component" type="string" value="general"/>
114- <oaf_attribute name="bugzilla:version" type="string" value="@VERSION@"/>
115- <oaf_attribute name="bugzilla:other_binaries" type="string" value="gdm-user-switch-applet"/>
116- </oaf_server>
117-</oaf_info>
118diff --git a/gui/user-switch-applet/GNOME_FastUserSwitchApplet.xml b/gui/user-switch-applet/GNOME_FastUserSwitchApplet.xml
119deleted file mode 100644
120index e1845c8..0000000
121--- a/gui/user-switch-applet/GNOME_FastUserSwitchApplet.xml
122+++ /dev/null
123@@ -1,20 +0,0 @@
124-<Root>
125- <popups>
126- <popup name="button3">
127- <menuitem
128- name="About Me Item"
129- verb="GdmAboutMe"
130- _label="Edit Personal _Information"/>
131- <menuitem
132- name="Users and Groups Admin Item"
133- verb="GdmUsersGroupsAdmin"
134- _label="_Edit Users and Groups"/>
135- <menuitem
136- name="About Item"
137- verb="GdmAbout"
138- _label="_About"
139- pixtype="stock"
140- pixname="gtk-about"/>
141- </popup>
142- </popups>
143-</Root>
144diff --git a/gui/user-switch-applet/Makefile.am b/gui/user-switch-applet/Makefile.am
145deleted file mode 100644
146index 2d2cdc0..0000000
147--- a/gui/user-switch-applet/Makefile.am
148+++ /dev/null
149@@ -1,67 +0,0 @@
150-NULL =
151-
152-AM_CPPFLAGS = \
153- -I$(top_srcdir)/gui/simple-greeter \
154- -I$(top_srcdir)/common \
155- -DPREFIX=\""$(prefix)"\" \
156- -DLIBDIR=\""$(libdir)"\" \
157- -DDATADIR=\""$(datadir)"\" \
158- -DSYSCONFDIR=\""$(sysconfdir)"\" \
159- -DLIBLOCALEDIR=\""$(prefix)/lib/locale"\" \
160- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
161- -DGLADEDIR=\""$(pkgdatadir)"\" \
162- -DLIBEXECDIR=\""$(libexecdir)"\" \
163- -DSBINDIR=\""$(sbindir)"\" \
164- -DGDMCONFDIR=\"$(gdmconfdir)\" \
165- $(GTK_CFLAGS) \
166- $(APPLET_CFLAGS) \
167- $(NULL)
168-
169-libexec_PROGRAMS = \
170- gdm-user-switch-applet \
171- $(NULL)
172-
173-gdm_user_switch_applet_SOURCES = \
174- applet.c \
175- gdm-entry-menu-item.h \
176- gdm-entry-menu-item.c \
177- $(NULL)
178-
179-gdm_user_switch_applet_LDADD = \
180- $(top_builddir)/gui/simple-greeter/libgdmuser.la \
181- $(top_builddir)/common/libgdmcommon.la \
182- $(COMMON_LIBS) \
183- $(APPLET_LIBS) \
184- $(NULL)
185-
186-# Bonobo UI
187-uidir = $(datadir)/gnome-2.0/ui
188-ui_DATA = \
189- GNOME_FastUserSwitchApplet.xml \
190- $(NULL)
191-
192-# Bonobo .server
193-serverdir = $(libdir)/bonobo/servers
194-server_in_files = \
195- GNOME_FastUserSwitchApplet.server.in \
196- $(NULL)
197-server_DATA = $(server_in_files:.server.in=.server)
198-
199-$(server_in_files): $(server_in_files:.server.in=.server.in.in)
200- sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" -e "s|\@VERSION\@|$(VERSION)|" $< > $@
201-
202-@INTLTOOL_SERVER_RULE@
203-
204-EXTRA_DIST = \
205- $(ui_DATA) \
206- GNOME_FastUserSwitchApplet.server.in.in \
207- $(NULL)
208-
209-DISTCLEANFILES = \
210- $(server_in_files) \
211- $(server_DATA) \
212- $(NULL)
213-
214-MAINTAINERCLEANFILES = \
215- *~ \
216- Makefile.in
217diff --git a/gui/user-switch-applet/applet.c b/gui/user-switch-applet/applet.c
218deleted file mode 100644
219index b4f944c..0000000
220--- a/gui/user-switch-applet/applet.c
221+++ /dev/null
222@@ -1,1662 +0,0 @@
223-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
224- *
225- * Copyright (C) 2004-2005 James M. Cape <jcape@ignore-your.tv>.
226- * Copyright (C) 2008 Red Hat, Inc.
227- *
228- * This program is free software; you can redistribute it and/or modify
229- * it under the terms of the GNU General Public License as published by
230- * the Free Software Foundation; either version 2 of the License, or
231- * (at your option) any later version.
232- *
233- * This program is distributed in the hope that it will be useful,
234- * but WITHOUT ANY WARRANTY; without even the implied warranty of
235- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
236- * GNU General Public License for more details.
237- *
238- * You should have received a copy of the GNU General Public License
239- * along with this program; if not, write to the Free Software
240- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
241- */
242-
243-#include "config.h"
244-
245-#include <string.h>
246-#include <unistd.h>
247-#include <stdlib.h>
248-#include <sys/types.h>
249-
250-#include <glib/gi18n.h>
251-#include <gdk/gdkkeysyms.h>
252-#include <gtk/gtk.h>
253-
254-#include <gconf/gconf.h>
255-#include <gconf/gconf-client.h>
256-
257-#include <dbus/dbus-glib.h>
258-
259-#include <bonobo/bonobo-main.h>
260-#include <bonobo/bonobo-ui-util.h>
261-
262-#include <panel-applet.h>
263-#include <panel-applet-gconf.h>
264-
265-#include "gdm-user-manager.h"
266-#include "gdm-entry-menu-item.h"
267-#include "gdm-settings-client.h"
268-
269-#define LOCKDOWN_DIR "/desktop/gnome/lockdown"
270-#define LOCKDOWN_USER_SWITCHING_KEY LOCKDOWN_DIR "/disable_user_switching"
271-#define LOCKDOWN_LOCK_SCREEN_KEY LOCKDOWN_DIR "/disable_lock_screen"
272-#define LOCKDOWN_COMMAND_LINE_KEY LOCKDOWN_DIR "/disable_command_line"
273-
274-typedef enum {
275- GSM_PRESENCE_STATUS_AVAILABLE = 0,
276- GSM_PRESENCE_STATUS_INVISIBLE,
277- GSM_PRESENCE_STATUS_BUSY,
278- GSM_PRESENCE_STATUS_IDLE,
279-} GsmPresenceStatus;
280-
281-typedef struct _GdmAppletData
282-{
283- PanelApplet *applet;
284-
285- GConfClient *client;
286- GdmUserManager *manager;
287- GdmUser *user;
288-
289- GtkWidget *menubar;
290- GtkWidget *menuitem;
291- GtkWidget *menu;
292-#ifdef BUILD_PRESENSE_STUFF
293- GtkWidget *user_item;
294-#endif
295- GtkWidget *control_panel_item;
296- GtkWidget *account_item;
297- GtkWidget *lock_screen_item;
298- GtkWidget *login_screen_item;
299- GtkWidget *quit_session_item;
300-
301- guint client_notify_lockdown_id;
302-
303- guint current_status;
304- guint user_loaded_notify_id;
305- guint user_changed_notify_id;
306- gint8 pixel_size;
307- gint panel_size;
308- GtkIconSize icon_size;
309-#ifdef BUILD_PRESENSE_STUFF
310- DBusGProxy *presence_proxy;
311-#endif
312-} GdmAppletData;
313-
314-typedef struct _SelectorResponseData
315-{
316- GdmAppletData *adata;
317- GtkRadioButton *radio;
318-} SelectorResponseData;
319-
320-static void reset_icon (GdmAppletData *adata);
321-static void update_label (GdmAppletData *adata);
322-
323-static gboolean applet_factory (PanelApplet *applet,
324- const char *iid,
325- gpointer data);
326-
327-PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_FastUserSwitchApplet_Factory",
328- PANEL_TYPE_APPLET,
329- "gdm-user-switch-applet", "0",
330- (PanelAppletFactoryCallback)applet_factory,
331- NULL)
332-
333-static void
334-about_me_cb (BonoboUIComponent *ui_container,
335- gpointer data,
336- const char *cname)
337-{
338- GError *err;
339-
340- err = NULL;
341- if (! g_spawn_command_line_async ("gnome-about-me", &err)) {
342- g_critical ("Could not run `gnome-about-me': %s",
343- err->message);
344- g_error_free (err);
345- bonobo_ui_component_set_prop (ui_container,
346- "/commands/GdmAboutMe",
347- "hidden", "1",
348- NULL);
349- }
350-}
351-
352-/*
353- * gnome-panel/applets/wncklet/window-menu.c:window_filter_button_press()
354- *
355- * Copyright (C) 2005 James M. Cape.
356- * Copyright (C) 2003 Sun Microsystems, Inc.
357- * Copyright (C) 2001 Free Software Foundation, Inc.
358- * Copyright (C) 2000 Helix Code, Inc.
359- */
360-static gboolean
361-menubar_button_press_event_cb (GtkWidget *menubar,
362- GdkEventButton *event,
363- GdmAppletData *adata)
364-{
365- if (event->button != 1) {
366- g_signal_stop_emission_by_name (menubar, "button-press-event");
367- /* Reset the login window item */
368- }
369-
370- return FALSE;
371-}
372-
373-static void
374-about_cb (BonoboUIComponent *ui_container,
375- gpointer data,
376- const char *cname)
377-{
378- static const char *authors[] = {
379- "James M. Cape <jcape@ignore-your.tv>",
380- "Thomas Thurman <thomas@thurman.org.uk>",
381- "William Jon McCann <jmccann@redhat.com>",
382- NULL
383- };
384- static char *license[] = {
385- N_("The User Switch Applet is free software; you can redistribute it and/or modify "
386- "it under the terms of the GNU General Public License as published by "
387- "the Free Software Foundation; either version 2 of the License, or "
388- "(at your option) any later version."),
389- N_("This program is distributed in the hope that it will be useful, "
390- "but WITHOUT ANY WARRANTY; without even the implied warranty of "
391- "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the "
392- "GNU General Public License for more details."),
393- N_("You should have received a copy of the GNU General Public License "
394- "along with this program; if not, write to the Free Software "
395- "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA "),
396- NULL
397- };
398- char *license_i18n;
399-
400- license_i18n = g_strconcat (_(license[0]), "\n\n", _(license[1]), "\n\n", _(license[2]), NULL);
401-
402- gtk_show_about_dialog (NULL,
403- "version", VERSION,
404- "copyright", "Copyright \xc2\xa9 2004-2005 James M. Cape.\n"
405- "Copyright \xc2\xa9 2006 Thomas Thurman.\n"
406- "Copyright \xc2\xa9 2008 Red Hat, Inc.",
407- "comments", _("A menu to quickly switch between users."),
408- "authors", authors,
409- "license", license_i18n,
410- "wrap-license", TRUE,
411- "translator-credits", _("translator-credits"),
412- "logo-icon-name", "stock_people",
413- NULL);
414-
415- g_free (license_i18n);
416-}
417-
418-
419-static void
420-admin_cb (BonoboUIComponent *ui_container,
421- gpointer data,
422- const char *cname)
423-{
424-#ifdef USERS_ADMIN
425- char **args;
426- gboolean res;
427- GError *err;
428-
429- err = NULL;
430- if (!g_shell_parse_argv (USERS_ADMIN, NULL, &args, &err)) {
431- g_critical ("Could not parse users and groups management command line `%s': %s",
432- USERS_ADMIN, err->message);
433- return;
434- }
435-
436- res = g_spawn_async (g_get_home_dir (),
437- args,
438- NULL,
439- (G_SPAWN_STDOUT_TO_DEV_NULL |
440- G_SPAWN_STDERR_TO_DEV_NULL |
441- G_SPAWN_SEARCH_PATH),
442- NULL,
443- NULL,
444- NULL,
445- &err);
446- if (! res) {
447- g_critical ("Could not run `%s' to manage users and groups: %s",
448- USERS_ADMIN, err->message);
449- g_error_free (err);
450- }
451- g_strfreev (args);
452-#endif /* USERS_ADMIN */
453-}
454-
455-static void
456-set_menuitem_icon (BonoboUIComponent *component,
457- const char *item_path,
458- GtkIconTheme *theme,
459- const char *icon_name,
460- gint icon_size)
461-{
462- GdkPixbuf *pixbuf;
463- int width;
464- int height;
465-
466- pixbuf = gtk_icon_theme_load_icon (theme, icon_name, icon_size, 0, NULL);
467- if (pixbuf == NULL) {
468- return;
469- }
470-
471- width = gdk_pixbuf_get_width (pixbuf);
472- height = gdk_pixbuf_get_height (pixbuf);
473- if (width > icon_size + 4 || height > icon_size + 4) {
474- GdkPixbuf *tmp;
475- if (height > width) {
476- width *= (gdouble) icon_size / (gdouble) height;
477- height = icon_size;
478- } else {
479- height *= (gdouble) icon_size / (gdouble) width;
480- width = icon_size;
481- }
482- tmp = gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR);
483- g_object_unref (pixbuf);
484- pixbuf = tmp;
485- }
486-
487- bonobo_ui_util_set_pixbuf (component, item_path, pixbuf, NULL);
488- g_object_unref (pixbuf);
489-}
490-
491-static void
492-applet_style_set_cb (GtkWidget *widget,
493- GtkStyle *old_style,
494- gpointer data)
495-{
496- BonoboUIComponent *component;
497- GdkScreen *screen;
498- GtkIconTheme *theme;
499- int width;
500- int height;
501- int icon_size;
502-
503- if (gtk_widget_has_screen (widget)) {
504- screen = gtk_widget_get_screen (widget);
505- } else {
506- screen = gdk_screen_get_default ();
507- }
508-
509- if (gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
510- GTK_ICON_SIZE_MENU, &width, &height)) {
511- icon_size = MAX (width, height);
512- } else {
513- icon_size = 16;
514- }
515-
516- theme = gtk_icon_theme_get_for_screen (screen);
517- component = panel_applet_get_popup_component (PANEL_APPLET (widget));
518-
519- set_menuitem_icon (component,
520- "/commands/GdmAboutMe",
521- theme,
522- "user-info",
523- icon_size);
524- set_menuitem_icon (component,
525- "/commands/GdmUsersGroupsAdmin",
526- theme,
527- "stock_people",
528- icon_size);
529-}
530-
531-static void
532-applet_change_background_cb (PanelApplet *applet,
533- PanelAppletBackgroundType type,
534- GdkColor *color,
535- GdkPixmap *pixmap,
536- GdmAppletData *adata)
537-{
538- GtkRcStyle *rc_style;
539- GtkStyle *style;
540-
541- gtk_widget_set_style (adata->menubar, NULL);
542- rc_style = gtk_rc_style_new ();
543- gtk_widget_modify_style (GTK_WIDGET (adata->menubar), rc_style);
544- g_object_unref (rc_style);
545-
546- switch (type) {
547- case PANEL_NO_BACKGROUND:
548- break;
549- case PANEL_COLOR_BACKGROUND:
550- gtk_widget_modify_bg (adata->menubar, GTK_STATE_NORMAL, color);
551- break;
552- case PANEL_PIXMAP_BACKGROUND:
553- style = gtk_style_copy (gtk_widget_get_style (adata->menubar));
554- if (style->bg_pixmap[GTK_STATE_NORMAL]) {
555- g_object_unref (style->bg_pixmap[GTK_STATE_NORMAL]);
556- }
557-
558- style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref (pixmap);
559- gtk_widget_set_style (adata->menubar, style);
560- g_object_unref (style);
561- break;
562- }
563-}
564-
565-/*
566- * gnome-panel/applets/wncklet/window-menu.c:window_menu_key_press_event()
567- *
568- * Copyright (C) 2003 Sun Microsystems, Inc.
569- * Copyright (C) 2001 Free Software Foundation, Inc.
570- * Copyright (C) 2000 Helix Code, Inc.
571- */
572-static gboolean
573-applet_key_press_event_cb (GtkWidget *widget,
574- GdkEventKey *event,
575- GdmAppletData *adata)
576-{
577- GtkMenuShell *menu_shell;
578-
579- switch (event->keyval) {
580- case GDK_KP_Enter:
581- case GDK_ISO_Enter:
582- case GDK_3270_Enter:
583- case GDK_Return:
584- case GDK_space:
585- case GDK_KP_Space:
586- menu_shell = GTK_MENU_SHELL (adata->menubar);
587- /*
588- * We need to call _gtk_menu_shell_activate() here as is done in
589- * window_key_press_handler in gtkmenubar.c which pops up menu
590- * when F10 is pressed.
591- *
592- * As that function is private its code is replicated here.
593- */
594- if (!menu_shell->active) {
595- gtk_grab_add (GTK_WIDGET (menu_shell));
596- menu_shell->have_grab = TRUE;
597- menu_shell->active = TRUE;
598- }
599-
600- gtk_menu_shell_select_first (menu_shell, FALSE);
601- return TRUE;
602- default:
603- break;
604- }
605-
606- return FALSE;
607-}
608-
609-static void
610-set_item_text_angle_and_alignment (GtkWidget *item,
611- double text_angle,
612- float xalign,
613- float yalign)
614-{
615- GtkWidget *label;
616-
617- label = gtk_bin_get_child (GTK_BIN (item));
618-
619- gtk_label_set_angle (GTK_LABEL (label), text_angle);
620-
621- gtk_misc_set_alignment (GTK_MISC (label), xalign, yalign);
622-}
623-
624-/*
625- * gnome-panel/applets/wncklet/window-menu.c:window_menu_size_allocate()
626- *
627- * Copyright (C) 2003 Sun Microsystems, Inc.
628- * Copyright (C) 2001 Free Software Foundation, Inc.
629- * Copyright (C) 2000 Helix Code, Inc.
630- */
631-static void
632-applet_size_allocate_cb (GtkWidget *widget,
633- GtkAllocation *allocation,
634- GdmAppletData *adata)
635-{
636- GList *children;
637- GtkWidget *top_item;
638- PanelAppletOrient orient;
639- gint pixel_size;
640- gdouble text_angle;
641- GtkPackDirection pack_direction;
642- float text_xalign;
643- float text_yalign;
644-
645- pack_direction = GTK_PACK_DIRECTION_LTR;
646- text_angle = 0.0;
647- text_xalign = 0.0;
648- text_yalign = 0.5;
649-
650- children = gtk_container_get_children (GTK_CONTAINER (adata->menubar));
651- top_item = GTK_WIDGET (children->data);
652- g_list_free (children);
653-
654- orient = panel_applet_get_orient (PANEL_APPLET (widget));
655-
656- switch (orient) {
657- case PANEL_APPLET_ORIENT_UP:
658- case PANEL_APPLET_ORIENT_DOWN:
659- gtk_widget_set_size_request (top_item, -1, allocation->height);
660- pixel_size = allocation->height - gtk_widget_get_style (top_item)->ythickness * 2;
661- break;
662- case PANEL_APPLET_ORIENT_LEFT:
663- gtk_widget_set_size_request (top_item, allocation->width, -1);
664- pixel_size = allocation->width - gtk_widget_get_style (top_item)->xthickness * 2;
665- pack_direction = GTK_PACK_DIRECTION_TTB;
666- text_angle = 270.0;
667- text_xalign = 0.5;
668- text_yalign = 0.0;
669- break;
670- case PANEL_APPLET_ORIENT_RIGHT:
671- gtk_widget_set_size_request (top_item, allocation->width, -1);
672- pixel_size = allocation->width - gtk_widget_get_style (top_item)->xthickness * 2;
673- pack_direction = GTK_PACK_DIRECTION_BTT;
674- text_angle = 90.0;
675- text_xalign = 0.5;
676- text_yalign = 0.0;
677- break;
678- default:
679- g_assert_not_reached ();
680- break;
681- }
682-
683- gtk_menu_bar_set_pack_direction (GTK_MENU_BAR (adata->menubar),
684- pack_direction);
685- gtk_menu_bar_set_child_pack_direction (GTK_MENU_BAR (adata->menubar),
686- pack_direction);
687-
688- set_item_text_angle_and_alignment (adata->menuitem,
689- text_angle,
690- text_xalign,
691- text_yalign);
692-
693- if (adata->panel_size != pixel_size) {
694- adata->panel_size = pixel_size;
695- reset_icon (adata);
696- }
697-}
698-
699-
700-static void
701-gdm_applet_data_free (GdmAppletData *adata)
702-{
703- gconf_client_notify_remove (adata->client, adata->client_notify_lockdown_id);
704-
705- if (adata->user_loaded_notify_id != 0) {
706- g_signal_handler_disconnect (adata->user, adata->user_loaded_notify_id);
707- }
708-
709- if (adata->user_changed_notify_id != 0) {
710- g_signal_handler_disconnect (adata->user, adata->user_changed_notify_id);
711- }
712-
713-#ifdef BUILD_PRESENSE_STUFF
714- if (adata->presence_proxy != NULL) {
715- g_object_unref (adata->presence_proxy);
716- }
717-#endif
718-
719- if (adata->user != NULL) {
720- g_object_unref (adata->user);
721- }
722- g_object_unref (adata->client);
723- g_object_unref (adata->manager);
724-
725- g_free (adata);
726-}
727-
728-
729-/*
730- * gnome-panel/applets/wncklet/window-menu.c:window_menu_on_expose()
731- *
732- * Copyright (C) 2003 Sun Microsystems, Inc.
733- * Copyright (C) 2001 Free Software Foundation, Inc.
734- * Copyright (C) 2000 Helix Code, Inc.
735- */
736-static gboolean
737-menubar_expose_event_cb (GtkWidget *widget,
738- GdkEventExpose *event,
739- GdmAppletData *adata)
740-{
741- if (gtk_widget_has_focus (GTK_WIDGET (adata->applet)))
742- gtk_paint_focus (gtk_widget_get_style (widget),
743- gtk_widget_get_window (widget),
744- gtk_widget_get_state (widget),
745- NULL, widget, "menu-applet", 0, 0, -1, -1);
746-
747- return FALSE;
748-}
749-
750-static void
751-menu_style_set_cb (GtkWidget *menu,
752- GtkStyle *old_style,
753- GdmAppletData *adata)
754-{
755- GtkSettings *settings;
756- int width;
757- int height;
758-
759- adata->icon_size = gtk_icon_size_from_name ("panel-menu");
760-
761- if (adata->icon_size == GTK_ICON_SIZE_INVALID) {
762- adata->icon_size = gtk_icon_size_register ("panel-menu", 24, 24);
763- }
764-
765- if (gtk_widget_has_screen (menu)) {
766- settings = gtk_settings_get_for_screen (gtk_widget_get_screen (menu));
767- } else {
768- settings = gtk_settings_get_default ();
769- }
770-
771- if (!gtk_icon_size_lookup_for_settings (settings, adata->icon_size,
772- &width, &height)) {
773- adata->pixel_size = -1;
774- } else {
775- adata->pixel_size = MAX (width, height);
776- }
777-}
778-
779-static void
780-menuitem_style_set_cb (GtkWidget *menuitem,
781- GtkStyle *old_style,
782- GdmAppletData *adata)
783-{
784- GtkWidget *image;
785-
786- if (GDM_IS_ENTRY_MENU_ITEM (menuitem)) {
787- } else {
788- const char *icon_name;
789-
790- if (menuitem == adata->login_screen_item) {
791- icon_name = "system-users";
792- } else if (menuitem == adata->lock_screen_item) {
793- icon_name = "system-lock-screen";
794- } else if (menuitem == adata->quit_session_item) {
795- icon_name = "system-log-out";
796- } else if (menuitem == adata->account_item) {
797- icon_name = "user-info";
798- } else if (menuitem == adata->control_panel_item) {
799- icon_name = "preferences-desktop";
800- } else {
801- icon_name = GTK_STOCK_MISSING_IMAGE;
802- }
803-
804- image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (menuitem));
805- gtk_image_set_pixel_size (GTK_IMAGE (image), adata->pixel_size);
806- gtk_image_set_from_icon_name (GTK_IMAGE (image), icon_name,
807- adata->icon_size);
808- }
809-}
810-
811-static void
812-on_user_changed (GdmUser *user,
813- GdmAppletData *adata)
814-{
815- g_debug ("user changed");
816- update_label (adata);
817- reset_icon (adata);
818-}
819-
820-/* Called every time the menu is displayed (and also for some reason
821- * immediately it's created, which does no harm). All we have to do
822- * here is kick off a request to GDM to let us know which users are
823- * logged in, so we can display check marks next to their names.
824- */
825-static gboolean
826-menu_expose_cb (GtkWidget *menu,
827- gpointer data)
828-{
829- char *program;
830- GdmAppletData *adata = data;
831-
832- program = g_find_program_in_path ("gnome-control-center");
833- if (program != NULL) {
834- gtk_widget_show (adata->control_panel_item);
835- } else {
836- gtk_widget_hide (adata->control_panel_item);
837- }
838- g_free (program);
839- return FALSE;
840-}
841-
842-static void
843-maybe_lock_screen (GdmAppletData *adata)
844-{
845- char *args[3];
846- GError *err;
847- GdkScreen *screen;
848- gboolean use_gscreensaver = TRUE;
849- gboolean res;
850-
851- g_debug ("Attempting to lock screen");
852-
853- args[0] = g_find_program_in_path ("gnome-screensaver-command");
854- if (args[0] == NULL) {
855- args[0] = g_find_program_in_path ("xscreensaver-command");
856- use_gscreensaver = FALSE;
857- }
858-
859- if (args[0] == NULL) {
860- return;
861- }
862-
863- if (use_gscreensaver) {
864- args[1] = "--lock";
865- } else {
866- args[1] = "-lock";
867- }
868- args[2] = NULL;
869-
870- if (gtk_widget_has_screen (GTK_WIDGET (adata->applet))) {
871- screen = gtk_widget_get_screen (GTK_WIDGET (adata->applet));
872- } else {
873- screen = gdk_screen_get_default ();
874- }
875-
876- err = NULL;
877- res = gdk_spawn_on_screen (screen,
878- g_get_home_dir (),
879- args,
880- NULL,
881- 0,
882- NULL,
883- NULL,
884- NULL,
885- &err);
886- if (! res) {
887- g_warning (_("Can't lock screen: %s"), err->message);
888- g_error_free (err);
889- }
890-
891- if (use_gscreensaver) {
892- args[1] = "--throttle";
893- } else {
894- args[1] = "-throttle";
895- }
896-
897- err = NULL;
898- res = gdk_spawn_on_screen (screen,
899- g_get_home_dir (),
900- args,
901- NULL,
902- (G_SPAWN_STDERR_TO_DEV_NULL
903- | G_SPAWN_STDOUT_TO_DEV_NULL),
904- NULL,
905- NULL,
906- NULL,
907- &err);
908- if (! res) {
909- g_warning (_("Can't temporarily set screensaver to blank screen: %s"),
910- err->message);
911- g_error_free (err);
912- }
913-
914- g_free (args[0]);
915-}
916-
917-static void
918-do_switch (GdmAppletData *adata,
919- GdmUser *user)
920-{
921- guint num_sessions;
922-
923- g_debug ("Do user switch");
924-
925- if (user == NULL) {
926- gdm_user_manager_goto_login_session (adata->manager);
927- goto out;
928- }
929-
930- num_sessions = gdm_user_get_num_sessions (user);
931- if (num_sessions > 0) {
932- gdm_user_manager_activate_user_session (adata->manager, user);
933- } else {
934- gdm_user_manager_goto_login_session (adata->manager);
935- }
936- out:
937- maybe_lock_screen (adata);
938-}
939-
940-static void
941-update_switch_user (GdmAppletData *adata)
942-{
943- gboolean can_switch;
944- gboolean has_other_users;
945-
946- can_switch = gdm_user_manager_can_switch (adata->manager);
947- g_object_get (adata->manager,
948- "has-multiple-users", &has_other_users,
949- NULL);
950-
951- if (can_switch && has_other_users) {
952- gtk_widget_show (adata->login_screen_item);
953- } else {
954-
955- gtk_widget_hide (adata->login_screen_item);
956- }
957-}
958-
959-static void
960-on_manager_is_loaded_changed (GdmUserManager *manager,
961- GParamSpec *pspec,
962- GdmAppletData *adata)
963-{
964- update_switch_user (adata);
965-}
966-
967-static void
968-on_manager_has_multiple_users_changed (GdmUserManager *manager,
969- GParamSpec *pspec,
970- GdmAppletData *adata)
971-{
972- update_switch_user (adata);
973-}
974-
975-#ifdef BUILD_PRESENSE_STUFF
976-static void
977-on_user_item_activate (GtkMenuItem *item,
978- GdmAppletData *adata)
979-{
980- g_signal_stop_emission_by_name (item, "activate");
981-}
982-#endif
983-
984-static void
985-on_control_panel_activate (GtkMenuItem *item,
986- GdmAppletData *adata)
987-{
988- char *args[2];
989- GError *error;
990- GdkScreen *screen;
991- gboolean res;
992-
993- args[0] = g_find_program_in_path ("gnome-control-center");
994- if (args[0] == NULL) {
995- return;
996- }
997- args[1] = NULL;
998-
999- if (gtk_widget_has_screen (GTK_WIDGET (adata->applet))) {
1000- screen = gtk_widget_get_screen (GTK_WIDGET (adata->applet));
1001- } else {
1002- screen = gdk_screen_get_default ();
1003- }
1004-
1005- error = NULL;
1006- res = gdk_spawn_on_screen (screen,
1007- g_get_home_dir (),
1008- args,
1009- NULL,
1010- 0,
1011- NULL,
1012- NULL,
1013- NULL,
1014- &error);
1015- if (! res) {
1016- g_warning (_("Can't lock screen: %s"), error->message);
1017- g_error_free (error);
1018- }
1019-
1020- g_free (args[0]);
1021-}
1022-
1023-static void
1024-on_account_activate (GtkMenuItem *item,
1025- GdmAppletData *adata)
1026-{
1027- char *args[2];
1028- GError *error;
1029- GdkScreen *screen;
1030- gboolean res;
1031-
1032- args[0] = g_find_program_in_path ("accounts-dialog");
1033- if (args[0] == NULL) {
1034- args[0] = g_find_program_in_path ("gnome-about-me");
1035- if (args[0] == NULL) {
1036- return;
1037- }
1038- }
1039- args[1] = NULL;
1040-
1041- if (gtk_widget_has_screen (GTK_WIDGET (adata->applet))) {
1042- screen = gtk_widget_get_screen (GTK_WIDGET (adata->applet));
1043- } else {
1044- screen = gdk_screen_get_default ();
1045- }
1046-
1047- error = NULL;
1048- res = gdk_spawn_on_screen (screen,
1049- g_get_home_dir (),
1050- args,
1051- NULL,
1052- 0,
1053- NULL,
1054- NULL,
1055- NULL,
1056- &error);
1057- if (! res) {
1058- g_warning (_("Can't lock screen: %s"), error->message);
1059- g_error_free (error);
1060- }
1061-
1062- g_free (args[0]);
1063-}
1064-
1065-static void
1066-on_lock_screen_activate (GtkMenuItem *item,
1067- GdmAppletData *adata)
1068-{
1069- maybe_lock_screen (adata);
1070-}
1071-
1072-static void
1073-on_login_screen_activate (GtkMenuItem *item,
1074- GdmAppletData *adata)
1075-{
1076- GdmUser *user;
1077-
1078- user = NULL;
1079-
1080- do_switch (adata, user);
1081-}
1082-
1083-static void
1084-on_quit_session_activate (GtkMenuItem *item,
1085- GdmAppletData *adata)
1086-{
1087- char *args[3];
1088- GError *error;
1089- GdkScreen *screen;
1090- gboolean res;
1091-
1092- args[0] = g_find_program_in_path ("gnome-session-save");
1093- if (args[0] == NULL) {
1094- return;
1095- }
1096-
1097- args[1] = "--logout-dialog";
1098- args[2] = NULL;
1099-
1100- if (gtk_widget_has_screen (GTK_WIDGET (adata->applet))) {
1101- screen = gtk_widget_get_screen (GTK_WIDGET (adata->applet));
1102- } else {
1103- screen = gdk_screen_get_default ();
1104- }
1105-
1106- error = NULL;
1107- res = gdk_spawn_on_screen (screen,
1108- g_get_home_dir (),
1109- args,
1110- NULL,
1111- 0,
1112- NULL,
1113- NULL,
1114- NULL,
1115- &error);
1116- if (! res) {
1117- g_warning (_("Can't log out: %s"), error->message);
1118- g_error_free (error);
1119- }
1120-
1121- g_free (args[0]);
1122-}
1123-
1124-#ifdef BUILD_PRESENSE_STUFF
1125-static gboolean
1126-on_menu_key_press_event (GtkWidget *widget,
1127- GdkEventKey *event,
1128- GdmAppletData *adata)
1129-{
1130- GtkWidget *entry;
1131-
1132- entry = gdm_entry_menu_item_get_entry (GDM_ENTRY_MENU_ITEM (adata->user_item));
1133-
1134- if (GTK_WIDGET_HAS_FOCUS (entry)) {
1135- gtk_widget_event (entry, (GdkEvent *)event);
1136- return TRUE;
1137- } else {
1138- return FALSE;
1139- }
1140-}
1141-
1142-static void
1143-save_status (GdmAppletData *adata,
1144- guint status)
1145-{
1146- if (adata->current_status != status) {
1147- GError *error;
1148-
1149- adata->current_status = status;
1150-
1151- g_debug ("Saving status: %u", status);
1152- error = NULL;
1153- dbus_g_proxy_call (adata->presence_proxy,
1154- "SetStatus",
1155- &error,
1156- G_TYPE_UINT, status,
1157- G_TYPE_INVALID,
1158- G_TYPE_INVALID);
1159-
1160- if (error != NULL) {
1161- g_warning ("Couldn't save presence status: %s", error->message);
1162- g_error_free (error);
1163- }
1164- }
1165-}
1166-
1167-static void
1168-on_status_available_activate (GtkWidget *widget,
1169- GdmAppletData *adata)
1170-{
1171-
1172- if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget))) {
1173- save_status (adata, GSM_PRESENCE_STATUS_AVAILABLE);
1174- }
1175-}
1176-
1177-static void
1178-on_status_busy_activate (GtkWidget *widget,
1179- GdmAppletData *adata)
1180-{
1181- if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget))) {
1182- save_status (adata, GSM_PRESENCE_STATUS_BUSY);
1183- }
1184-}
1185-
1186-static void
1187-on_status_invisible_activate (GtkWidget *widget,
1188- GdmAppletData *adata)
1189-{
1190- if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget))) {
1191- save_status (adata, GSM_PRESENCE_STATUS_INVISIBLE);
1192- }
1193-}
1194-
1195-static struct {
1196- char *icon_name;
1197- char *display_name;
1198- void *menu_callback;
1199- GtkWidget *widget;
1200-} statuses[] = {
1201- { "user-online", N_("Available"), on_status_available_activate, NULL },
1202- { "user-invisible", N_("Invisible"), on_status_invisible_activate, NULL },
1203- { "user-busy", N_("Busy"), on_status_busy_activate, NULL },
1204- { "user-away", N_("Away"), NULL, NULL },
1205-};
1206-#endif
1207-
1208-static void
1209-update_label (GdmAppletData *adata)
1210-{
1211- GtkWidget *label;
1212- char *markup;
1213-
1214- label = gtk_bin_get_child (GTK_BIN (adata->menuitem));
1215-
1216-#ifdef BUILD_PRESENSE_STUFF
1217- markup = g_strdup_printf ("<b>%s</b> <small>(%s)</small>",
1218- gdm_user_get_real_name (GDM_USER (adata->user)),
1219- _(statuses[adata->current_status].display_name));
1220-#else
1221- markup = g_strdup_printf ("<b>%s</b>",
1222- gdm_user_get_real_name (GDM_USER (adata->user)));
1223-#endif
1224- gtk_label_set_markup (GTK_LABEL (label), markup);
1225- g_free (markup);
1226-}
1227-
1228-#ifdef BUILD_PRESENSE_STUFF
1229-static void
1230-save_status_text (GdmAppletData *adata)
1231-{
1232- GtkWidget *entry;
1233- GtkTextBuffer *buffer;
1234- char *escaped_text;
1235- char *text;
1236- GtkTextIter start, end;
1237-
1238- entry = gdm_entry_menu_item_get_entry (GDM_ENTRY_MENU_ITEM (adata->user_item));
1239- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (entry));
1240- gtk_text_buffer_get_bounds (buffer, &start, &end);
1241- text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
1242- escaped_text = g_markup_escape_text (text, -1);
1243-
1244- if (escaped_text != NULL) {
1245- GError *error;
1246-
1247- error = NULL;
1248- dbus_g_proxy_call (adata->presence_proxy,
1249- "SetStatusText",
1250- &error,
1251- G_TYPE_STRING, escaped_text,
1252- G_TYPE_INVALID,
1253- G_TYPE_INVALID);
1254-
1255- if (error != NULL) {
1256- g_warning ("Couldn't set presence status text: %s", error->message);
1257- g_error_free (error);
1258- }
1259- }
1260-
1261- g_free (text);
1262- g_free (escaped_text);
1263-}
1264-
1265-static void
1266-on_user_item_deselect (GtkWidget *item,
1267- GdmAppletData *adata)
1268-{
1269- save_status_text (adata);
1270-}
1271-#endif
1272-
1273-static void
1274-create_sub_menu (GdmAppletData *adata)
1275-{
1276- GtkWidget *item;
1277-#ifdef BUILD_PRESENSE_STUFF
1278- int i;
1279- GSList *radio_group;
1280-#endif
1281-
1282- adata->menu = gtk_menu_new ();
1283-#ifdef BUILD_PRESENSE_STUFF
1284- g_signal_connect (adata->menu,
1285- "key-press-event",
1286- G_CALLBACK (on_menu_key_press_event),
1287- adata);
1288-#endif
1289- gtk_menu_item_set_submenu (GTK_MENU_ITEM (adata->menuitem), adata->menu);
1290- g_signal_connect (adata->menu, "style-set",
1291- G_CALLBACK (menu_style_set_cb), adata);
1292- g_signal_connect (adata->menu, "show",
1293- G_CALLBACK (menu_expose_cb), adata);
1294-
1295-#ifdef BUILD_PRESENSE_STUFF
1296- adata->user_item = gdm_entry_menu_item_new ();
1297- gtk_menu_shell_append (GTK_MENU_SHELL (adata->menu),
1298- adata->user_item);
1299- gtk_widget_show (adata->user_item);
1300- g_signal_connect (adata->user_item, "activate",
1301- G_CALLBACK (on_user_item_activate), adata);
1302- g_signal_connect (adata->user_item,
1303- "deselect",
1304- G_CALLBACK (on_user_item_deselect),
1305- adata);
1306-
1307- item = gtk_separator_menu_item_new ();
1308- gtk_menu_shell_append (GTK_MENU_SHELL (adata->menu), item);
1309- gtk_widget_show (item);
1310-
1311- radio_group = NULL;
1312- for (i = 0; i < G_N_ELEMENTS (statuses); i++) {
1313- GtkWidget *hbox;
1314- GtkWidget *label;
1315- GtkWidget *image;
1316- GtkWidget *item;
1317-
1318- if (statuses[i].menu_callback == NULL) {
1319- continue;
1320- }
1321-
1322- item = gtk_radio_menu_item_new (radio_group);
1323- radio_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
1324- hbox = gtk_hbox_new (FALSE, 3);
1325- label = gtk_label_new (_(statuses[i].display_name));
1326- gtk_label_set_justify (GTK_LABEL(label), GTK_JUSTIFY_LEFT);
1327- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
1328- gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
1329- gtk_widget_show (label);
1330- image = gtk_image_new_from_icon_name (statuses[i].icon_name, GTK_ICON_SIZE_MENU);
1331- gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, TRUE, 0);
1332- gtk_widget_show (image);
1333- gtk_widget_show (hbox);
1334- gtk_container_add (GTK_CONTAINER (item), hbox);
1335-
1336- gtk_menu_shell_append (GTK_MENU_SHELL (adata->menu),
1337- item);
1338- g_signal_connect (item, "activate",
1339- G_CALLBACK (statuses[i].menu_callback), adata);
1340- gtk_widget_show (item);
1341-
1342- statuses[i].widget = item;
1343- }
1344-
1345- item = gtk_separator_menu_item_new ();
1346- gtk_menu_shell_append (GTK_MENU_SHELL (adata->menu), item);
1347- gtk_widget_show (item);
1348-#endif
1349-
1350- adata->account_item = gtk_image_menu_item_new_with_label (_("Account Information"));
1351- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (adata->account_item),
1352- gtk_image_new ());
1353- gtk_menu_shell_append (GTK_MENU_SHELL (adata->menu),
1354- adata->account_item);
1355- g_signal_connect (adata->account_item, "style-set",
1356- G_CALLBACK (menuitem_style_set_cb), adata);
1357- g_signal_connect (adata->account_item, "activate",
1358- G_CALLBACK (on_account_activate), adata);
1359- gtk_widget_show (adata->account_item);
1360-
1361-
1362- adata->control_panel_item = gtk_image_menu_item_new_with_label (_("System Preferences"));
1363- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (adata->control_panel_item),
1364- gtk_image_new ());
1365- gtk_menu_shell_append (GTK_MENU_SHELL (adata->menu),
1366- adata->control_panel_item);
1367- g_signal_connect (adata->control_panel_item, "style-set",
1368- G_CALLBACK (menuitem_style_set_cb), adata);
1369- g_signal_connect (adata->control_panel_item, "activate",
1370- G_CALLBACK (on_control_panel_activate), adata);
1371-
1372- item = gtk_separator_menu_item_new ();
1373- gtk_menu_shell_append (GTK_MENU_SHELL (adata->menu), item);
1374- gtk_widget_show (item);
1375-
1376- adata->lock_screen_item = gtk_image_menu_item_new_with_label (_("Lock Screen"));
1377- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (adata->lock_screen_item),
1378- gtk_image_new ());
1379- gtk_menu_shell_append (GTK_MENU_SHELL (adata->menu),
1380- adata->lock_screen_item);
1381- g_signal_connect (adata->lock_screen_item, "style-set",
1382- G_CALLBACK (menuitem_style_set_cb), adata);
1383- g_signal_connect (adata->lock_screen_item, "activate",
1384- G_CALLBACK (on_lock_screen_activate), adata);
1385- /* Only show if not locked down */
1386-
1387- adata->login_screen_item = gtk_image_menu_item_new_with_label (_("Switch User"));
1388- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (adata->login_screen_item),
1389- gtk_image_new ());
1390- gtk_menu_shell_append (GTK_MENU_SHELL (adata->menu),
1391- adata->login_screen_item);
1392- g_signal_connect (adata->login_screen_item, "style-set",
1393- G_CALLBACK (menuitem_style_set_cb), adata);
1394- g_signal_connect (adata->login_screen_item, "activate",
1395- G_CALLBACK (on_login_screen_activate), adata);
1396- /* Only show switch user if there are other users */
1397-
1398- adata->quit_session_item = gtk_image_menu_item_new_with_label (_("Quit…"));
1399- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (adata->quit_session_item),
1400- gtk_image_new ());
1401- gtk_menu_shell_append (GTK_MENU_SHELL (adata->menu),
1402- adata->quit_session_item);
1403- g_signal_connect (adata->quit_session_item, "style-set",
1404- G_CALLBACK (menuitem_style_set_cb), adata);
1405- g_signal_connect (adata->quit_session_item, "activate",
1406- G_CALLBACK (on_quit_session_activate), adata);
1407- gtk_widget_show (adata->quit_session_item);
1408- gtk_widget_show (adata->menu);
1409-}
1410-
1411-static void
1412-destroy_sub_menu (GdmAppletData *adata)
1413-{
1414- gtk_menu_item_set_submenu (GTK_MENU_ITEM (adata->menuitem), NULL);
1415-}
1416-
1417-static void
1418-set_menu_visibility (GdmAppletData *adata,
1419- gboolean visible)
1420-{
1421-
1422- if (visible) {
1423- create_sub_menu (adata);
1424- } else {
1425- destroy_sub_menu (adata);
1426- }
1427-}
1428-
1429-static void
1430-client_notify_lockdown_func (GConfClient *client,
1431- guint cnxn_id,
1432- GConfEntry *entry,
1433- GdmAppletData *adata)
1434-{
1435- GConfValue *value;
1436- const char *key;
1437-
1438- value = gconf_entry_get_value (entry);
1439- key = gconf_entry_get_key (entry);
1440-
1441- if (value == NULL || key == NULL) {
1442- return;
1443- }
1444-
1445- if (strcmp (key, LOCKDOWN_USER_SWITCHING_KEY) == 0) {
1446- if (gconf_value_get_bool (value)) {
1447- set_menu_visibility (adata, FALSE);
1448- } else {
1449- set_menu_visibility (adata, TRUE);
1450- }
1451- } else if (strcmp (key, LOCKDOWN_LOCK_SCREEN_KEY) == 0) {
1452- if (gconf_value_get_bool (value)) {
1453- gtk_widget_hide (adata->lock_screen_item);
1454- } else {
1455- gtk_widget_show (adata->lock_screen_item);
1456- }
1457- }
1458-}
1459-
1460-static void
1461-reset_icon (GdmAppletData *adata)
1462-{
1463- GdkPixbuf *pixbuf;
1464- GtkWidget *image;
1465-
1466- if (adata->user == NULL || !gtk_widget_has_screen (GTK_WIDGET (adata->menuitem))) {
1467- return;
1468- }
1469-
1470-#ifdef BUILD_PRESENSE_STUFF
1471- if (adata->user_item != NULL) {
1472- image = gdm_entry_menu_item_get_image (GDM_ENTRY_MENU_ITEM (adata->user_item));
1473- pixbuf = gdm_user_render_icon (adata->user, adata->panel_size * 3);
1474- if (pixbuf == NULL) {
1475- return;
1476- }
1477-
1478- gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
1479- g_object_unref (pixbuf);
1480- }
1481-#else
1482- pixbuf = gdm_user_render_icon (adata->user, adata->panel_size);
1483-
1484- if (pixbuf == NULL) {
1485- return;
1486- }
1487-
1488- image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (adata->menuitem));
1489- gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
1490- g_object_unref (pixbuf);
1491-#endif
1492-}
1493-
1494-static void
1495-setup_current_user_now (GdmAppletData *adata)
1496-{
1497- g_assert (adata->user != NULL);
1498-
1499- if (adata->user_loaded_notify_id != 0) {
1500- g_signal_handler_disconnect (adata->user, adata->user_loaded_notify_id);
1501- }
1502- adata->user_loaded_notify_id = 0;
1503-
1504- update_label (adata);
1505- reset_icon (adata);
1506- adata->user_changed_notify_id =
1507- g_signal_connect (adata->user,
1508- "changed",
1509- G_CALLBACK (on_user_changed),
1510- adata);
1511-}
1512-
1513-static void
1514-on_current_user_loaded (GdmUser *user,
1515- GParamSpec *pspec,
1516- GdmAppletData *adata)
1517-{
1518- if (!gdm_user_is_loaded (user)) {
1519- return;
1520- }
1521-
1522- setup_current_user_now (adata);
1523-}
1524-
1525-static void
1526-setup_current_user (GdmAppletData *adata)
1527-{
1528- adata->user = gdm_user_manager_get_user_by_uid (adata->manager, getuid ());
1529-
1530- if (adata->user == NULL) {
1531- g_warning ("Could not setup current user");
1532- return;
1533- }
1534-
1535- g_object_ref (adata->user);
1536-
1537- adata->menuitem = gtk_image_menu_item_new_with_label ("");
1538-#ifndef BUILD_PRESENSE_STUFF
1539- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (adata->menuitem),
1540- gtk_image_new ());
1541-#endif
1542- gtk_menu_shell_append (GTK_MENU_SHELL (adata->menubar), adata->menuitem);
1543- gtk_widget_show (adata->menuitem);
1544-
1545- if (gdm_user_is_loaded (adata->user)) {
1546- setup_current_user_now (adata);
1547- return;
1548- }
1549-
1550- adata->user_loaded_notify_id = g_signal_connect (adata->user,
1551- "notify::is-loaded",
1552- G_CALLBACK (on_current_user_loaded),
1553- adata);
1554-}
1555-
1556-#ifdef BUILD_PRESENSE_STUFF
1557-static void
1558-set_status (GdmAppletData *adata,
1559- guint status)
1560-{
1561- int i;
1562-
1563- g_debug ("Setting current status: %u", status);
1564- adata->current_status = status;
1565- for (i = 0; i < G_N_ELEMENTS (statuses); i++) {
1566- if (statuses[i].widget == NULL) {
1567- continue;
1568- }
1569- if (i == status) {
1570- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (statuses[i].widget),
1571- TRUE);
1572- }
1573- }
1574-
1575- update_label (adata);
1576-}
1577-
1578-static void
1579-on_presence_status_changed (DBusGProxy *presence_proxy,
1580- guint status,
1581- GdmAppletData *adata)
1582-{
1583- g_debug ("Status changed: %u", status);
1584-
1585- set_status (adata, status);
1586-}
1587-
1588-static void
1589-set_status_text (GdmAppletData *adata,
1590- const char *status_text)
1591-{
1592- GtkWidget *entry;
1593- GtkTextBuffer *buffer;
1594-
1595- g_debug ("Status text changed: %s", status_text);
1596-
1597- entry = gdm_entry_menu_item_get_entry (GDM_ENTRY_MENU_ITEM (adata->user_item));
1598- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (entry));
1599- gtk_text_buffer_set_text (buffer, status_text, -1);
1600-}
1601-
1602-static void
1603-on_presence_status_text_changed (DBusGProxy *presence_proxy,
1604- const char *status_text,
1605- GdmAppletData *adata)
1606-{
1607- set_status_text (adata, status_text);
1608-}
1609-#endif
1610-
1611-static gboolean
1612-fill_applet (PanelApplet *applet)
1613-{
1614- static const BonoboUIVerb menu_verbs[] = {
1615- BONOBO_UI_VERB ("GdmAboutMe", about_me_cb),
1616- BONOBO_UI_VERB ("GdmUsersGroupsAdmin", admin_cb),
1617- BONOBO_UI_VERB ("GdmAbout", about_cb),
1618- BONOBO_UI_VERB_END
1619- };
1620- static gboolean first_time = FALSE;
1621- char *tmp;
1622- BonoboUIComponent *popup_component;
1623- GdmAppletData *adata;
1624- GError *error;
1625- DBusGConnection *bus;
1626-
1627- if (!first_time) {
1628- first_time = TRUE;
1629-
1630- /* Do this here so it's only done once. */
1631- gtk_rc_parse_string ("style \"gdm-user-switch-menubar-style\"\n"
1632- "{\n"
1633- "GtkMenuBar::shadow-type = none\n"
1634- "GtkMenuBar::internal-padding = 0\n"
1635- "}\n"
1636- "style \"gdm-user-switch-applet-style\"\n"
1637- "{\n"
1638- "GtkWidget::focus-line-width = 0\n"
1639- "GtkWidget::focus-padding = 0\n"
1640- "}\n"
1641- "widget \"*.gdm-user-switch-menubar\" style \"gdm-user-switch-menubar-style\"\n"
1642- "widget \"*.gdm-user-switch-applet\" style \"gdm-user-switch-applet-style\"\n");
1643- gtk_window_set_default_icon_name ("stock_people");
1644- g_set_application_name (_("User Switch Applet"));
1645-
1646- if (! gdm_settings_client_init (DATADIR "/gdm/gdm.schemas", "/")) {
1647- g_critical ("Unable to initialize settings client");
1648- exit (1);
1649- }
1650-
1651- }
1652-
1653- adata = g_new0 (GdmAppletData, 1);
1654- adata->applet = applet;
1655- adata->panel_size = 24;
1656-
1657- adata->client = gconf_client_get_default ();
1658-
1659- gtk_widget_set_tooltip_text (GTK_WIDGET (applet), _("Change account settings and status"));
1660- gtk_container_set_border_width (GTK_CONTAINER (applet), 0);
1661- gtk_widget_set_name (GTK_WIDGET (applet), "gdm-user-switch-applet");
1662- panel_applet_set_flags (applet, PANEL_APPLET_EXPAND_MINOR);
1663- panel_applet_setup_menu_from_file (applet, NULL,
1664- DATADIR "/gnome-2.0/ui/GNOME_FastUserSwitchApplet.xml",
1665- NULL, menu_verbs, adata);
1666-
1667- popup_component = panel_applet_get_popup_component (applet);
1668-
1669- /* Hide the admin context menu items if locked down or no cmd-line */
1670- if (gconf_client_get_bool (adata->client,
1671- LOCKDOWN_COMMAND_LINE_KEY,
1672- NULL) ||
1673- panel_applet_get_locked_down (applet)) {
1674- bonobo_ui_component_set_prop (popup_component,
1675- "/popups/button3/GdmSeparator",
1676- "hidden", "1", NULL);
1677- bonobo_ui_component_set_prop (popup_component,
1678- "/commands/GdmUsersGroupsAdmin",
1679- "hidden", "1", NULL);
1680- } else {
1681-#ifndef USERS_ADMIN
1682-# ifdef GDM_SETUP
1683- bonobo_ui_component_set_prop (popup_component,
1684- "/popups/button3/GdmSeparator",
1685- "hidden", "1",
1686- NULL);
1687-# endif /* !GDM_SETUP */
1688- bonobo_ui_component_set_prop (popup_component,
1689- "/commands/GdmUsersGroupsAdmin",
1690- "hidden", "1",
1691- NULL);
1692-#endif /* !USERS_ADMIN */
1693- }
1694-
1695- /* Hide the gdmphotosetup item if it can't be found in the path. */
1696- tmp = g_find_program_in_path ("gnome-about-me");
1697- if (!tmp) {
1698- bonobo_ui_component_set_prop (popup_component,
1699- "/commands/GdmAboutMe",
1700- "hidden", "1",
1701- NULL);
1702- } else {
1703- g_free (tmp);
1704- }
1705-
1706- g_signal_connect (adata->applet,
1707- "style-set",
1708- G_CALLBACK (applet_style_set_cb), adata);
1709- g_signal_connect (applet,
1710- "change-background",
1711- G_CALLBACK (applet_change_background_cb), adata);
1712- g_signal_connect (applet,
1713- "size-allocate",
1714- G_CALLBACK (applet_size_allocate_cb), adata);
1715- g_signal_connect (applet,
1716- "key-press-event",
1717- G_CALLBACK (applet_key_press_event_cb), adata);
1718- g_signal_connect_after (applet,
1719- "focus-in-event",
1720- G_CALLBACK (gtk_widget_queue_draw), NULL);
1721- g_signal_connect_after (applet,
1722- "focus-out-event",
1723- G_CALLBACK (gtk_widget_queue_draw), NULL);
1724- g_object_set_data_full (G_OBJECT (applet),
1725- "gdm-applet-data",
1726- adata,
1727- (GDestroyNotify) gdm_applet_data_free);
1728-
1729- adata->menubar = gtk_menu_bar_new ();
1730- gtk_widget_set_name (adata->menubar, "gdm-user-switch-menubar");
1731- gtk_widget_set_can_focus (adata->menubar, TRUE);
1732- g_signal_connect (adata->menubar, "button-press-event",
1733- G_CALLBACK (menubar_button_press_event_cb), adata);
1734- g_signal_connect_after (adata->menubar, "expose-event",
1735- G_CALLBACK (menubar_expose_event_cb), adata);
1736- gtk_container_add (GTK_CONTAINER (applet), adata->menubar);
1737- gtk_widget_show (adata->menubar);
1738-
1739- adata->manager = gdm_user_manager_ref_default ();
1740- g_object_set (adata->manager, "include-all", TRUE, NULL);
1741- g_signal_connect (adata->manager,
1742- "notify::is-loaded",
1743- G_CALLBACK (on_manager_is_loaded_changed),
1744- adata);
1745- g_signal_connect (adata->manager,
1746- "notify::has-multiple-users",
1747- G_CALLBACK (on_manager_has_multiple_users_changed),
1748- adata);
1749-
1750- gdm_user_manager_queue_load (adata->manager);
1751- setup_current_user (adata);
1752-
1753- gconf_client_add_dir (adata->client,
1754- LOCKDOWN_DIR,
1755- GCONF_CLIENT_PRELOAD_ONELEVEL,
1756- NULL);
1757-
1758- adata->client_notify_lockdown_id = gconf_client_notify_add (adata->client,
1759- LOCKDOWN_DIR,
1760- (GConfClientNotifyFunc)client_notify_lockdown_func,
1761- adata,
1762- NULL,
1763- NULL);
1764-
1765- if (gconf_client_get_bool (adata->client, LOCKDOWN_USER_SWITCHING_KEY, NULL)) {
1766- set_menu_visibility (adata, FALSE);
1767- } else {
1768- set_menu_visibility (adata, TRUE);
1769- }
1770- if (gconf_client_get_bool (adata->client, LOCKDOWN_LOCK_SCREEN_KEY, NULL)) {
1771- gtk_widget_hide (adata->lock_screen_item);
1772- } else {
1773- gtk_widget_show (adata->lock_screen_item);
1774- }
1775-
1776- error = NULL;
1777- bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
1778- if (bus == NULL) {
1779- g_warning ("Unable to get session bus: %s", error->message);
1780- g_error_free (error);
1781- goto done;
1782- }
1783-
1784-#ifdef BUILD_PRESENSE_STUFF
1785- adata->presence_proxy = dbus_g_proxy_new_for_name (bus,
1786- "org.gnome.SessionManager",
1787- "/org/gnome/SessionManager/Presence",
1788- "org.gnome.SessionManager.Presence");
1789- if (adata->presence_proxy != NULL) {
1790- DBusGProxy *proxy;
1791-
1792- dbus_g_proxy_add_signal (adata->presence_proxy,
1793- "StatusChanged",
1794- G_TYPE_UINT,
1795- G_TYPE_INVALID);
1796- dbus_g_proxy_connect_signal (adata->presence_proxy,
1797- "StatusChanged",
1798- G_CALLBACK (on_presence_status_changed),
1799- adata,
1800- NULL);
1801- dbus_g_proxy_add_signal (adata->presence_proxy,
1802- "StatusTextChanged",
1803- G_TYPE_STRING,
1804- G_TYPE_INVALID);
1805- dbus_g_proxy_connect_signal (adata->presence_proxy,
1806- "StatusTextChanged",
1807- G_CALLBACK (on_presence_status_text_changed),
1808- adata,
1809- NULL);
1810-
1811-
1812- proxy = dbus_g_proxy_new_from_proxy (adata->presence_proxy,
1813- "org.freedesktop.DBus.Properties",
1814- "/org/gnome/SessionManager/Presence");
1815- if (proxy != NULL) {
1816- guint status;
1817- const char *status_text;
1818- GValue value = { 0, };
1819-
1820- status = 0;
1821- status_text = NULL;
1822-
1823- error = NULL;
1824- dbus_g_proxy_call (proxy,
1825- "Get",
1826- &error,
1827- G_TYPE_STRING, "org.gnome.SessionManager.Presence",
1828- G_TYPE_STRING, "status",
1829- G_TYPE_INVALID,
1830- G_TYPE_VALUE, &value,
1831- G_TYPE_INVALID);
1832-
1833- if (error != NULL) {
1834- g_warning ("Couldn't get presence status: %s", error->message);
1835- g_error_free (error);
1836- } else {
1837- status = g_value_get_uint (&value);
1838- }
1839-
1840- g_value_unset (&value);
1841-
1842- error = NULL;
1843- dbus_g_proxy_call (proxy,
1844- "Get",
1845- &error,
1846- G_TYPE_STRING, "org.gnome.SessionManager.Presence",
1847- G_TYPE_STRING, "status-text",
1848- G_TYPE_INVALID,
1849- G_TYPE_VALUE, &value,
1850- G_TYPE_INVALID);
1851-
1852- if (error != NULL) {
1853- g_warning ("Couldn't get presence status text: %s", error->message);
1854- g_error_free (error);
1855- } else {
1856- status_text = g_value_get_string (&value);
1857- }
1858-
1859- set_status (adata, status);
1860- set_status_text (adata, status_text);
1861- }
1862- } else {
1863- g_warning ("Failed to get session presence proxy");
1864- }
1865-#endif
1866-
1867- done:
1868- gtk_widget_show (GTK_WIDGET (adata->applet));
1869-
1870- return TRUE;
1871-}
1872-
1873-static gboolean
1874-applet_factory (PanelApplet *applet,
1875- const char *iid,
1876- gpointer data)
1877-{
1878- gboolean ret;
1879- ret = FALSE;
1880- if (strcmp (iid, "OAFIID:GNOME_FastUserSwitchApplet") == 0) {
1881- ret = fill_applet (applet);
1882- }
1883- return ret;
1884-}
1885diff --git a/gui/user-switch-applet/gdm-entry-menu-item.c b/gui/user-switch-applet/gdm-entry-menu-item.c
1886deleted file mode 100644
1887index d657e7a..0000000
1888--- a/gui/user-switch-applet/gdm-entry-menu-item.c
1889+++ /dev/null
1890@@ -1,304 +0,0 @@
1891-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
1892- *
1893- * Copyright (C) 2008 Red Hat, Inc.
1894- *
1895- * This program is free software; you can redistribute it and/or modify
1896- * it under the terms of the GNU General Public License as published by
1897- * the Free Software Foundation; either version 2 of the License, or
1898- * (at your option) any later version.
1899- *
1900- * This program is distributed in the hope that it will be useful,
1901- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1902- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1903- * GNU General Public License for more details.
1904- *
1905- * You should have received a copy of the GNU General Public License
1906- * along with this program; if not, write to the Free Software
1907- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1908- */
1909-
1910-#include "config.h"
1911-
1912-#include <unistd.h>
1913-#include <sys/types.h>
1914-
1915-#include <string.h>
1916-
1917-#include <glib/gi18n.h>
1918-#include <gtk/gtk.h>
1919-
1920-#include "gdm-entry-menu-item.h"
1921-
1922-/* same as twitter */
1923-#define TEXT_BUFFER_MAX_CHARS 64
1924-
1925-enum
1926-{
1927- PROP_0,
1928-};
1929-
1930-struct _GdmEntryMenuItem
1931-{
1932- GtkMenuItem parent;
1933-
1934- GtkWidget *hbox;
1935- GtkWidget *image;
1936- GtkWidget *entry;
1937-};
1938-
1939-struct _GdmEntryMenuItemClass
1940-{
1941- GtkMenuItemClass parent_class;
1942-};
1943-
1944-G_DEFINE_TYPE (GdmEntryMenuItem, gdm_entry_menu_item, GTK_TYPE_MENU_ITEM)
1945-
1946-static void
1947-gdm_entry_menu_item_set_property (GObject *object,
1948- guint param_id,
1949- const GValue *value,
1950- GParamSpec *pspec)
1951-{
1952- GdmEntryMenuItem *item;
1953-
1954- item = GDM_ENTRY_MENU_ITEM (object);
1955-
1956- switch (param_id) {
1957- default:
1958- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
1959- break;
1960- }
1961-}
1962-
1963-static void
1964-gdm_entry_menu_item_get_property (GObject *object,
1965- guint param_id,
1966- GValue *value,
1967- GParamSpec *pspec)
1968-{
1969- GdmEntryMenuItem *item;
1970-
1971- item = GDM_ENTRY_MENU_ITEM (object);
1972-
1973- switch (param_id) {
1974- default:
1975- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
1976- break;
1977- }
1978-}
1979-
1980-static void
1981-gdm_entry_menu_item_dispose (GObject *object)
1982-{
1983-
1984- (*G_OBJECT_CLASS (gdm_entry_menu_item_parent_class)->dispose) (object);
1985-}
1986-
1987-static gboolean
1988-gdm_entry_menu_item_button_release (GtkWidget *widget,
1989- GdkEventButton *event)
1990-{
1991- return TRUE;
1992-}
1993-
1994-/* Cut and paste from gtkwindow.c */
1995-static void
1996-send_focus_change (GtkWidget *widget,
1997- gboolean in)
1998-{
1999- GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
2000-
2001- g_object_ref (widget);
2002-
2003- gtk_widget_set_can_focus (widget, in);
2004-
2005- fevent->focus_change.type = GDK_FOCUS_CHANGE;
2006- fevent->focus_change.window = g_object_ref (gtk_widget_get_window (widget));
2007- fevent->focus_change.in = in;
2008-
2009- gtk_widget_event (widget, fevent);
2010-
2011- g_object_notify (G_OBJECT (widget), "has-focus");
2012-
2013- g_object_unref (widget);
2014- gdk_event_free (fevent);
2015-}
2016-
2017-static gboolean
2018-gdm_entry_menu_item_button_press (GtkWidget *widget,
2019- GdkEventButton *event)
2020-{
2021- GtkWidget *entry;
2022-
2023- entry = GDM_ENTRY_MENU_ITEM (widget)->entry;
2024-
2025- if (gtk_widget_get_window (entry) != NULL) {
2026- gdk_window_raise (gtk_widget_get_window (entry));
2027- }
2028-
2029- if (!gtk_widget_has_focus (entry)) {
2030- gtk_widget_grab_focus (entry);
2031- }
2032-
2033- return FALSE;
2034-}
2035-
2036-static void
2037-gdm_entry_menu_item_realize (GtkWidget *widget)
2038-{
2039- if (GTK_WIDGET_CLASS (gdm_entry_menu_item_parent_class)->realize) {
2040- GTK_WIDGET_CLASS (gdm_entry_menu_item_parent_class)->realize (widget);
2041- }
2042-}
2043-
2044-static void
2045-gdm_entry_menu_item_select (GtkItem *item)
2046-{
2047- g_return_if_fail (GDM_IS_ENTRY_MENU_ITEM (item));
2048- send_focus_change (GTK_WIDGET (GDM_ENTRY_MENU_ITEM (item)->entry), TRUE);
2049-}
2050-
2051-static void
2052-gdm_entry_menu_item_deselect (GtkItem *item)
2053-{
2054- g_return_if_fail (GDM_IS_ENTRY_MENU_ITEM (item));
2055-
2056- send_focus_change (GTK_WIDGET (GDM_ENTRY_MENU_ITEM (item)->entry), FALSE);
2057-}
2058-
2059-static void
2060-gdm_entry_menu_item_class_init (GdmEntryMenuItemClass *klass)
2061-{
2062- GObjectClass *gobject_class;
2063- GtkWidgetClass *widget_class;
2064- GtkMenuItemClass *menu_item_class;
2065- GtkItemClass *item_class;
2066-
2067- gobject_class = G_OBJECT_CLASS (klass);
2068- widget_class = GTK_WIDGET_CLASS (klass);
2069- menu_item_class = GTK_MENU_ITEM_CLASS (klass);
2070- item_class = GTK_ITEM_CLASS (klass);
2071-
2072- gobject_class->set_property = gdm_entry_menu_item_set_property;
2073- gobject_class->get_property = gdm_entry_menu_item_get_property;
2074- gobject_class->dispose = gdm_entry_menu_item_dispose;
2075-
2076- widget_class->button_release_event = gdm_entry_menu_item_button_release;
2077- widget_class->button_press_event = gdm_entry_menu_item_button_press;
2078- widget_class->realize = gdm_entry_menu_item_realize;
2079-
2080- item_class->select = gdm_entry_menu_item_select;
2081- item_class->deselect = gdm_entry_menu_item_deselect;
2082-
2083- menu_item_class->hide_on_activate = FALSE;
2084-}
2085-
2086-static void
2087-on_entry_show (GtkWidget *widget,
2088- GdmEntryMenuItem *item)
2089-{
2090- if (gtk_widget_get_window (widget) != NULL) {
2091- gdk_window_raise (gtk_widget_get_window (widget));
2092- }
2093- send_focus_change (widget, TRUE);
2094-}
2095-
2096-static void
2097-on_text_buffer_changed (GtkTextBuffer *buffer,
2098- GdmEntryMenuItem *item)
2099-{
2100- int len;
2101-
2102- len = gtk_text_buffer_get_char_count (buffer);
2103- if (len > TEXT_BUFFER_MAX_CHARS) {
2104- gdk_window_beep (gtk_widget_get_window (GTK_WIDGET (item)));
2105- }
2106-}
2107-
2108-static void
2109-on_entry_move_focus (GtkWidget *widget,
2110- GtkDirectionType direction,
2111- GdmEntryMenuItem *item)
2112-{
2113- g_debug ("focus move");
2114- send_focus_change (GTK_WIDGET (GDM_ENTRY_MENU_ITEM (item)->entry), FALSE);
2115- g_signal_emit_by_name (item,
2116- "move-focus",
2117- GTK_DIR_TAB_FORWARD);
2118-}
2119-
2120-static void
2121-gdm_entry_menu_item_init (GdmEntryMenuItem *item)
2122-{
2123- PangoFontDescription *fontdesc;
2124- PangoFontMetrics *metrics;
2125- PangoContext *context;
2126- PangoLanguage *lang;
2127- int ascent;
2128- GtkTextBuffer *buffer;
2129-
2130- item->hbox = gtk_hbox_new (FALSE, 6);
2131- gtk_container_add (GTK_CONTAINER (item), item->hbox);
2132-
2133- item->image = gtk_image_new ();
2134- gtk_box_pack_start (GTK_BOX (item->hbox), item->image, FALSE, FALSE, 0);
2135-
2136- item->entry = gtk_text_view_new ();
2137- gtk_text_view_set_accepts_tab (GTK_TEXT_VIEW (item->entry), FALSE);
2138- gtk_text_view_set_editable (GTK_TEXT_VIEW (item->entry), TRUE);
2139- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (item->entry),
2140- GTK_WRAP_WORD);
2141- g_signal_connect (item->entry,
2142- "show",
2143- G_CALLBACK (on_entry_show),
2144- item);
2145- g_signal_connect (item->entry,
2146- "move-focus",
2147- G_CALLBACK (on_entry_move_focus),
2148- item);
2149-
2150- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (item->entry));
2151- g_signal_connect (buffer,
2152- "changed",
2153- G_CALLBACK (on_text_buffer_changed),
2154- item);
2155-
2156- /* get the font ascent for the current font and language */
2157- context = gtk_widget_get_pango_context (item->entry);
2158- fontdesc = pango_context_get_font_description (context);
2159- lang = pango_context_get_language (context);
2160- metrics = pango_context_get_metrics (context, fontdesc, lang);
2161- ascent = pango_font_metrics_get_ascent (metrics) * 1.5 / PANGO_SCALE;
2162- pango_font_metrics_unref (metrics);
2163-
2164- /* size our progress bar to be five ascents long */
2165- gtk_widget_set_size_request (item->entry, ascent * 5, -1);
2166-
2167- gtk_box_pack_start (GTK_BOX (item->hbox), item->entry, TRUE, TRUE, 0);
2168-
2169- gtk_widget_show (item->hbox);
2170- gtk_widget_show (item->image);
2171- gtk_widget_show (item->entry);
2172-}
2173-
2174-GtkWidget *
2175-gdm_entry_menu_item_new (void)
2176-{
2177- return g_object_new (GDM_TYPE_ENTRY_MENU_ITEM, NULL);
2178-}
2179-
2180-GtkWidget *
2181-gdm_entry_menu_item_get_entry (GdmEntryMenuItem *item)
2182-{
2183- g_return_val_if_fail (GDM_IS_ENTRY_MENU_ITEM (item), NULL);
2184-
2185- return item->entry;
2186-}
2187-
2188-GtkWidget *
2189-gdm_entry_menu_item_get_image (GdmEntryMenuItem *item)
2190-{
2191- g_return_val_if_fail (GDM_IS_ENTRY_MENU_ITEM (item), NULL);
2192-
2193- return item->image;
2194-}
2195diff --git a/gui/user-switch-applet/gdm-entry-menu-item.h b/gui/user-switch-applet/gdm-entry-menu-item.h
2196deleted file mode 100644
2197index 3031609..0000000
2198--- a/gui/user-switch-applet/gdm-entry-menu-item.h
2199+++ /dev/null
2200@@ -1,51 +0,0 @@
2201-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2202- *
2203- * Copyright (C) 2004-2005 James M. Cape <jcape@ignore-your.tv>.
2204- *
2205- * This program is free software; you can redistribute it and/or modify
2206- * it under the terms of the GNU General Public License as published by
2207- * the Free Software Foundation; either version 2 of the License, or
2208- * (at your option) any later version.
2209- *
2210- * This program is distributed in the hope that it will be useful,
2211- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2212- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2213- * GNU General Public License for more details.
2214- *
2215- * You should have received a copy of the GNU General Public License
2216- * along with this program; if not, write to the Free Software
2217- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2218- */
2219-
2220-#ifndef __GDM_ENTRY_MENU_ITEM__
2221-#define __GDM_ENTRY_MENU_ITEM__
2222-
2223-#include <gtk/gtk.h>
2224-
2225-G_BEGIN_DECLS
2226-
2227-#define GDM_TYPE_ENTRY_MENU_ITEM \
2228- (gdm_entry_menu_item_get_type ())
2229-#define GDM_ENTRY_MENU_ITEM(object) \
2230- (G_TYPE_CHECK_INSTANCE_CAST ((object), GDM_TYPE_ENTRY_MENU_ITEM, GdmEntryMenuItem))
2231-#define GDM_ENTRY_MENU_ITEM_CLASS(klass) \
2232- (G_TYPE_CHECK_CLASS_CAST ((klass), GDM_TYPE_ENTRY_MENU_ITEM, GdmEntryMenuItemClass))
2233-#define GDM_IS_ENTRY_MENU_ITEM(object) \
2234- (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDM_TYPE_ENTRY_MENU_ITEM))
2235-#define GDM_IS_ENTRY_MENU_ITEM_CLASS(klass) \
2236- (G_TYPE_CHECK_CLASS_TYPE ((klass), GDM_TYPE_ENTRY_MENU_ITEM))
2237-#define GDM_ENTRY_MENU_ITEM_GET_CLASS(object) \
2238- (G_TYPE_INSTANCE_GET_CLASS ((object), GDM_TYPE_ENTRY_MENU_ITEM, GdmEntryMenuItemClass))
2239-
2240-typedef struct _GdmEntryMenuItem GdmEntryMenuItem;
2241-typedef struct _GdmEntryMenuItemClass GdmEntryMenuItemClass;
2242-
2243-GType gdm_entry_menu_item_get_type (void) G_GNUC_CONST;
2244-
2245-GtkWidget *gdm_entry_menu_item_new (void);
2246-GtkWidget *gdm_entry_menu_item_get_entry (GdmEntryMenuItem *item);
2247-GtkWidget *gdm_entry_menu_item_get_image (GdmEntryMenuItem *item);
2248-
2249-G_END_DECLS
2250-
2251-#endif /* __GDM_ENTRY_MENU_ITEM__ */
2252diff --git a/po/POTFILES.in b/po/POTFILES.in
2253index 1fccb90..cc1a3fd 100644
2254--- a/po/POTFILES.in
2255+++ b/po/POTFILES.in
2256@@ -84,10 +84,6 @@ gui/simple-greeter/gdm-timer.c
2257 gui/simple-greeter/gdm-user.c
2258 gui/simple-greeter/gdm-user-chooser-widget.c
2259 gui/simple-greeter/greeter-main.c
2260-gui/user-switch-applet/applet.c
2261-gui/user-switch-applet/gdm-entry-menu-item.c
2262-gui/user-switch-applet/GNOME_FastUserSwitchApplet.server.in.in
2263-gui/user-switch-applet/GNOME_FastUserSwitchApplet.xml
2264 utils/gdmflexiserver.c
2265 utils/gdm-screenshot.c
2266
2267diff --git a/po/POTFILES.skip b/po/POTFILES.skip
2268index 0269a0f..ee3d753 100644
2269--- a/po/POTFILES.skip
2270+++ b/po/POTFILES.skip
2271@@ -7,7 +7,6 @@
2272 # remove these unless you fix "make distcheck" a different way.
2273 #
2274 data/gdm.schemas.in
2275-gui/user-switch-applet/GNOME_FastUserSwitchApplet.server.in
2276 data/greeter-autostart/at-spi-registryd-wrapper.desktop.in
2277 data/greeter-autostart/gdm-simple-greeter.desktop.in
2278 data/greeter-autostart/gnome-power-manager.desktop.in
2279--
22801.6.6.1
2281
diff --git a/meta-gnome/recipes-gnome/gdm/gdm/0002-gdm-user-manager.c-avoid-displaying-system-users-in-.patch b/meta-gnome/recipes-gnome/gdm/gdm/0002-gdm-user-manager.c-avoid-displaying-system-users-in-.patch
new file mode 100644
index 000000000..ad21073a0
--- /dev/null
+++ b/meta-gnome/recipes-gnome/gdm/gdm/0002-gdm-user-manager.c-avoid-displaying-system-users-in-.patch
@@ -0,0 +1,34 @@
1From 43e59f3deadb3914a1cc931ae18d4023874cdeca Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
3Date: Fri, 26 Apr 2013 17:15:48 +0200
4Subject: [PATCH] gdm-user-manager.c: avoid displaying system users in
5 greeter's list
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10yocto environment system users have UID below 1000
11
12Upstream-Status: Inappropriate [configuration]
13
14Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
15---
16 gui/simple-greeter/gdm-user-manager.c | 2 +-
17 1 files changed, 1 insertions(+), 1 deletions(-)
18
19diff --git a/gui/simple-greeter/gdm-user-manager.c b/gui/simple-greeter/gdm-user-manager.c
20index c631989..f18e478 100644
21--- a/gui/simple-greeter/gdm-user-manager.c
22+++ b/gui/simple-greeter/gdm-user-manager.c
23@@ -63,7 +63,7 @@
24 #ifdef __sun
25 #define FALLBACK_MINIMAL_UID 100
26 #else
27-#define FALLBACK_MINIMAL_UID 500
28+#define FALLBACK_MINIMAL_UID 1000
29 #endif
30
31 #ifndef _PATH_SHELLS
32--
331.7.4.4
34
diff --git a/meta-gnome/recipes-gnome/gdm/gdm/Default b/meta-gnome/recipes-gnome/gdm/gdm/Default
new file mode 100755
index 000000000..a7a7fcf7f
--- /dev/null
+++ b/meta-gnome/recipes-gnome/gdm/gdm/Default
@@ -0,0 +1,96 @@
1#!/bin/sh
2# Stolen from the debian kdm setup, aren't I sneaky
3# Plus a lot of fun stuff added
4# -George
5
6PATH="/usr/bin:$PATH"
7OLD_IFS=$IFS
8
9gdmwhich () {
10 COMMAND="$1"
11 OUTPUT=
12 IFS=:
13 for dir in $PATH
14 do
15 if test -x "$dir/$COMMAND" ; then
16 if test "x$OUTPUT" = "x" ; then
17 OUTPUT="$dir/$COMMAND"
18 fi
19 fi
20 done
21 IFS=$OLD_IFS
22 echo "$OUTPUT"
23}
24
25sysresources=/etc/X11/Xresources
26
27# merge in defaults
28if [ -f "$sysresources" ]; then
29 xrdb -merge "$sysresources"
30fi
31
32sysmodmap=/etc/X11/Xmodmap
33
34XMODMAP=`gdmwhich xmodmap`
35if [ "x$XMODMAP" != "x" ] ; then
36 if [ "x$GDM_PARENT_DISPLAY" = "x" ]; then
37 if [ -f $sysmodmap ]; then
38 $XMODMAP $sysmodmap
39 fi
40 else
41 ( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $XMODMAP -pke ) | $XMODMAP -
42 fi
43
44 #
45 # Switch Sun's Alt and Meta mod mappings
46 #
47
48 UNAME=`gdmwhich uname`
49 PROCESSOR=`$UNAME -p`
50 if [ "x$PROCESSOR" = "xsparc" ]; then
51 if $XMODMAP | /usr/bin/grep mod4 | /usr/bin/grep Alt > /dev/null 2>/dev/null
52 then
53 $XMODMAP -e "clear Mod1" \
54 -e "clear Mod4" \
55 -e "add Mod1 = Alt_L" \
56 -e "add Mod1 = Alt_R" \
57 -e "add Mod4 = Meta_L" \
58 -e "add Mod4 = Meta_R"
59 fi
60 fi
61fi
62
63SETXKBMAP=`gdmwhich setxkbmap`
64if [ "x$SETXKBMAP" != "x" ] ; then
65 # FIXME: is this all right? Is this completely on crack?
66 # What this does is move the xkb configuration from the GDM_PARENT_DISPLAY
67 # FIXME: This should be done in code. Or there must be an easier way ...
68 if [ -n "$GDM_PARENT_DISPLAY" ]; then
69 XKBSETUP=`( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $SETXKBMAP -v )`
70 if [ -n "$XKBSETUP" ]; then
71 XKBKEYMAP=`echo "$XKBSETUP" | grep '^keymap' | awk '{ print $2 }'`
72 XKBTYPES=`echo "$XKBSETUP" | grep '^types' | awk '{ print $2 }'`
73 XKBCOMPAT=`echo "$XKBSETUP" | grep '^compat' | awk '{ print $2 }'`
74 XKBSYMBOLS=`echo "$XKBSETUP" | grep '^symbols' | awk '{ print $2 }'`
75 XKBGEOMETRY=`echo "$XKBSETUP" | grep '^geometry' | awk '{ print $2 }'`
76 if [ -n "$XKBKEYMAP" ]; then
77 $SETXKBMAP -keymap "$XKBKEYMAP"
78 elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" -a -n "$XKBGEOMETRY" ]; then
79 $SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS" -geometry "$XKBGEOMETRY"
80 elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" ]; then
81 $SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS"
82 elif [ -n "$XKBSYMBOLS" ]; then
83 $SETXKBMAP -symbols "$XKBSYMBOLS"
84 fi
85 fi
86 fi
87fi
88
89# FIXME: the housekeeping below really should be moved to the postinst of packages that require it
90# brute force approach for now
91update-desktop-database
92glib-compile-schemas /usr/share/glib-2.0/schemas/
93
94#x11vnc -q -bg -display :0 -forever -avahi -xkb
95
96exit 0
diff --git a/meta-gnome/recipes-gnome/gdm/gdm/cross-xdetection.diff b/meta-gnome/recipes-gnome/gdm/gdm/cross-xdetection.diff
new file mode 100644
index 000000000..bee35116e
--- /dev/null
+++ b/meta-gnome/recipes-gnome/gdm/gdm/cross-xdetection.diff
@@ -0,0 +1,96 @@
1From 60084e7e973634971c9643f2459e5d3e248ee3f1 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Thu, 9 Jun 2011 18:12:45 +0200
4Subject: [PATCH] build-sys: hardcode x paths to fix crosscompiling
5
6Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
7---
8 configure.ac | 72 ++++-----------------------------------------------------
9 1 files changed, 5 insertions(+), 67 deletions(-)
10
11diff --git a/configure.ac b/configure.ac
12index eeaf3dc..841efe0 100644
13--- a/configure.ac
14+++ b/configure.ac
15@@ -1101,73 +1101,11 @@ dnl ---------------------------------------------------------------------------
16 dnl - Check for X Server location
17 dnl ---------------------------------------------------------------------------
18
19-# First check with "! -h" for /usr/X11R6 and /usr/X11 since they often
20-# symlink to each other, and configure should use the more stable
21-# location (the real directory) if possible.
22-#
23-# On Solaris, the /usr/bin/Xserver script is used to decide whether to
24-# use Xsun or Xorg, so this is used on Solaris.
25-#
26-# When testing for /usr/X11R6, first check with "! -h" for /usr/X11R6
27-# and /usr/X11 since they often symlink to each other, and configure
28-# should use the more stable location (the real directory) if possible.
29-#
30-if test -x /usr/X11/bin/Xserver; then
31- X_PATH="/usr/X11/bin"
32- X_SERVER_PATH="/usr/X11/bin"
33- X_SERVER="/usr/X11/bin/Xserver"
34- X_CONFIG_OPTIONS="-audit 0"
35-elif test ! -h /usr/X11R6 -a -x /usr/X11R6/bin/X; then
36- X_PATH="/usr/X11R6/bin"
37- X_SERVER_PATH="/usr/X11R6/bin"
38- X_SERVER="/usr/X11R6/bin/X"
39- X_CONFIG_OPTIONS="-audit 0"
40-elif test ! -h /usr/X11 -a -x /usr/X11/bin/X; then
41- X_PATH="/usr/X11/bin"
42- X_SERVER_PATH="/usr/X11/bin"
43- X_SERVER="/usr/X11/bin/X"
44- X_CONFIG_OPTIONS="-audit 0"
45-elif test -x /usr/X11R6/bin/X; then
46- X_PATH="/usr/X11R6/bin"
47- X_SERVER_PATH="/usr/X11R6/bin"
48- X_SERVER="/usr/X11R6/bin/X"
49- X_CONFIG_OPTIONS="-audit 0"
50-elif test -x /usr/bin/Xorg; then
51- X_PATH="/usr/bin"
52- X_SERVER_PATH="/usr/bin"
53- X_SERVER="/usr/bin/Xorg"
54- X_CONFIG_OPTIONS="-audit 0"
55-elif test -x /usr/X11/bin/X; then
56- X_PATH="/usr/X11/bin"
57- X_SERVER_PATH="/usr/X11/bin"
58- X_SERVER="/usr/X11/bin/X"
59- X_CONFIG_OPTIONS="-audit 0"
60-elif test -x /usr/openwin/bin/Xsun; then
61- # Do not add /usr/openwin/bin here because on Solaris you need
62- # /usr/openwin/bin in your PATH even if you are using the Xorg
63- # Xserver. We add this to the path below.
64- X_PATH="/usr/openwin/bin"
65- X_SERVER_PATH="/usr/openwin/bin"
66- X_SERVER="/usr/openwin/bin/Xsun"
67- X_CONFIG_OPTIONS="-audit 0 -nobanner"
68-elif test -x /opt/X11R6/bin/X; then
69- X_PATH="/opt/X11R6/bin"
70- X_SERVER_PATH="/opt/X11R6/bin"
71- X_SERVER="/opt/X11R6/bin/X"
72- X_CONFIG_OPTIONS="-audit 0"
73-elif test -x /usr/bin/X; then
74- X_PATH="/usr/bin"
75- X_SERVER_PATH="/usr/bin"
76- X_SERVER="/usr/bin/X"
77- X_CONFIG_OPTIONS="-audit 0"
78-else
79- # what to do, what to do, this is wrong, but this just sets the
80- # defaults, perhaps this user is cross compiling or some such
81- X_PATH="/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin"
82- X_SERVER_PATH="/usr/bin"
83- X_SERVER="/usr/bin/X"
84- X_CONFIG_OPTIONS="-audit 0"
85-fi
86+# We hardcode the X paths since we know where it will be in the OE univers
87+X_PATH="/usr/bin"
88+X_SERVER_PATH="/usr/bin"
89+X_SERVER="/usr/bin/X"
90+X_CONFIG_OPTIONS="-audit 0"
91
92 dnl ---------------------------------------------------------------------------
93 dnl - Check for Xnest / Xephyr support
94--
951.6.6.1
96
diff --git a/meta-gnome/recipes-gnome/gdm/gdm/gdm b/meta-gnome/recipes-gnome/gdm/gdm/gdm
new file mode 100755
index 000000000..43eae9517
--- /dev/null
+++ b/meta-gnome/recipes-gnome/gdm/gdm/gdm
@@ -0,0 +1,89 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: gdm
4# Should-Start: console-screen acpid dbus hal network-manager
5# Required-Start: $local_fs $remote_fs
6# Required-Stop: $local_fs $remote_fs
7# Default-Start: 2 3 4 5
8# Default-Stop: 0 1 6
9# Short-Description: GNOME Display Manager
10# Description: Debian init script for the GNOME Display Manager
11### END INIT INFO
12#
13# Author: Ryan Murray <rmurray@debian.org>
14#
15set -e
16
17PATH=/sbin:/bin:/usr/sbin:/usr/bin
18DAEMON=/usr/sbin/gdm
19
20test -x $DAEMON || exit 0
21
22if [ -r /etc/default/locale ]; then
23 . /etc/default/locale
24 export LANG LANGUAGE
25fi
26
27# To start gdm even if it is not the default display manager, change
28# HEED_DEFAULT_DISPLAY_MANAGER to "false."
29HEED_DEFAULT_DISPLAY_MANAGER=true
30DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
31
32case "$1" in
33 start)
34 # make needed directories in volatile
35
36 if [ -e /var/log/gdm ] ; then
37 rm -rf /var/log/gdm
38 fi
39
40 mkdir -m 01770 /var/log/gdm
41 chown gdm:gdm /var/log/gdm
42
43 if [ -e /tmp/.ICE-unix ] ; then
44 rm -rf /tmp/.ICE-unix
45 fi
46
47 mkdir -m 01777 /tmp/.ICE-unix
48 chown root:root /tmp/.ICE-unix
49
50 CONFIGURED_DAEMON=$(basename "$(cat $DEFAULT_DISPLAY_MANAGER_FILE 2> /dev/null)")
51 if grep -wqs text /proc/cmdline; then
52 echo "Not starting GNOME Display Manager (gdm); found 'text' in kernel commandline."
53 elif [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ] && \
54 [ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] && \
55 [ "$CONFIGURED_DAEMON" != gdm ] ; then
56 echo "Not starting GNOME Display Manager; it is not the default display manager"
57 else
58 echo "Starting GNOME Display Manager" "gdm"
59 start-stop-daemon --start -b --exec $DAEMON
60 fi
61 ;;
62 stop)
63 echo "Stopping GNOME Display Manager" "gdm"
64 set +e
65 start-stop-daemon --stop --quiet --pidfile /var/run/gdm.pid \
66 --name gdm --retry 5
67 set -e
68 ;;
69 reload)
70 echo "Scheduling reload of GNOME Display Manager configuration" "gdm"
71 set +e
72 start-stop-daemon --stop --signal USR1 --quiet --pidfile \
73 /var/run/gdm.pid --name gdm
74 set -e
75 ;;
76 status)
77 status_of_proc -p "$PIDFILE" "$DAEMON" gdm && exit 0 || exit $?
78 ;;
79 restart|force-reload)
80 $0 stop
81 $0 start
82 ;;
83 *)
84 echo "Usage: /etc/init.d/gdm {start|stop|restart|reload|force-reload|status}"
85 exit 1
86 ;;
87esac
88
89exit 0
diff --git a/meta-gnome/recipes-gnome/gdm/gdm/gdm-pam b/meta-gnome/recipes-gnome/gdm/gdm/gdm-pam
new file mode 100644
index 000000000..f9fafed9d
--- /dev/null
+++ b/meta-gnome/recipes-gnome/gdm/gdm/gdm-pam
@@ -0,0 +1,11 @@
1#
2# default; standard UN*X access
3#
4auth required pam_unix.so
5account required pam_unix.so
6password required pam_unix.so
7session required pam_unix.so
8
9auth optional pam_gnome_keyring.so
10session optional pam_gnome_keyring.so auto_start
11
diff --git a/meta-gnome/recipes-gnome/gdm/gdm/gdm.conf b/meta-gnome/recipes-gnome/gdm/gdm/gdm.conf
new file mode 100644
index 000000000..559823b86
--- /dev/null
+++ b/meta-gnome/recipes-gnome/gdm/gdm/gdm.conf
@@ -0,0 +1,80 @@
1# GDM Custom Configuration file.
2#
3# This file is the appropriate place for specifying your customizations to the
4# GDM configuration. If you run gdmsetup, it will automatically edit this
5# file for you and will cause the daemon and any running GDM GUI programs to
6# automatically update with the new configuration. Not all configuration
7# options are supported by gdmsetup, so to modify some values it may be
8# necessary to modify this file directly by hand.
9#
10# This file overrides the default configuration settings. These settings
11# are stored in the GDM System Defaults configuration file, which is found
12# at the following location.
13#
14# /usr/share/gdm/defaults.conf.
15#
16# This file contains comments about the meaning of each configuration option,
17# so is also a useful reference. Also refer to the documentation links at
18# the end of this comment for further information. In short, to hand-edit
19# this file, simply add or modify the key=value combination in the
20# appropriate section in the template below this comment section.
21#
22# For example, if you want to specify a different value for the Enable key
23# in the "[debug]" section of your GDM System Defaults configuration file,
24# then add "Enable=true" in the "[debug]" section of this file. If the
25# key already exists in this file, then simply modify it.
26#
27# Older versions of GDM used the "gdm.conf" file for configuration. If your
28# system has an old gdm.conf file on the system, it will be used instead of
29# this file - so changes made to this file will not take effect. Consider
30# migrating your configuration to this file and removing the gdm.conf file.
31#
32# If you hand edit a GDM configuration file, you can run the following
33# command and the GDM daemon will immediately reflect the change. Any
34# running GDM GUI programs will also be notified to update with the new
35# configuration.
36#
37# gdmflexiserver --command="UPDATE_CONFIG <configuration key>"
38#
39# e.g, the "Enable" key in the "[debug]" section would be "debug/Enable".
40#
41# You can also run gdm-restart or gdm-safe-restart to cause GDM to restart and
42# re-read the new configuration settings. You can also restart GDM by sending
43# a HUP or USR1 signal to the daemon. HUP behaves like gdm-restart and causes
44# any user session started by GDM to exit immediately while USR1 behaves like
45# gdm-safe-restart and will wait until all users log out before restarting GDM.
46#
47# For full reference documentation see the gnome help browser under
48# GNOME|System category. You can also find the docs in HTML form on
49# http://www.gnome.org/projects/gdm/
50#
51# NOTE: Lines that begin with "#" are considered comments.
52#
53# Have fun!
54
55[daemon]
56
57[security]
58
59[xdmcp]
60
61[gui]
62
63[greeter]
64
65[chooser]
66
67[debug]
68
69# Note that to disable servers defined in the GDM System Defaults
70# configuration file (such as 0=Standard, you must put a line in this file
71# that says 0=inactive, as described in the Configuration section of the GDM
72# documentation.
73#
74[servers]
75
76# Also note, that if you redefine a [server-foo] section, then GDM will
77# use the definition in this file, not the GDM System Defaults configuration
78# file. It is currently not possible to disable a [server-foo] section
79# defined in the GDM System Defaults configuration file.
80#
diff --git a/meta-gnome/recipes-gnome/gdm/gdm/gdm.service.in b/meta-gnome/recipes-gnome/gdm/gdm/gdm.service.in
new file mode 100644
index 000000000..3e1556ae0
--- /dev/null
+++ b/meta-gnome/recipes-gnome/gdm/gdm/gdm.service.in
@@ -0,0 +1,10 @@
1[Unit]
2Description=Gnome Display Manager
3After=systemd-user-sessions.service
4
5[Service]
6ExecStart=%sbindir%/gdm -nodaemon
7StandardOutput=syslog
8
9[Install]
10Alias=display-manager.service
diff --git a/meta-gnome/recipes-gnome/gdm/gdm/sysrooted-pkg-config.patch b/meta-gnome/recipes-gnome/gdm/gdm/sysrooted-pkg-config.patch
new file mode 100644
index 000000000..1f9fa2ac2
--- /dev/null
+++ b/meta-gnome/recipes-gnome/gdm/gdm/sysrooted-pkg-config.patch
@@ -0,0 +1,37 @@
1In cross environment we have to prepend the sysroot to the path found by
2pkgconfig since the path returned from pkgconfig does not have sysroot prefixed
3it ends up using the files from host system. Now usually people have gnome installed
4so the build succeeds but if you dont have gnome installed on build host then
5it wont find the files on host system and packages using gnome-doc-utils wont
6compile.
7
8This should work ok with non sysrooted builds too since in those cases PKG_CONFIG_SYSROOT_DIR
9will be empty
10
11Upstream-Status: Pending
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14
15Index: gdm-2.32.2/gnome-doc-utils.make
16===================================================================
17--- gdm-2.32.2.orig/gnome-doc-utils.make 2011-05-31 08:06:59.000000000 -0700
18+++ gdm-2.32.2/gnome-doc-utils.make 2011-09-25 15:32:39.540992521 -0700
19@@ -133,12 +133,12 @@
20 _xml2po ?= `which xml2po`
21 _xml2po_mode = $(if $(DOC_ID),mallard,docbook)
22
23-_db2html ?= `$(PKG_CONFIG) --variable db2html gnome-doc-utils`
24-_db2omf ?= `$(PKG_CONFIG) --variable db2omf gnome-doc-utils`
25-_malrng ?= `$(PKG_CONFIG) --variable malrng gnome-doc-utils`
26-_chunks ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
27-_credits ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
28-_ids ?= $(shell $(PKG_CONFIG) --variable xmldir gnome-doc-utils)/gnome/xslt/docbook/utils/ids.xsl
29+_db2html ?= ${PKG_CONFIG_SYSROOT_DIR}`$(PKG_CONFIG) --variable db2html gnome-doc-utils`
30+_db2omf ?= ${PKG_CONFIG_SYSROOT_DIR}`$(PKG_CONFIG) --variable db2omf gnome-doc-utils`
31+_malrng ?= ${PKG_CONFIG_SYSROOT_DIR}`$(PKG_CONFIG) --variable malrng gnome-doc-utils`
32+_chunks ?= ${PKG_CONFIG_SYSROOT_DIR}`$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
33+_credits ?= ${PKG_CONFIG_SYSROOT_DIR}`$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
34+_ids ?= ${PKG_CONFIG_SYSROOT_DIR}$(shell $(PKG_CONFIG) --variable xmldir gnome-doc-utils)/gnome/xslt/docbook/utils/ids.xsl
35
36 if ENABLE_SK
37 _ENABLE_SK = true