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.
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
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
=== modified file 'libunity-2d-private/src/gnomesessionclient.cpp'
--- libunity-2d-private/src/gnomesessionclient.cpp 2011-03-22 15:18:46 +0000
+++ libunity-2d-private/src/gnomesessionclient.cpp 2011-03-22 23:02:29 +0000
@@ -39,7 +39,7 @@
39static const char* SM_CLIENT_DBUS_INTERFACE = "org.gnome.SessionManager.ClientPrivate";39static const char* SM_CLIENT_DBUS_INTERFACE = "org.gnome.SessionManager.ClientPrivate";
4040
41// Number of seconds to wait for gnome-session to call us back41// Number of seconds to wait for gnome-session to call us back
42static const int MAX_END_SESSION_WAIT = 5;42static const int MAX_END_SESSION_WAIT = 3;
4343
44struct GnomeSessionClientPrivate44struct GnomeSessionClientPrivate
45{45{
@@ -72,7 +72,7 @@
72: QObject(parent)72: QObject(parent)
73, d(new GnomeSessionClientPrivate(applicationId))73, d(new GnomeSessionClientPrivate(applicationId))
74{74{
75 d->m_waitingForEndSession = false;75 d->m_waitingForEndSession = true;
76 connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()),76 connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()),
77 SLOT(waitForEndSession()));77 SLOT(waitForEndSession()));
78}78}
@@ -128,8 +128,6 @@
128void GnomeSessionClient::queryEndSession()128void GnomeSessionClient::queryEndSession()
129{129{
130 UQ_DEBUG;130 UQ_DEBUG;
131 d->m_waitingForEndSession = true;
132
133 if (!d->sendEndSessionResponse()) {131 if (!d->sendEndSessionResponse()) {
134 d->m_waitingForEndSession = false;132 d->m_waitingForEndSession = false;
135 }133 }

Subscribers

People subscribed via source and target branches