diff options
author | Andreas Müller <schnitzeltony@googlemail.com> | 2012-09-17 08:15:46 +0000 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2012-09-17 10:42:34 +0200 |
commit | 72335a05f2b9a47aceec9e6f3881cd7209224343 (patch) | |
tree | 502b96f49e149aaf135dcfc24571deab0696591f /meta-xfce/recipes-xfce | |
parent | e527e152a2c051221ee137f0cc117f85941ead03 (diff) | |
download | meta-openembedded-72335a05f2b9a47aceec9e6f3881cd7209224343.tar.gz |
xfce4-session: Don't loose xfwm4 when closing session with multiple windows waiting for user input
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-xfce/recipes-xfce')
-rw-r--r-- | meta-xfce/recipes-xfce/xfce4-session/files/0001-Don-t-loose-xfwm4-when-closing-session-with-multiple.patch | 169 | ||||
-rw-r--r-- | meta-xfce/recipes-xfce/xfce4-session/xfce4-session_4.8.3.bb | 4 |
2 files changed, 172 insertions, 1 deletions
diff --git a/meta-xfce/recipes-xfce/xfce4-session/files/0001-Don-t-loose-xfwm4-when-closing-session-with-multiple.patch b/meta-xfce/recipes-xfce/xfce4-session/files/0001-Don-t-loose-xfwm4-when-closing-session-with-multiple.patch new file mode 100644 index 000000000..50bade87f --- /dev/null +++ b/meta-xfce/recipes-xfce/xfce4-session/files/0001-Don-t-loose-xfwm4-when-closing-session-with-multiple.patch | |||
@@ -0,0 +1,169 @@ | |||
1 | From 64c0acb072057023870881f9fbac29ce08d357db Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com> | ||
3 | Date: Wed, 5 Sep 2012 20:14:09 +0200 | ||
4 | Subject: [PATCH] Don't loose xfwm4 when closing session with multiple windows | ||
5 | waiting for user input | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | When closing a session with more than one window open and waiting for unsaved | ||
11 | data to be closed, at the next session xfwm4 was not started properly. | ||
12 | |||
13 | The bug(fix) could be reproduced by | ||
14 | |||
15 | * opening gedit | ||
16 | * entering some text | ||
17 | * opening terminal | ||
18 | * closing session (no YNC-dialog / wait ~1min to close session) | ||
19 | * reopen session | ||
20 | |||
21 | Bugreport with this patch is found at [1] further discussion at [2]. | ||
22 | |||
23 | Upstream-Status: Pending | ||
24 | |||
25 | [1] https://bugzilla.xfce.org/show_bug.cgi?id=5379 | ||
26 | [2] http://mail.xfce.org/pipermail/xfce/2012-August/031174.html | ||
27 | |||
28 | Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> | ||
29 | --- | ||
30 | xfce4-session/xfsm-manager.c | 81 ++++++++++++++++++++++++----------------- | ||
31 | 1 files changed, 47 insertions(+), 34 deletions(-) | ||
32 | |||
33 | diff --git a/xfce4-session/xfsm-manager.c b/xfce4-session/xfsm-manager.c | ||
34 | index 3078d6a..3cc4c89 100644 | ||
35 | --- a/xfce4-session/xfsm-manager.c | ||
36 | +++ b/xfce4-session/xfsm-manager.c | ||
37 | @@ -96,6 +96,7 @@ struct _XfsmManager | ||
38 | |||
39 | XfsmManagerState state; | ||
40 | XfsmShutdownType shutdown_type; | ||
41 | + gboolean save_session; | ||
42 | |||
43 | gboolean session_chooser; | ||
44 | gchar *session_name; | ||
45 | @@ -225,6 +226,7 @@ xfsm_manager_init (XfsmManager *manager) | ||
46 | manager->session_chooser = FALSE; | ||
47 | manager->failsafe_mode = TRUE; | ||
48 | manager->shutdown_type = XFSM_SHUTDOWN_LOGOUT; | ||
49 | + manager->save_session = TRUE; | ||
50 | |||
51 | manager->pending_properties = g_queue_new (); | ||
52 | manager->starting_properties = g_queue_new (); | ||
53 | @@ -981,7 +983,9 @@ xfsm_manager_interact (XfsmManager *manager, | ||
54 | XfsmClient *cl = lp->data; | ||
55 | if (xfsm_client_get_state (cl) == XFSM_CLIENT_INTERACTING) | ||
56 | { | ||
57 | - xfsm_client_set_state (cl, XFSM_CLIENT_WAITFORINTERACT); | ||
58 | + /* a client is already interacting, so new client has to wait */ | ||
59 | + xfsm_client_set_state (client, XFSM_CLIENT_WAITFORINTERACT); | ||
60 | + xfsm_manager_cancel_client_save_timeout(manager, client); | ||
61 | return; | ||
62 | } | ||
63 | } | ||
64 | @@ -1158,44 +1162,47 @@ xfsm_manager_save_yourself_global (XfsmManager *manager, | ||
65 | } | ||
66 | #endif | ||
67 | |||
68 | - if (!shutdown || shutdown_save) | ||
69 | + /* don't save the session if shutting down without save */ | ||
70 | + manager->save_session = !shutdown || shutdown_save; | ||
71 | + | ||
72 | + if (save_type == SmSaveBoth && !manager->save_session) | ||
73 | { | ||
74 | - xfsm_manager_set_state (manager, | ||
75 | - shutdown | ||
76 | - ? XFSM_MANAGER_SHUTDOWN | ||
77 | - : XFSM_MANAGER_CHECKPOINT); | ||
78 | + /* saving the session, so clients should | ||
79 | + * (prompt to) save the user data only */ | ||
80 | + save_type = SmSaveGlobal; | ||
81 | + } | ||
82 | |||
83 | - /* handle legacy applications first! */ | ||
84 | - xfsm_legacy_perform_session_save (); | ||
85 | + xfsm_manager_set_state (manager, | ||
86 | + shutdown | ||
87 | + ? XFSM_MANAGER_SHUTDOWN | ||
88 | + : XFSM_MANAGER_CHECKPOINT); | ||
89 | |||
90 | - for (lp = g_queue_peek_nth_link (manager->running_clients, 0); | ||
91 | - lp; | ||
92 | - lp = lp->next) | ||
93 | - { | ||
94 | - XfsmClient *client = lp->data; | ||
95 | - XfsmProperties *properties = xfsm_client_get_properties (client); | ||
96 | - const gchar *program; | ||
97 | + /* handle legacy applications first! */ | ||
98 | + if (manager->save_session) | ||
99 | + xfsm_legacy_perform_session_save (); | ||
100 | |||
101 | - /* xterm's session management is broken, so we won't | ||
102 | - * send a SAVE YOURSELF to xterms */ | ||
103 | - program = xfsm_properties_get_string (properties, SmProgram); | ||
104 | - if (program != NULL && strcasecmp (program, "xterm") == 0) | ||
105 | - continue; | ||
106 | + for (lp = g_queue_peek_nth_link (manager->running_clients, 0); | ||
107 | + lp; | ||
108 | + lp = lp->next) | ||
109 | + { | ||
110 | + XfsmClient *client = lp->data; | ||
111 | + XfsmProperties *properties = xfsm_client_get_properties (client); | ||
112 | + const gchar *program; | ||
113 | |||
114 | - if (xfsm_client_get_state (client) != XFSM_CLIENT_SAVINGLOCAL) | ||
115 | - { | ||
116 | - SmsSaveYourself (xfsm_client_get_sms_connection (client), save_type, shutdown, | ||
117 | - interact_style, fast); | ||
118 | - } | ||
119 | + /* xterm's session management is broken, so we won't | ||
120 | + * send a SAVE YOURSELF to xterms */ | ||
121 | + program = xfsm_properties_get_string (properties, SmProgram); | ||
122 | + if (program != NULL && strcasecmp (program, "xterm") == 0) | ||
123 | + continue; | ||
124 | |||
125 | - xfsm_client_set_state (client, XFSM_CLIENT_SAVING); | ||
126 | - xfsm_manager_start_client_save_timeout (manager, client); | ||
127 | + if (xfsm_client_get_state (client) != XFSM_CLIENT_SAVINGLOCAL) | ||
128 | + { | ||
129 | + SmsSaveYourself (xfsm_client_get_sms_connection (client), save_type, shutdown, | ||
130 | + interact_style, fast); | ||
131 | } | ||
132 | - } | ||
133 | - else | ||
134 | - { | ||
135 | - /* shutdown session without saving */ | ||
136 | - xfsm_manager_perform_shutdown (manager); | ||
137 | + | ||
138 | + xfsm_client_set_state (client, XFSM_CLIENT_SAVING); | ||
139 | + xfsm_manager_start_client_save_timeout (manager, client); | ||
140 | } | ||
141 | } | ||
142 | |||
143 | @@ -1267,7 +1274,12 @@ xfsm_manager_save_yourself_done (XfsmManager *manager, | ||
144 | XfsmClient *client, | ||
145 | gboolean success) | ||
146 | { | ||
147 | - if (xfsm_client_get_state (client) != XFSM_CLIENT_SAVING && xfsm_client_get_state (client) != XFSM_CLIENT_SAVINGLOCAL) | ||
148 | + /* In xfsm_manager_interact_done we send SmsShutdownCancelled to clients in | ||
149 | + XFSM_CLIENT_WAITFORINTERACT state. They respond with SmcSaveYourselfDone | ||
150 | + (xsmp_shutdown_cancelled in libxfce4ui library) so we allow it here. */ | ||
151 | + if (xfsm_client_get_state (client) != XFSM_CLIENT_SAVING && | ||
152 | + xfsm_client_get_state (client) != XFSM_CLIENT_SAVINGLOCAL && | ||
153 | + xfsm_client_get_state (client) != XFSM_CLIENT_WAITFORINTERACT) | ||
154 | { | ||
155 | xfsm_verbose ("Client Id = %s send SAVE YOURSELF DONE, while not being " | ||
156 | "in save mode. Prepare to be nuked!\n", | ||
157 | @@ -1539,7 +1551,8 @@ xfsm_manager_complete_saveyourself (XfsmManager *manager) | ||
158 | xfsm_verbose ("Manager finished SAVE YOURSELF, session data will be stored now.\n\n"); | ||
159 | |||
160 | /* all clients done, store session data */ | ||
161 | - xfsm_manager_store_session (manager); | ||
162 | + if (manager->save_session) | ||
163 | + xfsm_manager_store_session (manager); | ||
164 | |||
165 | if (manager->state == XFSM_MANAGER_CHECKPOINT) | ||
166 | { | ||
167 | -- | ||
168 | 1.7.6.5 | ||
169 | |||
diff --git a/meta-xfce/recipes-xfce/xfce4-session/xfce4-session_4.8.3.bb b/meta-xfce/recipes-xfce/xfce4-session/xfce4-session_4.8.3.bb index 3c84a720e..4b9b32eb7 100644 --- a/meta-xfce/recipes-xfce/xfce4-session/xfce4-session_4.8.3.bb +++ b/meta-xfce/recipes-xfce/xfce4-session/xfce4-session_4.8.3.bb | |||
@@ -4,10 +4,12 @@ LICENSE = "GPLv2" | |||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=9ac2e7cff1ddaf48b6eab6028f23ef88" | 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=9ac2e7cff1ddaf48b6eab6028f23ef88" |
5 | DEPENDS = "virtual/libx11 libsm libxfce4util libxfce4ui gtk+ libwnck dbus dbus-glib xfconf xfce4-panel gconf gnome-keyring" | 5 | DEPENDS = "virtual/libx11 libsm libxfce4util libxfce4ui gtk+ libwnck dbus dbus-glib xfconf xfce4-panel gconf gnome-keyring" |
6 | RDEPENDS_${PN} = "netbase xinit dbus-x11 iceauth consolekit" | 6 | RDEPENDS_${PN} = "netbase xinit dbus-x11 iceauth consolekit" |
7 | PR = "r1" | 7 | PR = "r2" |
8 | 8 | ||
9 | inherit xfce | 9 | inherit xfce |
10 | 10 | ||
11 | SRC_URI += "file://0001-Don-t-loose-xfwm4-when-closing-session-with-multiple.patch" | ||
12 | |||
11 | # protect from frightening message that xfce might not work correctly | 13 | # protect from frightening message that xfce might not work correctly |
12 | pkg_postinst_${PN} () { | 14 | pkg_postinst_${PN} () { |
13 | echo 127.0.0.1 ${MACHINE} >> /etc/hosts | 15 | echo 127.0.0.1 ${MACHINE} >> /etc/hosts |