Gentoo Archives: gentoo-commits

From: "Tom Wijsman (tomwij)" <tomwij@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in mate-base/mate-session-manager/files: 15-xdg-data-mate 10-user-dirs-update-mate MATE mate-session-manager-1.6-gnome-keyring.patch defaults.list mate-session-manager-1.5.2-save-session-ui.patch mate-session-manager-1.2.0-idle-transition.patch mate-session-manager-1.6.1-login1.patch
Date: Thu, 27 Feb 2014 18:41:27
Message-Id: 20140227184122.B0FB32004C@flycatcher.gentoo.org
1 tomwij 14/02/27 18:41:22
2
3 Added: 15-xdg-data-mate 10-user-dirs-update-mate MATE
4 mate-session-manager-1.6-gnome-keyring.patch
5 defaults.list
6 mate-session-manager-1.5.2-save-session-ui.patch
7 mate-session-manager-1.2.0-idle-transition.patch
8 mate-session-manager-1.6.1-login1.patch
9 Log:
10 New ebuild for mate-base/mate-session-manager, MATE session manager; imported from the mate-overlay, reviewed and adjusted.
11
12 (Portage version: HEAD/cvs/Linux x86_64, signed Manifest commit with key 6D34E57D)
13
14 Revision Changes Path
15 1.1 mate-base/mate-session-manager/files/15-xdg-data-mate
16
17 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/15-xdg-data-mate?rev=1.1&view=markup
18 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/15-xdg-data-mate?rev=1.1&content-type=text/plain
19
20 Index: 15-xdg-data-mate
21 ===================================================================
22 #!/bin/sh
23
24 if [ "$DESKTOP_SESSION" = "mate" ]; then
25 if [ -z "$XDG_DATA_DIRS" ]; then
26 export XDG_DATA_DIRS=/usr/share/mate:/usr/local/share/:/usr/share/
27 else
28 export XDG_DATA_DIRS=/usr/share/mate:"$XDG_DATA_DIRS"
29 fi
30 fi
31
32
33
34 1.1 mate-base/mate-session-manager/files/10-user-dirs-update-mate
35
36 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/10-user-dirs-update-mate?rev=1.1&view=markup
37 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/10-user-dirs-update-mate?rev=1.1&content-type=text/plain
38
39 Index: 10-user-dirs-update-mate
40 ===================================================================
41 #!/bin/sh
42
43 # Create various XDG directories, and write ~/.config/user-dirs.dirs, etc.
44 # That file is read by glib to get XDG_PICTURES_DIR, etc
45
46 if [ "$DESKTOP_SESSION" = "mate" ]; then
47 if type xdg-user-dirs-update >/dev/null 2>&1; then
48 xdg-user-dirs-update
49 fi
50 fi
51
52
53
54 1.1 mate-base/mate-session-manager/files/MATE
55
56 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/MATE?rev=1.1&view=markup
57 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/MATE?rev=1.1&content-type=text/plain
58
59 Index: MATE
60 ===================================================================
61 #!/bin/sh
62 #
63 # This file has bitrotted badly. Someone needs to clean this up.
64 #
65
66 if [ -f /etc/xdg/menus/mate-applications.menu ] ; then
67 export XDG_MENU_PREFIX=mate-
68 fi
69
70 for errfile in "$HOME/.materc-errors" "${TMPDIR-/tmp}/materc-$USER/tmp/materc-$USER"
71 do
72 if ( cp /dev/null "$errfile" 2> /dev/null )
73 then
74 chmod 600 "$errfile"
75 exec > "$errfile" 2>&1
76 break
77 fi
78 done
79 #
80 # Distributors:
81 # You should modify the paths here to fit your distro
82 # If you need to do so, send me (jirka@××.com) a patch
83 # and I'll try to make the script detect the distro stuff
84 #
85
86 userresources=$HOME/.Xresources
87 usermodmap=$HOME/.Xmodmap
88 userxkbmap=$HOME/.Xkbmap
89
90 sysresources=/etc/X11/Xresources
91 sysmodmap=/etc/X11/Xmodmap
92 sysxkbmap=/etc/X11/Xkbmap
93
94 rh6sysresources=/etc/X11/xinit/Xresources
95 rh6sysmodmap=/etc/X11/xinit/Xmodmap
96
97 if [ -x "$HOME/.materc" ]; then
98 command="$HOME/.materc"
99 elif [ -x /etc/X11/gdm/materc ]; then
100 command="/etc/X11/gdm/materc"
101 else
102 # as fallback in case the config is screwed
103 command=`which mate-session`
104 fi
105
106 # merge in defaults
107 if [ -f "$rh6sysresources" ]; then
108 xrdb -merge "$rh6sysresources"
109 fi
110
111 if [ -f "$sysresources" ]; then
112 xrdb -merge "$sysresources"
113 fi
114
115 if [ -f "$userresources" ]; then
116 xrdb -merge "$userresources"
117 fi
118
119 # merge in keymaps
120 if [ -f "$sysxkbmap" ]; then
121 setxkbmap `cat "$sysxkbmap"`
122 XKB_IN_USE=yes
123 fi
124
125 if [ -f "$userxkbmap" ]; then
126 setxkbmap `cat "$userxkbmap"`
127 XKB_IN_USE=yes
128 fi
129
130 #
131 # Eeek, this seems like too much magic here
132 #
133 if [ -z "$XKB_IN_USE" ] && [ ! -L /etc/X11/X ]; then
134 if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then
135 xkbsymbols=`sed -n -e 's/^[ ]*XkbSymbols[ ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config`
136 if [ -n "$xkbsymbols" ]; then
137 setxkbmap -symbols "$xkbsymbols"
138 XKB_IN_USE=yes
139 fi
140 fi
141 fi
142
143 # xkb and xmodmap don't play nice together
144 if [ -z "$XKB_IN_USE" ]; then
145 if [ -f "$rh6sysmodmap" ]; then
146 xmodmap "$rh6sysmodmap"
147 fi
148
149 if [ -f "$sysmodmap" ]; then
150 xmodmap "$sysmodmap"
151 fi
152
153 if [ -f "$usermodmap" ]; then
154 xmodmap "$usermodmap"
155 fi
156 fi
157
158 unset XKB_IN_USE
159
160 # run all system xinitrc shell scripts.
161 if [ -d /etc/X11/xinit/xinitrc.d ]; then
162 for i in /etc/X11/xinit/xinitrc.d/* ; do
163 if [ -x "$i" ]; then
164 . "$i"
165 fi
166 done
167 fi
168
169 exec $command
170
171
172
173 1.1 mate-base/mate-session-manager/files/mate-session-manager-1.6-gnome-keyring.patch
174
175 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/mate-session-manager-1.6-gnome-keyring.patch?rev=1.1&view=markup
176 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/mate-session-manager-1.6-gnome-keyring.patch?rev=1.1&content-type=text/plain
177
178 Index: mate-session-manager-1.6-gnome-keyring.patch
179 ===================================================================
180 diff --git a/mate-session/Makefile.am b/mate-session/Makefile.am
181 index f37a0e2..2c73d63 100644
182 --- a/mate-session/Makefile.am
183 +++ b/mate-session/Makefile.am
184 @@ -42,6 +42,8 @@ mate_session_SOURCES = \
185 mdm-signal-handler.c \
186 mdm-log.h \
187 mdm-log.c \
188 + msm-gnome.c \
189 + msm-gnome.h \
190 main.c \
191 gsm-store.h \
192 gsm-store.c \
193 diff --git a/mate-session/main.c b/mate-session/main.c
194 index 6cfbbe6..f6bee9a 100644
195 --- a/mate-session/main.c
196 +++ b/mate-session/main.c
197 @@ -51,6 +51,8 @@
198 #include "gsm-xsmp-server.h"
199 #include "gsm-store.h"
200
201 +#include "msm-gnome.h"
202 +
203 #define GSM_SCHEMA "org.mate.session"
204 #define GSM_DEFAULT_SESSION_KEY "default-session"
205 #define GSM_REQUIRED_COMPONENTS_SCHEMA GSM_SCHEMA ".required-components"
206 @@ -542,6 +544,9 @@ int main(int argc, char** argv)
207 */
208 acquire_name();
209
210 + /* Starts gnome compat mode */
211 + msm_compat_gnome_startup ();
212 +
213 manager = gsm_manager_new(client_store, failsafe);
214
215 signal_handler = mdm_signal_handler_new();
216 @@ -583,6 +588,7 @@ int main(int argc, char** argv)
217 g_object_unref(client_store);
218 }
219
220 + msm_compat_gnome_shutdown();
221 mdm_log_shutdown();
222
223 return 0;
224 diff --git a/mate-session/msm-gnome.c b/mate-session/msm-gnome.c
225 new file mode 100644
226 index 0000000..5c7d8dc
227 --- /dev/null
228 +++ b/mate-session/msm-gnome.c
229 @@ -0,0 +1,242 @@
230 +/*
231 + * Copyright (c) 2004-2005 Benedikt Meurer <benny@××××.org>
232 + * 2013 Stefano Karapetsas <stefano@××××××××××.com>
233 + *
234 + * This program is free software; you can redistribute it and/or modify
235 + * it under the terms of the GNU General Public License as published by
236 + * the Free Software Foundation; either version 2, or (at your option)
237 + * any later version.
238 + *
239 + * This program is distributed in the hope that it will be useful,
240 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
241 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
242 + * GNU General Public License for more details.
243 + *
244 + * You should have received a copy of the GNU General Public License
245 + * along with this program; if not, write to the Free Software
246 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
247 + * MA 02110-1301 USA.
248 + *
249 + * Most parts of this file where taken from xfce4-session and
250 + * gnome-session.
251 + */
252 +
253 +#include "config.h"
254 +
255 +#include <sys/types.h>
256 +#include <sys/wait.h>
257 +#include <signal.h>
258 +#include <stdlib.h>
259 +#include <string.h>
260 +#include <unistd.h>
261 +#include <fcntl.h>
262 +#include <errno.h>
263 +
264 +#include <X11/Xatom.h>
265 +#include <X11/Xlib.h>
266 +
267 +#include <gdk/gdkx.h>
268 +
269 +#include "msm-gnome.h"
270 +
271 +#define GNOME_KEYRING_DAEMON "gnome-keyring-daemon"
272 +
273 +
274 +static gboolean gnome_compat_started = FALSE;
275 +static int keyring_lifetime_pipe[2];
276 +static pid_t gnome_keyring_daemon_pid = 0;
277 +static Window gnome_smproxy_window = None;
278 +
279 +static void
280 +child_setup (gpointer user_data)
281 +{
282 + gint open_max;
283 + gint fd;
284 + char *fd_str;
285 +
286 + open_max = sysconf (_SC_OPEN_MAX);
287 + for (fd = 3; fd < open_max; fd++)
288 + {
289 + if (fd != keyring_lifetime_pipe[0])
290 + fcntl (fd, F_SETFD, FD_CLOEXEC);
291 + }
292 +
293 + fd_str = g_strdup_printf ("%d", keyring_lifetime_pipe[0]);
294 + g_setenv ("GNOME_KEYRING_LIFETIME_FD", fd_str, TRUE);
295 + g_free (fd_str);
296 +}
297 +
298 +
299 +static void
300 +gnome_keyring_daemon_startup (void)
301 +{
302 + GError *error = NULL;
303 + gchar *sout;
304 + gchar **lines;
305 + gsize lineno;
306 + gint status;
307 + glong pid;
308 + gchar *end;
309 + gchar *argv[3];
310 + gchar *p;
311 + gchar *name;
312 + const gchar *value;
313 +
314 + /* Pipe to slave keyring lifetime to */
315 + if (pipe (keyring_lifetime_pipe))
316 + {
317 + g_warning ("Failed to set up pipe for gnome-keyring: %s", strerror (errno));
318 + return;
319 + }
320 +
321 + error = NULL;
322 + argv[0] = GNOME_KEYRING_DAEMON;
323 + argv[1] = "--start";
324 + argv[2] = NULL;
325 + g_spawn_sync (NULL, argv, NULL,
326 + G_SPAWN_SEARCH_PATH | G_SPAWN_LEAVE_DESCRIPTORS_OPEN,
327 + child_setup, NULL,
328 + &sout, NULL, &status, &error);
329 +
330 + close (keyring_lifetime_pipe[0]);
331 + /* We leave keyring_lifetime_pipe[1] open for the lifetime of the session,
332 + in order to slave the keyring daemon lifecycle to the session. */
333 +
334 + if (error != NULL)
335 + {
336 + g_printerr ("Failed to run gnome-keyring-daemon: %s\n",
337 + error->message);
338 + g_error_free (error);
339 + }
340 + else
341 + {
342 + if (WIFEXITED (status) && WEXITSTATUS (status) == 0 && sout != NULL)
343 + {
344 + lines = g_strsplit (sout, "\n", 0);
345 +
346 + for (lineno = 0; lines[lineno] != NULL; lineno++)
347 + {
348 + p = strchr (lines[lineno], '=');
349 + if (p == NULL)
350 + continue;
351 +
352 + name = g_strndup (lines[lineno], p - lines[lineno]);
353 + value = p + 1;
354 +
355 + g_setenv (name, value, TRUE);
356 +
357 + if (g_strcmp0 (name, "GNOME_KEYRING_PID") == 0)
358 + {
359 + pid = strtol (value, &end, 10);
360 + if (end != value)
361 + gnome_keyring_daemon_pid = pid;
362 + }
363 +
364 + g_free (name);
365 + }
366 +
367 + g_strfreev (lines);
368 + }
369 + else
370 + {
371 + /* daemon failed for some reason */
372 + g_printerr ("gnome-keyring-daemon failed to start correctly, "
373 + "exit code: %d\n", WEXITSTATUS (status));
374 + }
375 +
376 + g_free (sout);
377 + }
378 +}
379 +
380 +static void
381 +gnome_keyring_daemon_shutdown (void)
382 +{
383 + if (gnome_keyring_daemon_pid != 0)
384 + {
385 + kill (gnome_keyring_daemon_pid, SIGTERM);
386 + gnome_keyring_daemon_pid = 0;
387 + }
388 +}
389 +
390 +
391 +
392 +static void
393 +msm_compat_gnome_smproxy_startup (void)
394 +{
395 + Atom gnome_sm_proxy;
396 + Display *dpy;
397 + Window root;
398 +
399 + gdk_error_trap_push ();
400 +
401 + /* Set GNOME_SM_PROXY property, since some apps (like OOo) seem to require
402 + * it to behave properly. Thanks to Jasper/Francois for reporting this.
403 + * This has another advantage, since it prevents people from running
404 + * gnome-smproxy in xfce4, which would cause trouble otherwise.
405 + */
406 + dpy = gdk_display;
407 + root = RootWindow (dpy, 0);
408 +
409 + if (gnome_smproxy_window != None)
410 + XDestroyWindow (dpy, gnome_smproxy_window);
411 +
412 + gnome_sm_proxy = XInternAtom (dpy, "GNOME_SM_PROXY", False);
413 + gnome_smproxy_window = XCreateSimpleWindow (dpy, root, 1, 1, 1, 1, 0, 0, 0);
414 +
415 + XChangeProperty (dpy, gnome_smproxy_window, gnome_sm_proxy,
416 + XA_CARDINAL, 32, PropModeReplace,
417 + (unsigned char *) (void *) &gnome_smproxy_window, 1);
418 + XChangeProperty (dpy, root, gnome_sm_proxy,
419 + XA_CARDINAL, 32, PropModeReplace,
420 + (unsigned char *) (void *) &gnome_smproxy_window, 1);
421 +
422 + XSync (dpy, False);
423 +
424 + gdk_error_trap_pop ();
425 +}
426 +
427 +
428 +static void
429 +msm_compat_gnome_smproxy_shutdown (void)
430 +{
431 + gdk_error_trap_push ();
432 +
433 + if (gnome_smproxy_window != None)
434 + {
435 + XDestroyWindow (gdk_display, gnome_smproxy_window);
436 + XSync (gdk_display, False);
437 + gnome_smproxy_window = None;
438 + }
439 +
440 + gdk_error_trap_pop ();
441 +}
442 +
443 +
444 +void
445 +msm_compat_gnome_startup (void)
446 +{
447 + if (G_UNLIKELY (gnome_compat_started))
448 + return;
449 +
450 + msm_compat_gnome_smproxy_startup ();
451 +
452 + gnome_keyring_daemon_startup ();
453 +
454 + gnome_compat_started = TRUE;
455 +}
456 +
457 +
458 +void
459 +msm_compat_gnome_shutdown (void)
460 +{
461 + if (G_UNLIKELY (!gnome_compat_started))
462 + return;
463 +
464 + /* shutdown the keyring daemon */
465 + gnome_keyring_daemon_shutdown ();
466 +
467 + msm_compat_gnome_smproxy_shutdown ();
468 +
469 + gnome_compat_started = FALSE;
470 +}
471 +
472 diff --git a/mate-session/msm-gnome.h b/mate-session/msm-gnome.h
473 new file mode 100644
474 index 0000000..2f15909
475 --- /dev/null
476 +++ b/mate-session/msm-gnome.h
477 @@ -0,0 +1,30 @@
478 +/*
479 + * Copyright (c) 2004 Benedikt Meurer <benny@××××.org>
480 + * 2013 Stefano Karapetsas <stefano@××××××××××.com>
481 + *
482 + * This program is free software; you can redistribute it and/or modify
483 + * it under the terms of the GNU General Public License as published by
484 + * the Free Software Foundation; either version 2, or (at your option)
485 + * any later version.
486 + *
487 + * This program is distributed in the hope that it will be useful,
488 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
489 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
490 + * GNU General Public License for more details.
491 + *
492 + * You should have received a copy of the GNU General Public License
493 + * along with this program; if not, write to the Free Software
494 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
495 + * MA 02110-1301 USA.
496 + *
497 + * Most parts of this file where taken from xfce4-session and
498 + * gnome-session.
499 + */
500 +
501 +#ifndef __MSM_GNOME_H__
502 +#define __MSM_GNOME_H__
503 +
504 +void msm_compat_gnome_startup (void);
505 +void msm_compat_gnome_shutdown (void);
506 +
507 +#endif /* !__MSM_GNOME_H__ */
508
509
510
511 1.1 mate-base/mate-session-manager/files/defaults.list
512
513 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/defaults.list?rev=1.1&view=markup
514 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/defaults.list?rev=1.1&content-type=text/plain
515
516 Index: defaults.list
517 ===================================================================
518 [Default Applications]
519 application/rtf=abiword.desktop
520 application/x-abiword=abiword.desktop
521 text/abiword=abiword.desktop
522 text/richtext=abiword.desktop
523 text/rtf=abiword.desktop
524 text/x-abiword=abiword.desktop
525 text/x-xml-abiword=abiword.desktop
526 x-content/blank-bd=brasero-caja.desktop
527 x-content/blank-dvd=brasero-caja.desktop
528 x-content/blank-cd=brasero-caja.desktop
529 x-content/blank-hddvd=brasero-caja.desktop
530 application/x-dia-diagram=dia.desktop
531 image/bmp=eom.desktop
532 image/gif=eom.desktop
533 image/jpeg=eom.desktop
534 image/jpg=eom.desktop
535 image/pjpeg=eom.desktop
536 image/png=eom.desktop
537 image/svg+xml=eom.desktop
538 image/svg+xml-compressed=eom.desktop
539 image/x-bmp=eom.desktop
540 image/x-gray=eom.desktop
541 image/x-icb=eom.desktop
542 image/x-ico=eom.desktop
543 image/x-pcx=eom.desktop
544 image/x-png=eom.desktop
545 image/x-portable-anymap=eom.desktop
546 image/x-portable-bitmap=eom.desktop
547 image/x-portable-graymap=eom.desktop
548 image/x-portable-pixmap=eom.desktop
549 image/x-xbitmap=eom.desktop
550 image/x-xpixmap=eom.desktop
551 image/vnd.wap.wbmp=eom.desktop
552 image/g3fax=gimp.desktop
553 image/x-compressed-xcf=gimp.desktop
554 image/x-fits=gimp.desktop
555 image/x-icon=gimp.desktop
556 image/x-psd=gimp.desktop
557 image/x-sgi=gimp.desktop
558 image/x-sun-raster=gimp.desktop
559 image/x-tga=gimp.desktop
560 image/x-xcf=gimp.desktop
561 image/x-xwindowdump=gimp.desktop
562 application/xhtml+xml=firefox.desktop;firefox-3.6.desktop;epiphany.desktop
563 text/html=firefox.desktop;firefox-3.6.desktop;epiphany.desktop
564 application/pdf=atril.desktop
565 application/x-bzpdf=atril.desktop
566 application/x-gzpdf=atril.desktop
567 application/postscript=atril.desktop
568 application/x-bzpostscript=atril.desktop
569 application/x-gzpostscript=atril.desktop
570 image/x-eps=atril.desktop
571 image/x-bzeps=atril.desktop
572 image/x-gzeps=atril.desktop
573 application/x-dvi=atril.desktop
574 application/x-bzdvi=atril.desktop
575 application/x-gzdvi=atril.desktop
576 image/vnd.djvu=atril.desktop
577 image/tiff=atril.desktop
578 application/x-cbr=atril.desktop
579 application/x-cbz=atril.desktop
580 application/x-cb7=atril.desktop
581 application/x-7z-compressed=engrampa.desktop
582 application/x-7z-compressed-tar=engrampa.desktop
583 application/x-ace=engrampa.desktop
584 application/x-alz=engrampa.desktop
585 application/x-ar=engrampa.desktop
586 application/x-arj=engrampa.desktop
587 application/x-bzip=engrampa.desktop
588 application/x-bzip-compressed-tar=engrampa.desktop
589 application/x-bzip1=engrampa.desktop
590 application/x-bzip1-compressed-tar=engrampa.desktop
591 application/x-cabinet=engrampa.desktop
592 application/x-cd-image=engrampa.desktop
593 application/x-compress=engrampa.desktop
594 application/x-compressed-tar=engrampa.desktop
595 application/x-cpio=engrampa.desktop
596 application/x-deb=engrampa.desktop
597 application/x-ear=engrampa.desktop
598 application/x-gtar=engrampa.desktop
599 application/x-gzip=engrampa.desktop
600 application/x-java-archive=engrampa.desktop
601 application/x-lha=engrampa.desktop
602 application/x-lhz=engrampa.desktop
603 application/x-lzip=engrampa.desktop
604 application/x-lzip-compressed-tar=engrampa.desktop
605 application/x-lzma=engrampa.desktop
606 application/x-lzma-compressed-tar=engrampa.desktop
607 application/x-lzop=engrampa.desktop
608 application/x-lzop-compressed-tar=engrampa.desktop
609 application/x-rar=engrampa.desktop
610 application/x-rar-compressed=engrampa.desktop
611 application/x-rpm=engrampa.desktop
612 application/x-rzip=engrampa.desktop
613 application/x-tar=engrampa.desktop
614 application/x-tarz=engrampa.desktop
615 application/x-stuffit=engrampa.desktop
616 application/x-war=engrampa.desktop
617 application/x-xz=engrampa.desktop
618 application/x-xz-compressed-tar=engrampa.desktop
619 application/x-zip=engrampa.desktop
620 application/x-zip-compressed=engrampa.desktop
621 application/x-zoo=engrampa.desktop
622 application/zip=engrampa.desktop
623 multipart/x-zip=engrampa.desktop
624 text/plain=pluma.desktop
625 text/css=pluma.desktop
626 text/javascript=pluma.desktop
627 text/mathml=pluma.desktop
628 text/x-csrc=pluma.desktop
629 text/x-chdr=pluma.desktop
630 text/x-dtd=pluma.desktop
631 text/x-java=pluma.desktop
632 text/x-javascript=pluma.desktop
633 text/x-patch=pluma.desktop
634 text/x-perl=pluma.destkop
635 text/x-php=pluma.destkop
636 text/x-python=pluma.destkop
637 text/x-sql=pluma.desktop
638 text/xml=pluma.desktop
639 application/javascript=pluma.destkop
640 application/x-cgi=pluma.desktop
641 application/x-javascript=pluma.desktop
642 application/x-perl=pluma.desktop
643 application/x-php=pluma.desktop
644 application/x-python=pluma.desktop
645 application/xml=pluma.desktop
646 application/xml-dtd=pluma.desktop
647 application/x-font-ttf=mate-font-viewer.desktop
648 application/x-font-pcf=mate-font-viewer.desktop
649 application/x-font-type1=mate-font-viewer.desktop
650 application/x-font-otf=mate-font-viewer.desktop
651 application/csv=gnumeric.desktop
652 application/excel=gnumeric.desktop
653 application/msexcel=gnumeric.desktop
654 application/tab-separated-values=gnumeric.desktop
655 application/vnd.lotus-1-2-3=gnumeric.desktop
656 application/vnd.ms-excel=gnumeric.desktop
657 application/x-123=gnumeric.desktop
658 application/x-applix-spreadsheet=gnumeric.desktop
659 application/x-dbase=gnumeric.desktop
660 application/x-dbf=gnumeric.desktop
661 application/x-dos_ms_excel=gnumeric.desktop
662 application/x-excel=gnumeric.desktop
663 application/x-gnumeric=gnumeric.desktop
664 application/x-mps=gnumeric.desktop
665 application/x-ms-excel=gnumeric.desktop
666 application/x-msexcel=gnumeric.desktop
667 application/x-oleo=gnumeric.desktop
668 application/x-planperfect=gnumeric.desktop
669 application/x-quattropro=gnumeric.desktop
670 application/x-sc=gnumeric.desktop
671 application/x-sylk=gnumeric.desktop
672 application/x-xbase=gnumeric.desktop
673 application/x-xls=gnumeric.desktop
674 application/xls=gnumeric.desktop
675 text/comma-separated-values=gnumeric.desktop
676 text/csv=gnumeric.desktop
677 text/spreadsheet=gnumeric.desktop
678 text/tab-separated-values=gnumeric.desktop
679 text/x-comma-separated-values=gnumeric.desktop
680 text/x-csv=gnumeric.desktop
681 zz-application/zz-winassoc-xls=gnumeric.desktop
682 x-content/software=caja-autorun-software.desktop
683 x-directory/gnome-default-handler=caja-folder-handler.desktop
684 x-directory/normal=caja-folder-handler.desktop
685 inode/directory=caja-folder-handler.desktop
686 application/x-gnome-saved-search=caja-folder-handler.desktop
687 application/vnd.oasis.opendocument.spreadsheet=libreoffice-calc.desktop;openoffice.org-calc.desktop
688 application/vnd.oasis.opendocument.spreadsheet-template=libreoffice-calc.desktop;openoffice.org-calc.desktop
689 application/vnd.sun.xml.calc=libreoffice-calc.desktop;openoffice.org-calc.desktop
690 application/vnd.sun.xml.calc.template=libreoffice-calc.desktop;openoffice.org-calc.desktop
691 application/vnd.stardivision.calc=libreoffice-calc.desktop;openoffice.org-calc.desktop
692 application/vnd.stardivision.chart=libreoffice-calc.desktop;openoffice.org-calc.desktop
693 application/vnd.openxmlformats-officedocument.spreadsheetml.sheet=libreoffice-calc.desktop;openoffice.org-calc.desktop
694 application/vnd.ms-excel.sheet.macroenabled.12=libreoffice-calc.desktop;openoffice.org-calc.desktop
695 application/vnd.openxmlformats-officedocument.spreadsheetml.template=libreoffice-calc.desktop;openoffice.org-calc.desktop
696 application/vnd.ms-excel.template.macroenabled.12=libreoffice-calc.desktop;openoffice.org-calc.desktop
697 application/vnd.ms-excel.sheet.binary.macroenabled.12=libreoffice-calc.desktop;openoffice.org-calc.desktop
698 application/vnd.oasis.opendocument.graphics=libreoffice-draw.desktop;openoffice.org-draw.desktop
699 application/vnd.oasis.opendocument.graphics-template=libreoffice-draw.desktop;openoffice.org-draw.desktop
700 application/vnd.sun.xml.draw=libreoffice-draw.desktop;openoffice.org-draw.desktop
701 application/vnd.sun.xml.draw.template=libreoffice-draw.desktop;openoffice.org-draw.desktop
702 application/vnd.stardivision.draw=libreoffice-draw.desktop;openoffice.org-draw.desktop
703 application/vnd.oasis.opendocument.presentation=libreoffice-impress.desktop;openoffice.org-impress.desktop
704 application/vnd.oasis.opendocument.presentation-template=libreoffice-impress.desktop;openoffice.org-impress.desktop
705 application/vnd.sun.xml.impress=libreoffice-impress.desktop;openoffice.org-impress.desktop
706 application/vnd.sun.xml.impress.template=libreoffice-impress.desktop;openoffice.org-impress.desktop
707 application/vnd.stardivision.impress=libreoffice-impress.desktop;openoffice.org-impress.desktop
708 application/mspowerpoint=libreoffice-impress.desktop;openoffice.org-impress.desktop
709 application/vnd.ms-powerpoint=libreoffice-impress.desktop;openoffice.org-impress.desktop
710 application/vnd.openxmlformats-officedocument.presentationml.presentation=libreoffice-impress.desktop;openoffice.org-impress.desktop
711 application/vnd.ms-powerpoint.presentation.macroenabled.12=libreoffice-impress.desktop;openoffice.org-impress.desktop
712 application/vnd.openxmlformats-officedocument.presentationml.template=libreoffice-impress.desktop;openoffice.org-impress.desktop
713 application/vnd.ms-powerpoint.template.macroenabled.12=libreoffice-impress.desktop;openoffice.org-impress.desktop
714 application/vnd.oasis.opendocument.formula=libreoffice-math.desktop;openoffice.org-math.desktop
715 application/vnd.sun.xml.math=libreoffice-math.desktop;openoffice.org-math.desktop
716 application/vnd.stardivision.math=libreoffice-math.desktop;openoffice.org-math.desktop
717 application/vnd.oasis.opendocument.text=libreoffice-writer.desktop;openoffice.org-writer.desktop
718 application/vnd.oasis.opendocument.text-template=libreoffice-writer.desktop;openoffice.org-writer.desktop
719 application/vnd.oasis.opendocument.text-web=libreoffice-writer.desktop;openoffice.org-writer.desktop
720 application/vnd.oasis.opendocument.text-master=libreoffice-writer.desktop;openoffice.org-writer.desktop
721 application/vnd.sun.xml.writer=libreoffice-writer.desktop;openoffice.org-writer.desktop
722 application/vnd.sun.xml.writer.template=libreoffice-writer.desktop;openoffice.org-writer.desktop
723 application/vnd.sun.xml.writer.global=libreoffice-writer.desktop;openoffice.org-writer.desktop
724 application/vnd.stardivision.writer=libreoffice-writer.desktop;openoffice.org-writer.desktop
725 application/msword=libreoffice-writer.desktop;openoffice.org-writer.desktop
726 application/vnd.ms-word=libreoffice-writer.desktop;openoffice.org-writer.desktop
727 application/x-doc=libreoffice-writer.desktop;openoffice.org-writer.desktop
728 application/vnd.wordperfect=libreoffice-writer.desktop;openoffice.org-writer.desktop
729 application/wordperfect=libreoffice-writer.desktop;openoffice.org-writer.desktop
730 application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice-writer.desktop;openoffice.org-writer.desktop
731 application/vnd.ms-word.document.macroenabled.12=libreoffice-writer.desktop;openoffice.org-writer.desktop
732 application/vnd.openxmlformats-officedocument.wordprocessingml.template=libreoffice-writer.desktop;openoffice.org-writer.desktop
733 application/vnd.ms-word.template.macroenabled.12=libreoffice-writer.desktop;openoffice.org-writer.desktop
734 x-content/audio-player=rhythmbox.desktop
735 x-content/audio-cdda=sound-juicer.desktop
736 application/x-shockwave-flash=swfdec-player.desktop
737 application/futuresplash=swfdec-player.desktop
738 application/mxf=vlc.desktop
739 application/ogg=vlc.desktop
740 application/ram=vlc.desktop
741 application/sdp=vlc.desktop
742 application/smil=vlc.desktop
743 application/smil+xml=vlc.desktop
744 application/vnd.ms-wpl=vlc.desktop
745 application/vnd.rn-realmedia=vlc.desktop
746 application/x-extension-m4a=vlc.desktop
747 application/x-extension-mp4=vlc.desktop
748 application/x-flac=vlc.desktop
749 application/x-flash-video=vlc.desktop
750 application/x-lyx=lyx.desktop
751 application/x-matroska=vlc.desktop
752 application/x-netshow-channel=vlc.desktop
753 application/x-ogg=vlc.desktop
754 application/x-quicktime-media-link=vlc.desktop
755 application/x-quicktimeplayer=vlc.desktop
756 application/x-shorten=vlc.desktop
757 application/x-smil=vlc.desktop
758 application/xspf+xml=vlc.desktop
759 audio/3gpp=vlc.desktop
760 audio/ac3=vlc.desktop
761 audio/AMR=vlc.desktop
762 audio/AMR-WB=vlc.desktop
763 audio/basic=vlc.desktop
764 audio/midi=vlc.desktop
765 audio/mp4=vlc.desktop
766 audio/mpeg=vlc.desktop
767 audio/mpegurl=vlc.desktop
768 audio/ogg=vlc.desktop
769 audio/prs.sid=vlc.desktop
770 audio/vnd.rn-realaudio=vlc.desktop
771 audio/x-ape=vlc.desktop
772 audio/x-flac=vlc.desktop
773 audio/x-gsm=vlc.desktop
774 audio/x-it=vlc.desktop
775 audio/x-m4a=vlc.desktop
776 audio/x-matroska=vlc.desktop
777 audio/x-mod=vlc.desktop
778 audio/x-mp3=vlc.desktop
779 audio/x-mpeg=vlc.desktop
780 audio/x-mpegurl=vlc.desktop
781 audio/x-ms-asf=vlc.desktop
782 audio/x-ms-asx=vlc.desktop
783 audio/x-ms-wax=vlc.desktop
784 audio/x-ms-wma=vlc.desktop
785 audio/x-musepack=vlc.desktop
786 audio/x-pn-aiff=vlc.desktop
787 audio/x-pn-au=vlc.desktop
788 audio/x-pn-realaudio=vlc.desktop
789 audio/x-pn-realaudio-plugin=vlc.desktop
790 audio/x-pn-wav=vlc.desktop
791 audio/x-pn-windows-acm=vlc.desktop
792 audio/x-realaudio=vlc.desktop
793 audio/x-real-audio=vlc.desktop
794 audio/x-sbc=vlc.desktop
795 audio/x-scpls=vlc.desktop
796 audio/x-speex=vlc.desktop
797 audio/x-tta=vlc.desktop
798 audio/x-vorbis=audacious.desktop
799 audio/x-vorbis+ogg=audacious.desktop
800 audio/x-wav=audacious.desktop
801 audio/x-wavpack=audacious.desktop
802 audio/x-xm=audacious.desktop
803 image/vnd.rn-realpix=vlc.desktop
804 image/x-pict=vlc.desktop
805 misc/ultravox=vlc.desktop
806 text/google-video-pointer=vlc.desktop
807 text/x-google-video-pointer=vlc.desktop
808 video/3gpp=vlc.desktop
809 video/dv=vlc.desktop
810 video/fli=vlc.desktop
811 video/flv=vlc.desktop
812 video/mp2t=vlc.desktop
813 video/mp4=vlc.desktop
814 video/mp4v-es=vlc.desktop
815 video/mpeg=vlc.desktop
816 video/msvideo=vlc.desktop
817 video/ogg=vlc.desktop
818 video/quicktime=vlc.desktop
819 video/vivo=vlc.desktop
820 video/vnd.divx=vlc.desktop
821 video/vnd.rn-realvideo=vlc.desktop
822 video/vnd.vivo=vlc.desktop
823 video/webm=vlc.desktop
824 video/x-anim=vlc.desktop
825 video/x-avi=vlc.desktop
826 video/x-flc=vlc.desktop
827 video/x-fli=vlc.desktop
828 video/x-flic=vlc.desktop
829 video/x-flv=vlc.desktop
830 video/x-m4v=vlc.desktop
831 video/x-matroska=vlc.desktop
832 video/x-mpeg=vlc.desktop
833 video/x-ms-asf=vlc.desktop
834 video/x-ms-asx=vlc.desktop
835 video/x-msvideo=vlc.desktop
836 video/x-ms-wm=vlc.desktop
837 video/x-ms-wmv=vlc.desktop
838 video/x-ms-wmx=vlc.desktop
839 video/x-ms-wvx=vlc.desktop
840 video/x-nsv=vlc.desktop
841 video/x-ogm+ogg=vlc.desktop
842 video/x-theora+ogg=vlc.desktop
843 video/x-totem-stream=vlc.desktop
844 x-content/video-dvd=vlc.desktop
845 x-content/video-vcd=vlc.desktop
846 x-content/video-svcd=vlc.desktop
847 x-scheme-handler/ghelp=yelp.desktop;
848 x-scheme-handler/help=yelp.desktop;
849 x-scheme-handler/http=firefox.desktop;epiphany.desktop
850 x-scheme-handler/https=firefox.desktop;epiphany.desktop
851 x-scheme-handler/mailto=evolution.desktop
852 application/x-bittorrent=transmission-gtk.desktop;deluge.desktop
853 x-scheme-handler/magnet=transmission-gtk.desktop;deluge.desktop
854
855
856
857 1.1 mate-base/mate-session-manager/files/mate-session-manager-1.5.2-save-session-ui.patch
858
859 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/mate-session-manager-1.5.2-save-session-ui.patch?rev=1.1&view=markup
860 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/mate-session-manager-1.5.2-save-session-ui.patch?rev=1.1&content-type=text/plain
861
862 Index: mate-session-manager-1.5.2-save-session-ui.patch
863 ===================================================================
864 diff -burN a/capplet/gsm-properties-dialog.c b/capplet/gsm-properties-dialog.c
865 --- a/capplet/gsm-properties-dialog.c 2012-02-29 22:03:08.000000000 +0100
866 +++ b/capplet/gsm-properties-dialog.c 2012-08-08 12:16:37.527332034 +0200
867 @@ -26,6 +26,8 @@
868 #include <glib.h>
869 #include <glib/gi18n.h>
870 #include <gtk/gtk.h>
871 +#include <dbus/dbus-glib.h>
872 +#include <dbus/dbus-glib-lowlevel.h>
873
874 #include <mateconf/mateconf-client.h>
875
876 @@ -36,6 +38,11 @@
877 #include "gsp-app.h"
878 #include "gsp-app-manager.h"
879
880 +
881 +#define GSM_SERVICE_DBUS "org.mate.SessionManager"
882 +#define GSM_PATH_DBUS "/org/mate/SessionManager"
883 +#define GSM_INTERFACE_DBUS "org.mate.SessionManager"
884 +
885 #define GSM_PROPERTIES_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_PROPERTIES_DIALOG, GsmPropertiesDialogPrivate))
886
887 #define IS_STRING_EMPTY(x) ((x)==NULL||(x)[0]=='\0')
888 @@ -50,6 +57,7 @@
889 #define CAPPLET_DELETE_WIDGET_NAME "session_properties_delete_button"
890 #define CAPPLET_EDIT_WIDGET_NAME "session_properties_edit_button"
891 #define CAPPLET_SAVE_WIDGET_NAME "session_properties_save_button"
892 +#define CAPPLET_SESSION_SAVED_WIDGET_NAME "session_properties_session_saved_label"
893 #define CAPPLET_REMEMBER_WIDGET_NAME "session_properties_remember_toggle"
894
895 #define STARTUP_APP_ICON "system-run"
896 @@ -493,10 +501,66 @@
897 }
898
899 static void
900 +session_saved_message (GsmPropertiesDialog *dialog,
901 + const char *msg,
902 + gboolean is_error)
903 +{
904 + GtkLabel *label;
905 + gchar *markup;
906 +
907 + label = GTK_LABEL (gtk_builder_get_object (dialog->priv->xml, CAPPLET_SESSION_SAVED_WIDGET_NAME));
908 + if (is_error)
909 + markup = g_markup_printf_escaped ("<span foreground=\"red\">%s</span>", msg);
910 + else
911 + markup = g_markup_escape_text (msg, -1);
912 +
913 + gtk_label_set_markup (label, markup);
914 + g_free (markup);
915 +}
916 +
917 +static void
918 +session_saved_cb (DBusGProxy *proxy,
919 + DBusGProxyCall *call_id,
920 + void *user_data)
921 +{
922 + gboolean res;
923 + GsmPropertiesDialog *dialog = user_data;
924 +
925 + res = dbus_g_proxy_end_call (proxy, call_id, NULL, G_TYPE_INVALID);
926 + if (res)
927 + session_saved_message (dialog, _("Your session has been saved."), FALSE);
928 + else
929 + session_saved_message (dialog, _("Failed to save session"), TRUE);
930 +
931 + g_object_unref (proxy);
932 +}
933 +
934 +static void
935 on_save_session_clicked (GtkWidget *widget,
936 GsmPropertiesDialog *dialog)
937 {
938 - g_debug ("Session saving is not implemented yet!");
939 + DBusGConnection *conn;
940 + DBusGProxy *proxy;
941 + DBusGProxyCall *call;
942 +
943 + conn = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
944 + if (conn == NULL) {
945 + session_saved_message (dialog, _("Could not connect to the session bus"), TRUE);
946 + return;
947 + }
948 +
949 + proxy = dbus_g_proxy_new_for_name (conn, GSM_SERVICE_DBUS, GSM_PATH_DBUS, GSM_INTERFACE_DBUS);
950 + if (proxy == NULL) {
951 + session_saved_message (dialog, _("Could not connect to the session manager"), TRUE);
952 + return;
953 + }
954 +
955 + call = dbus_g_proxy_begin_call (proxy, "SaveSession", session_saved_cb, dialog, NULL, G_TYPE_INVALID);
956 + if (call == NULL) {
957 + session_saved_message (dialog, _("Failed to save session"), TRUE);
958 + g_object_unref (proxy);
959 + return;
960 + }
961 }
962
963 static void
964 diff -burN a/configure.ac b/configure.ac
965 --- a/configure.ac 2012-02-29 22:03:09.000000000 +0100
966 +++ b/configure.ac 2012-08-08 12:18:58.740336360 +0200
967 @@ -75,6 +75,7 @@
968 PKG_CHECK_MODULES(SESSION_PROPERTIES,
969 glib-2.0 >= $GLIB_REQUIRED
970 gtk+-$GTK_API_VERSION >= $GTK_REQUIRED
971 + dbus-glib-1 >= $DBUS_GLIB_REQUIRED
972 )
973
974 PKG_CHECK_MODULES(SM, sm)
975 diff -burN a/data/session-properties.ui b/data/session-properties.ui
976 --- a/data/session-properties.ui 2012-02-29 22:03:08.000000000 +0100
977 +++ b/data/session-properties.ui 2012-08-08 12:22:36.619343035 +0200
978 @@ -148,6 +148,7 @@
979 <property name="visible">True</property>
980 <child>
981 <object class="GtkButton" id="session_properties_save_button">
982 + <property name="visible">True</property>
983 <property name="can_focus">True</property>
984 <property name="receives_default">True</property>
985 <child>
986 @@ -191,6 +192,17 @@
987 <property name="position">1</property>
988 </packing>
989 </child>
990 + <child>
991 + <object class="GtkLabel" id="session_properties_session_saved_label">
992 + <property name="visible">True</property>
993 + <property name="wrap">True</property>
994 + </object>
995 + <packing>
996 + <property name="expand">False</property>
997 + <property name="fill">False</property>
998 + <property name="position">2</property>
999 + </packing>
1000 + </child>
1001 </object>
1002 <packing>
1003 <property name="position">1</property>
1004 diff -burN a/mate-session/gsm-client.c b/mate-session/gsm-client.c
1005 --- a/mate-session/gsm-client.c 2012-02-29 22:03:08.000000000 +0100
1006 +++ b/mate-session/gsm-client.c 2012-08-08 12:24:20.120346205 +0200
1007 @@ -510,6 +510,17 @@
1008 g_signal_emit (client, signals[DISCONNECTED], 0);
1009 }
1010
1011 +gboolean
1012 +gsm_client_request_save (GsmClient *client,
1013 + guint flags,
1014 + GError **error)
1015 +{
1016 + g_return_val_if_fail (GSM_IS_CLIENT (client), FALSE);
1017 +
1018 + return GSM_CLIENT_GET_CLASS (client)->impl_request_save (client, flags, error);
1019 +}
1020 +
1021 +
1022 GKeyFile *
1023 gsm_client_save (GsmClient *client,
1024 GError **error)
1025 diff -burN a/mate-session/gsm-client.h b/mate-session/gsm-client.h
1026 --- a/mate-session/gsm-client.h 2012-02-29 22:03:09.000000000 +0100
1027 +++ b/mate-session/gsm-client.h 2012-08-08 12:26:38.848350455 +0200
1028 @@ -94,6 +94,9 @@
1029 GError **error);
1030 gboolean (*impl_stop) (GsmClient *client,
1031 GError **error);
1032 + gboolean (*impl_request_save) (GsmClient *client,
1033 + guint flags,
1034 + GError **error);
1035 GKeyFile * (*impl_save) (GsmClient *client,
1036 GError **error);
1037 };
1038 @@ -139,6 +142,10 @@
1039
1040 void gsm_client_disconnected (GsmClient *client);
1041
1042 +gboolean gsm_client_request_save (GsmClient *client,
1043 + guint flags,
1044 + GError **error);
1045 +
1046 GKeyFile *gsm_client_save (GsmClient *client,
1047 GError **error);
1048 /* exported to bus */
1049 diff -burN a/mate-session/gsm-dbus-client.c b/mate-session/gsm-dbus-client.c
1050 --- a/mate-session/gsm-dbus-client.c 2012-02-29 22:03:08.000000000 +0100
1051 +++ b/mate-session/gsm-dbus-client.c 2012-08-08 12:38:15.393371794 +0200
1052 @@ -413,6 +413,19 @@
1053 G_OBJECT_CLASS (gsm_dbus_client_parent_class)->finalize (object);
1054 }
1055
1056 +static gboolean
1057 +dbus_client_request_save (GsmClient *client,
1058 + guint flags,
1059 + GError **error)
1060 +{
1061 + g_debug ("GsmDBusClient: sending save request to client with id %s",
1062 + gsm_client_peek_id (client));
1063 +
1064 + /* FIXME: The protocol does not support this */
1065 +
1066 + return FALSE;
1067 +}
1068 +
1069 static GKeyFile *
1070 dbus_client_save (GsmClient *client,
1071 GError **error)
1072 @@ -665,6 +678,7 @@
1073 object_class->set_property = gsm_dbus_client_set_property;
1074 object_class->dispose = gsm_dbus_client_dispose;
1075
1076 + client_class->impl_request_save = dbus_client_request_save;
1077 client_class->impl_save = dbus_client_save;
1078 client_class->impl_stop = dbus_client_stop;
1079 client_class->impl_query_end_session = dbus_client_query_end_session;
1080 diff -burN a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c
1081 --- a/mate-session/gsm-manager.c 2012-02-29 22:03:09.000000000 +0100
1082 +++ b/mate-session/gsm-manager.c 2012-08-08 12:47:24.627388620 +0200
1083 @@ -68,6 +68,7 @@
1084 #define GSM_MANAGER_DBUS_NAME "org.mate.SessionManager"
1085
1086 #define GSM_MANAGER_PHASE_TIMEOUT 30 /* seconds */
1087 +#define GSM_MANAGER_SAVE_SESSION_TIMEOUT 2
1088
1089 #define MDM_FLEXISERVER_COMMAND "mdmflexiserver"
1090 #define MDM_FLEXISERVER_ARGS "--startnew Standard"
1091 @@ -1176,6 +1177,69 @@
1092
1093 }
1094
1095 +static gboolean
1096 +_client_request_save (GsmClient *client,
1097 + ClientEndSessionData *data)
1098 +{
1099 + gboolean ret;
1100 + GError *error;
1101 +
1102 + error = NULL;
1103 + ret = gsm_client_request_save (client, data->flags, &error);
1104 + if (ret) {
1105 + g_debug ("GsmManager: adding client to query clients: %s", gsm_client_peek_id (client));
1106 + data->manager->priv->query_clients = g_slist_prepend (data->manager->priv->query_clients,
1107 + client);
1108 + } else if (error) {
1109 + g_debug ("GsmManager: unable to query client: %s", error->message);
1110 + g_error_free (error);
1111 + }
1112 +
1113 + return FALSE;
1114 +}
1115 +
1116 +static gboolean
1117 +_client_request_save_helper (const char *id,
1118 + GsmClient *client,
1119 + ClientEndSessionData *data)
1120 +{
1121 + return _client_request_save (client, data);
1122 +}
1123 +
1124 +static void
1125 +query_save_session_complete (GsmManager *manager)
1126 +{
1127 + GError *error = NULL;
1128 +
1129 + if (g_slist_length (manager->priv->next_query_clients) > 0) {
1130 + ClientEndSessionData data;
1131 +
1132 + data.manager = manager;
1133 + data.flags = GSM_CLIENT_END_SESSION_FLAG_LAST;
1134 +
1135 + g_slist_foreach (manager->priv->next_query_clients,
1136 + (GFunc)_client_request_save,
1137 + &data);
1138 +
1139 + g_slist_free (manager->priv->next_query_clients);
1140 + manager->priv->next_query_clients = NULL;
1141 +
1142 + return;
1143 + }
1144 +
1145 + if (manager->priv->query_timeout_id > 0) {
1146 + g_source_remove (manager->priv->query_timeout_id);
1147 + manager->priv->query_timeout_id = 0;
1148 + }
1149 +
1150 + gsm_session_save (manager->priv->clients, &error);
1151 +
1152 + if (error) {
1153 + g_warning ("Error saving session: %s", error->message);
1154 + g_error_free (error);
1155 + }
1156 +}
1157 +
1158 static guint32
1159 generate_cookie (void)
1160 {
1161 @@ -1250,6 +1314,21 @@
1162 return FALSE;
1163 }
1164
1165 +static gboolean
1166 +_on_query_save_session_timeout (GsmManager *manager)
1167 +{
1168 + manager->priv->query_timeout_id = 0;
1169 +
1170 + g_debug ("GsmManager: query to save session timed out");
1171 +
1172 + g_slist_free (manager->priv->query_clients);
1173 + manager->priv->query_clients = NULL;
1174 +
1175 + query_save_session_complete (manager);
1176 +
1177 + return FALSE;
1178 +}
1179 +
1180 static void
1181 do_phase_query_end_session (GsmManager *manager)
1182 {
1183 @@ -1886,13 +1965,32 @@
1184 const char *reason,
1185 GsmManager *manager)
1186 {
1187 - /* just ignore if received outside of shutdown */
1188 - if (manager->priv->phase < GSM_MANAGER_PHASE_QUERY_END_SESSION) {
1189 + /* just ignore if we are not yet running */
1190 + if (manager->priv->phase < GSM_MANAGER_PHASE_RUNNING) {
1191 return;
1192 }
1193
1194 g_debug ("GsmManager: Response from end session request: is-ok=%d do-last=%d cancel=%d reason=%s", is_ok, do_last, cancel, reason ? reason :"");
1195
1196 + if (manager->priv->phase == GSM_MANAGER_PHASE_RUNNING) {
1197 + /* Ignore responses when no requests were sent */
1198 + if (manager->priv->query_clients == NULL) {
1199 + return;
1200 + }
1201 +
1202 + manager->priv->query_clients = g_slist_remove (manager->priv->query_clients, client);
1203 +
1204 + if (do_last) {
1205 + manager->priv->next_query_clients = g_slist_prepend (manager->priv->next_query_clients,
1206 + client);
1207 + }
1208 +
1209 + if (manager->priv->query_clients == NULL) {
1210 + query_save_session_complete (manager);
1211 + }
1212 + return;
1213 + }
1214 +
1215 if (cancel) {
1216 cancel_end_session (manager);
1217 return;
1218 @@ -1991,6 +2089,15 @@
1219 }
1220
1221 static void
1222 +on_xsmp_client_save_request (GsmXSMPClient *client,
1223 + gboolean show_dialog,
1224 + GsmManager *manager)
1225 +{
1226 + g_debug ("GsmManager: save_request");
1227 + gsm_manager_save_session (manager, NULL);
1228 +}
1229 +
1230 +static void
1231 on_store_client_added (GsmStore *store,
1232 const char *id,
1233 GsmManager *manager)
1234 @@ -2011,6 +2118,10 @@
1235 "logout-request",
1236 G_CALLBACK (on_xsmp_client_logout_request),
1237 manager);
1238 + g_signal_connect (client,
1239 + "save-request",
1240 + G_CALLBACK (on_xsmp_client_save_request),
1241 + manager);
1242 }
1243
1244 g_signal_connect (client,
1245 @@ -2968,6 +3079,41 @@
1246 }
1247
1248 gboolean
1249 +gsm_manager_save_session (GsmManager *manager,
1250 + GError **error)
1251 +{
1252 + ClientEndSessionData data;
1253 +
1254 + g_debug ("GsmManager: SaveSession called");
1255 +
1256 + g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE);
1257 +
1258 + if (manager->priv->phase != GSM_MANAGER_PHASE_RUNNING) {
1259 + g_set_error (error,
1260 + GSM_MANAGER_ERROR,
1261 + GSM_MANAGER_ERROR_NOT_IN_RUNNING,
1262 + "SaveSession interface is only available during the Running phase");
1263 + return FALSE;
1264 + }
1265 +
1266 + data.manager = manager;
1267 + data.flags = 0;
1268 + gsm_store_foreach (manager->priv->clients,
1269 + (GsmStoreFunc)_client_request_save_helper,
1270 + &data);
1271 +
1272 + if (manager->priv->query_clients) {
1273 + manager->priv->query_timeout_id = g_timeout_add_seconds (GSM_MANAGER_SAVE_SESSION_TIMEOUT,
1274 + (GSourceFunc)_on_query_save_session_timeout,
1275 + manager);
1276 + return TRUE;
1277 + } else {
1278 + g_debug ("GsmManager: Nothing to save");
1279 + return FALSE;
1280 + }
1281 +}
1282 +
1283 +gboolean
1284 gsm_manager_can_shutdown (GsmManager *manager,
1285 gboolean *shutdown_available,
1286 GError **error)
1287 diff -burN a/mate-session/gsm-manager.h b/mate-session/gsm-manager.h
1288 --- a/mate-session/gsm-manager.h 2012-02-29 22:03:09.000000000 +0100
1289 +++ b/mate-session/gsm-manager.h 2012-08-08 12:49:14.262391979 +0200
1290 @@ -154,6 +154,9 @@
1291 gboolean gsm_manager_shutdown (GsmManager *manager,
1292 GError **error);
1293
1294 +gboolean gsm_manager_save_session (GsmManager *manager,
1295 + GError **error);
1296 +
1297 gboolean gsm_manager_can_shutdown (GsmManager *manager,
1298 gboolean *shutdown_available,
1299 GError **error);
1300 diff -burN a/mate-session/gsm-xsmp-client.c b/mate-session/gsm-xsmp-client.c
1301 --- a/mate-session/gsm-xsmp-client.c 2012-02-29 22:03:08.000000000 +0100
1302 +++ b/mate-session/gsm-xsmp-client.c 2012-08-08 12:52:27.719397905 +0200
1303 @@ -69,6 +69,7 @@
1304 enum {
1305 REGISTER_REQUEST,
1306 LOGOUT_REQUEST,
1307 + SAVE_REQUEST,
1308 LAST_SIGNAL
1309 };
1310
1311 @@ -502,6 +503,31 @@
1312 return TRUE;
1313 }
1314
1315 +static gboolean
1316 +xsmp_request_save (GsmClient *client,
1317 + guint flags,
1318 + GError **error)
1319 +{
1320 + GsmXSMPClient *xsmp = (GsmXSMPClient *) client;
1321 +
1322 + g_debug ("GsmXSMPClient: xsmp_request_save ('%s')", xsmp->priv->description);
1323 +
1324 + if (xsmp->priv->conn == NULL) {
1325 + g_set_error (error,
1326 + GSM_CLIENT_ERROR,
1327 + GSM_CLIENT_ERROR_NOT_REGISTERED,
1328 + "Client is not registered");
1329 + return FALSE;
1330 + }
1331 +
1332 + if (flags & GSM_CLIENT_END_SESSION_FLAG_LAST)
1333 + xsmp_save_yourself_phase2 (client);
1334 + else
1335 + do_save_yourself (xsmp, SmSaveLocal, FALSE);
1336 +
1337 + return TRUE;
1338 +}
1339 +
1340 static char *
1341 get_desktop_file_path (GsmXSMPClient *client)
1342 {
1343 @@ -976,6 +1002,8 @@
1344 object_class->get_property = gsm_xsmp_client_get_property;
1345 object_class->set_property = gsm_xsmp_client_set_property;
1346
1347 +
1348 + client_class->impl_request_save = xsmp_request_save;
1349 client_class->impl_save = xsmp_save;
1350 client_class->impl_stop = xsmp_stop;
1351 client_class->impl_query_end_session = xsmp_query_end_session;
1352 @@ -1003,6 +1031,16 @@
1353 NULL,
1354 NULL,
1355 g_cclosure_marshal_VOID__BOOLEAN,
1356 + G_TYPE_NONE,
1357 + 1, G_TYPE_BOOLEAN);
1358 + signals[SAVE_REQUEST] =
1359 + g_signal_new ("save-request",
1360 + G_OBJECT_CLASS_TYPE (object_class),
1361 + G_SIGNAL_RUN_LAST,
1362 + G_STRUCT_OFFSET (GsmXSMPClientClass, save_request),
1363 + NULL,
1364 + NULL,
1365 + g_cclosure_marshal_VOID__BOOLEAN,
1366 G_TYPE_NONE,
1367 1, G_TYPE_BOOLEAN);
1368
1369 diff -burN a/mate-session/gsm-xsmp-client.h b/mate-session/gsm-xsmp-client.h
1370 --- a/mate-session/gsm-xsmp-client.h 2012-02-29 22:03:09.000000000 +0100
1371 +++ b/mate-session/gsm-xsmp-client.h 2012-08-08 12:53:39.629400108 +0200
1372 @@ -57,6 +57,8 @@
1373 gboolean (*logout_request) (GsmXSMPClient *client,
1374 gboolean prompt);
1375
1376 + gboolean (*save_request) (GsmXSMPClient *client,
1377 + gboolean prompt);
1378
1379 void (*saved_state) (GsmXSMPClient *client);
1380
1381 diff -burN a/mate-session/org.mate.SessionManager.xml b/mate-session/org.mate.SessionManager.xml
1382 --- a/mate-session/org.mate.SessionManager.xml 2012-02-29 22:03:09.000000000 +0100
1383 +++ b/mate-session/org.mate.SessionManager.xml 2012-08-08 12:57:41.216407509 +0200
1384 @@ -256,6 +256,14 @@
1385 </doc:doc>
1386 </method>
1387
1388 + <method name="SaveSession">
1389 + <doc:doc>
1390 + <doc:description>
1391 + <doc:para>Request to save session</doc:para>
1392 + </doc:description>
1393 + </doc:doc>
1394 + </method>
1395 +
1396 <method name="CanShutdown">
1397 <arg name="is_available" direction="out" type="b">
1398 <doc:doc>
1399
1400
1401
1402 1.1 mate-base/mate-session-manager/files/mate-session-manager-1.2.0-idle-transition.patch
1403
1404 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/mate-session-manager-1.2.0-idle-transition.patch?rev=1.1&view=markup
1405 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/mate-session-manager-1.2.0-idle-transition.patch?rev=1.1&content-type=text/plain
1406
1407 Index: mate-session-manager-1.2.0-idle-transition.patch
1408 ===================================================================
1409 --- a/mate-session/gs-idle-monitor.c 2012-02-29 22:03:08.000000000 +0100
1410 +++ b/mate-session/gs-idle-monitor.c 2012-08-08 11:49:13.308281663 +0200
1411 @@ -448,6 +448,7 @@
1412 attr.delta = delta;
1413 attr.events = TRUE;
1414
1415 + attr.trigger.wait_value = _int64_to_xsyncvalue (_xsyncvalue_to_int64 (watch->interval) - 1);
1416 attr.trigger.test_type = XSyncPositiveTransition;
1417 if (watch->xalarm_positive != None) {
1418 g_debug ("GSIdleMonitor: updating alarm for positive transition wait=%lld",
1419
1420
1421
1422 1.1 mate-base/mate-session-manager/files/mate-session-manager-1.6.1-login1.patch
1423
1424 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/mate-session-manager-1.6.1-login1.patch?rev=1.1&view=markup
1425 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mate-base/mate-session-manager/files/mate-session-manager-1.6.1-login1.patch?rev=1.1&content-type=text/plain
1426
1427 Index: mate-session-manager-1.6.1-login1.patch
1428 ===================================================================
1429 diff -up mate-session-manager-1.6.1/mate-session/gsm-logout-dialog.c.login1 mate-session-manager-1.6.1/mate-session/gsm-logout-dialog.c
1430 --- mate-session-manager-1.6.1/mate-session/gsm-logout-dialog.c.login1 2013-07-25 10:35:06.000000000 -0500
1431 +++ mate-session-manager-1.6.1/mate-session/gsm-logout-dialog.c 2013-09-10 08:25:55.450880450 -0500
1432 @@ -200,13 +200,29 @@ gsm_logout_dialog_destroy (GsmLogoutDial
1433 static gboolean
1434 gsm_logout_supports_system_suspend (GsmLogoutDialog *logout_dialog)
1435 {
1436 - return up_client_get_can_suspend (logout_dialog->priv->up_client);
1437 + gboolean ret;
1438 +#ifdef HAVE_SYSTEMD
1439 + if (LOGIND_RUNNING())
1440 + ret = gsm_systemd_can_suspend (logout_dialog->priv->systemd);
1441 + else
1442 +#endif
1443 + ret = up_client_get_can_suspend (logout_dialog->priv->up_client);
1444 +
1445 + return ret;
1446 }
1447
1448 static gboolean
1449 gsm_logout_supports_system_hibernate (GsmLogoutDialog *logout_dialog)
1450 {
1451 - return up_client_get_can_hibernate (logout_dialog->priv->up_client);
1452 + gboolean ret;
1453 +#ifdef HAVE_SYSTEMD
1454 + if (LOGIND_RUNNING())
1455 + ret = gsm_systemd_can_hibernate (logout_dialog->priv->systemd);
1456 + else
1457 +#endif
1458 + ret = up_client_get_can_hibernate (logout_dialog->priv->up_client);
1459 +
1460 + return ret;
1461 }
1462
1463 static gboolean
1464 diff -up mate-session-manager-1.6.1/mate-session/gsm-manager.c.login1 mate-session-manager-1.6.1/mate-session/gsm-manager.c
1465 --- mate-session-manager-1.6.1/mate-session/gsm-manager.c.login1 2013-07-25 10:35:06.000000000 -0500
1466 +++ mate-session-manager-1.6.1/mate-session/gsm-manager.c 2013-09-10 08:39:41.199847380 -0500
1467 @@ -1101,6 +1101,20 @@ manager_attempt_hibernate (GsmManager *m
1468 GError *error;
1469 gboolean ret;
1470
1471 +#ifdef HAVE_SYSTEMD
1472 + if (LOGIND_RUNNING()) {
1473 +
1474 + GsmSystemd *systemd;
1475 +
1476 + systemd = gsm_get_systemd ();
1477 +
1478 + /* lock the screen before we suspend */
1479 + manager_perhaps_lock (manager);
1480 +
1481 + gsm_systemd_attempt_hibernate (systemd);
1482 + }
1483 + else {
1484 +#endif
1485 can_hibernate = up_client_get_can_hibernate (manager->priv->up_client);
1486 if (can_hibernate) {
1487
1488 @@ -1115,6 +1129,9 @@ manager_attempt_hibernate (GsmManager *m
1489 g_error_free (error);
1490 }
1491 }
1492 +#ifdef HAVE_SYSTEMD
1493 + }
1494 +#endif
1495 }
1496
1497 static void
1498 @@ -1124,6 +1141,20 @@ manager_attempt_suspend (GsmManager *man
1499 GError *error;
1500 gboolean ret;
1501
1502 +#ifdef HAVE_SYSTEMD
1503 + if (LOGIND_RUNNING()) {
1504 +
1505 + GsmSystemd *systemd;
1506 +
1507 + systemd = gsm_get_systemd ();
1508 +
1509 + /* lock the screen before we suspend */
1510 + manager_perhaps_lock (manager);
1511 +
1512 + gsm_systemd_attempt_suspend (systemd);
1513 + }
1514 + else {
1515 +#endif
1516 can_suspend = up_client_get_can_suspend (manager->priv->up_client);
1517 if (can_suspend) {
1518
1519 @@ -1138,6 +1169,9 @@ manager_attempt_suspend (GsmManager *man
1520 g_error_free (error);
1521 }
1522 }
1523 +#ifdef HAVE_SYSTEMD
1524 + }
1525 +#endif
1526 }
1527
1528 static void
1529 diff -up mate-session-manager-1.6.1/mate-session/gsm-systemd.c.login1 mate-session-manager-1.6.1/mate-session/gsm-systemd.c
1530 --- mate-session-manager-1.6.1/mate-session/gsm-systemd.c.login1 2013-07-25 10:35:06.000000000 -0500
1531 +++ mate-session-manager-1.6.1/mate-session/gsm-systemd.c 2013-09-10 08:51:06.174857597 -0500
1532 @@ -725,6 +725,141 @@ gsm_systemd_can_stop (GsmSystemd *manage
1533 return can_stop;
1534 }
1535
1536 +gboolean
1537 +gsm_systemd_can_hibernate (GsmSystemd *manager)
1538 +{
1539 + gboolean res;
1540 + gchar *value;
1541 + gboolean can_hibernate;
1542 + GError *error;
1543 +
1544 + error = NULL;
1545 +
1546 + if (!gsm_systemd_ensure_sd_connection (manager, &error)) {
1547 + g_warning ("Could not connect to Systemd: %s",
1548 + error->message);
1549 + g_error_free (error);
1550 + return FALSE;
1551 + }
1552 +
1553 + res = dbus_g_proxy_call_with_timeout (manager->priv->sd_proxy,
1554 + "CanHibernate",
1555 + INT_MAX,
1556 + &error,
1557 + G_TYPE_INVALID,
1558 + G_TYPE_STRING, &value,
1559 + G_TYPE_INVALID);
1560 + if (res == FALSE) {
1561 + g_warning ("Could not make DBUS call: %s",
1562 + error->message);
1563 + g_error_free (error);
1564 + return FALSE;
1565 + }
1566 +
1567 + can_hibernate = g_strcmp0 (value, "yes") == 0 ||
1568 + g_strcmp0 (value, "challenge") == 0;
1569 + g_free (value);
1570 + return can_hibernate;
1571 +}
1572 +
1573 +gboolean
1574 +gsm_systemd_can_suspend (GsmSystemd *manager)
1575 +{
1576 + gboolean res;
1577 + gchar *value;
1578 + gboolean can_suspend;
1579 + GError *error;
1580 +
1581 + error = NULL;
1582 +
1583 + if (!gsm_systemd_ensure_sd_connection (manager, &error)) {
1584 + g_warning ("Could not connect to Systemd: %s",
1585 + error->message);
1586 + g_error_free (error);
1587 + return FALSE;
1588 + }
1589 +
1590 + res = dbus_g_proxy_call_with_timeout (manager->priv->sd_proxy,
1591 + "CanSuspend",
1592 + INT_MAX,
1593 + &error,
1594 + G_TYPE_INVALID,
1595 + G_TYPE_STRING, &value,
1596 + G_TYPE_INVALID);
1597 + if (res == FALSE) {
1598 + g_warning ("Could not make DBUS call: %s",
1599 + error->message);
1600 + g_error_free (error);
1601 + return FALSE;
1602 + }
1603 +
1604 + can_suspend = g_strcmp0 (value, "yes") == 0 ||
1605 + g_strcmp0 (value, "challenge") == 0;
1606 + g_free (value);
1607 + return can_suspend;
1608 +}
1609 +
1610 +void
1611 +gsm_systemd_attempt_hibernate (GsmSystemd *manager)
1612 +{
1613 + gboolean res;
1614 + GError *error;
1615 +
1616 + error = NULL;
1617 +
1618 + if (!gsm_systemd_ensure_sd_connection (manager, &error)) {
1619 + g_warning ("Could not connect to Systemd: %s",
1620 + error->message);
1621 + g_error_free (error);
1622 + return FALSE;
1623 + }
1624 +
1625 + res = dbus_g_proxy_call_with_timeout (manager->priv->sd_proxy,
1626 + "Hibernate",
1627 + INT_MAX,
1628 + &error,
1629 + G_TYPE_BOOLEAN, TRUE, /* interactive */
1630 + G_TYPE_INVALID,
1631 + G_TYPE_INVALID);
1632 + if (res == FALSE) {
1633 + g_warning ("Could not make DBUS call: %s",
1634 + error->message);
1635 + g_error_free (error);
1636 + return FALSE;
1637 + }
1638 +
1639 +}
1640 +
1641 +void
1642 +gsm_systemd_attempt_suspend (GsmSystemd *manager)
1643 +{
1644 + gboolean res;
1645 + GError *error;
1646 +
1647 + error = NULL;
1648 +
1649 + if (!gsm_systemd_ensure_sd_connection (manager, &error)) {
1650 + g_warning ("Could not connect to Systemd: %s",
1651 + error->message);
1652 + g_error_free (error);
1653 + return FALSE;
1654 + }
1655 +
1656 + res = dbus_g_proxy_call_with_timeout (manager->priv->sd_proxy,
1657 + "Suspend",
1658 + INT_MAX,
1659 + &error,
1660 + G_TYPE_BOOLEAN, TRUE, /* interactive */
1661 + G_TYPE_INVALID,
1662 + G_TYPE_INVALID);
1663 + if (res == FALSE) {
1664 + g_warning ("Could not make DBUS call: %s",
1665 + error->message);
1666 + g_error_free (error);
1667 + return FALSE;
1668 + }
1669 +}
1670 +
1671 gchar *
1672 gsm_systemd_get_current_session_type (GsmSystemd *manager)
1673 {
1674 diff -up mate-session-manager-1.6.1/mate-session/gsm-systemd.h.login1 mate-session-manager-1.6.1/mate-session/gsm-systemd.h
1675 --- mate-session-manager-1.6.1/mate-session/gsm-systemd.h.login1 2013-07-25 10:35:06.000000000 -0500
1676 +++ mate-session-manager-1.6.1/mate-session/gsm-systemd.h 2013-09-10 08:39:15.689107516 -0500
1677 @@ -89,10 +89,18 @@ gboolean gsm_systemd_can_stop
1678
1679 gboolean gsm_systemd_can_restart (GsmSystemd *manager);
1680
1681 +gboolean gsm_systemd_can_hibernate (GsmSystemd *manager);
1682 +
1683 +gboolean gsm_systemd_can_suspend (GsmSystemd *manager);
1684 +
1685 void gsm_systemd_attempt_stop (GsmSystemd *manager);
1686
1687 void gsm_systemd_attempt_restart (GsmSystemd *manager);
1688
1689 +void gsm_systemd_attempt_hibernate (GsmSystemd *manager);
1690 +
1691 +void gsm_systemd_attempt_suspend (GsmSystemd *manager);
1692 +
1693 void gsm_systemd_set_session_idle (GsmSystemd *manager,
1694 gboolean is_idle);