Merge lp:~bfiller/unity-2d/wait-for-session-again into lp:unity-2d/3.0

Proposed by Florian Boucault
Status: Merged
Merge reported by: Aurélien Gâteau
Merged at revision: not available
Proposed branch: lp:~bfiller/unity-2d/wait-for-session-again
Merge into: lp:unity-2d/3.0
Diff against target: 30 lines (+2/-4)
1 file modified
libunity-2d-private/src/gnomesessionclient.cpp (+2/-4)
To merge this branch: bzr merge lp:~bfiller/unity-2d/wait-for-session-again
Reviewer Review Type Date Requested Status
Aurélien Gâteau (community) Needs Fixing
Review via email: mp+54436@code.launchpad.net

Description of the change

This is to fix LP: #716167 and LP: #706248. We thought it was previously fixed but I just ran into a case where it didn't work using the latest code. Debugging showed me the app was being destroyed before queryEndSession() even got called the first time and it didn't wait because m_waitingForEndSession = false by default.

So the fix is to change the default to true. This should handle all the known cases now. I also lowered the timeout to 3 secs would should be sufficient.

To post a comment you must log in.
Aurélien Gâteau (agateau) wrote :

That's weird, but sometimes gnome-session is full of mystery.

I would suggest however to keep m_waitingForEndSession to false by default and set it to true only if we successfully register with gnome-session (ie in slotRegisterClientFinished()).

review: Needs Fixing
Bill Filler (bfiller) wrote :

Yes that is better. I'll give it a try.

On Mar 23, 2011, at 7:41 AM, Aurélien Gâteau <email address hidden> wrote:

> Review: Needs Fixing
> That's weird, but sometimes gnome-session is full of mystery.
>
> I would suggest however to keep m_waitingForEndSession to false by default and set it to true only if we successfully register with gnome-session (ie in slotRegisterClientFinished()).
> --
> https://code.launchpad.net/~bfiller/unity-2d/wait-for-session-again/+merge/54436
> You are the owner of lp:~bfiller/unity-2d/wait-for-session-again.

Aurélien Gâteau (agateau) wrote :

Time was running out, so Florian asked me to merged your changes. It's in trunk now, with the small change I suggested.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/src/gnomesessionclient.cpp'
2--- libunity-2d-private/src/gnomesessionclient.cpp 2011-03-22 15:18:46 +0000
3+++ libunity-2d-private/src/gnomesessionclient.cpp 2011-03-22 23:02:29 +0000
4@@ -39,7 +39,7 @@
5 static const char* SM_CLIENT_DBUS_INTERFACE = "org.gnome.SessionManager.ClientPrivate";
6
7 // Number of seconds to wait for gnome-session to call us back
8-static const int MAX_END_SESSION_WAIT = 5;
9+static const int MAX_END_SESSION_WAIT = 3;
10
11 struct GnomeSessionClientPrivate
12 {
13@@ -72,7 +72,7 @@
14 : QObject(parent)
15 , d(new GnomeSessionClientPrivate(applicationId))
16 {
17- d->m_waitingForEndSession = false;
18+ d->m_waitingForEndSession = true;
19 connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()),
20 SLOT(waitForEndSession()));
21 }
22@@ -128,8 +128,6 @@
23 void GnomeSessionClient::queryEndSession()
24 {
25 UQ_DEBUG;
26- d->m_waitingForEndSession = true;
27-
28 if (!d->sendEndSessionResponse()) {
29 d->m_waitingForEndSession = false;
30 }

Subscribers

People subscribed via source and target branches