GNOME Bugzilla – Bug 545123
Please support the SmInteractStyleNone again
Last modified: 2008-09-04 11:07:50 UTC
Please describe the problem: The current gnome-session does not honor when gnome_client_request_save () is called with "GNOME_INTERACT_NONE". It still shows a logout dialog. Steps to reproduce: 1. Use latest ubuntu intrepid 2. run sudo /usr/share/update-notifier/notify-reboot-required ; sudo touch /var/lib/update-notifier/dpkg-run-stamp 3. click on the reboot icon and select "reboot now" Actual results: A logout dialog is shown Expected results: No logout dialog should be shown Does this happen every time? yes Other information: The following patch should fix the issue: --- gnome-session-2.23.5.orig/gnome-session/client-xsmp.c +++ gnome-session-2.23.5/gnome-session/client-xsmp.c @@ -320,7 +320,8 @@ { g_debug (" initiating shutdown"); gsm_session_initiate_shutdown (global_session, - !fast, + !(interact_style == SmInteractStyleNone || fast), + GSM_SESSION_LOGOUT_TYPE_LOGOUT); } else if (!shutdown && !global)
The full call to gnome_client_request_save () in the code that is now no longer working as before (for reference): gnome_client_request_save (client, GNOME_SAVE_GLOBAL, TRUE, GNOME_INTERACT_NONE, FALSE, TRUE);
Created attachment 116134 [details] [review] updated version of the patch for 2.23.6 Here is a updated version of my patch. I noticed however that with this version the logout with xsmp does not work anymore. I get (in .xsession-errors): ** (gnome-session:6827): DEBUG: GsmXSMPClient: Client '0x66e550 [update-notifier 1074e968e52f7f5e29121819705498035900000068270012]' received SaveYourselfRequest(SmSaveGlobal, Shutdown, SmInteractStyleNone, !Fast, Global) ** (gnome-session:6827): DEBUG: GsmXSMPClient: initiating shutdown That looks correct, the logout-request signal gets send, but it seems like it is not acted upon. Should I file a seperate bug about this?
So there is a comment in the code that says this: static void save_yourself_request_callback (SmsConn conn, SmPointer manager_data, int save_type, Bool shutdown, int interact_style, Bool fast, Bool global) /* Examining the g_debug above, you can see that there are a total * of 72 different combinations of options that this could have been * called with. However, most of them are stupid. * * If @shutdown and @global are both TRUE, that means the caller is * requesting that a logout message be sent to all clients, so we do * that. We use @fast to decide whether or not to show a * confirmation dialog. (This isn't really what @fast is for, but * the old gnome-session and ksmserver both interpret it that way, * so we do too.) We ignore @save_type because we pick the correct * save_type ourselves later based on user prefs, dialog choices, * etc, and we ignore @interact_style, because clients have not used * it correctly consistently enough to make it worth honoring. * * If @shutdown is TRUE and @global is FALSE, the caller is * confused, so we ignore the request. * * If @shutdown is FALSE and @save_type is SmSaveGlobal or * SmSaveBoth, then the client wants us to ask some or all open * applications to save open files to disk, but NOT quit. This is * silly and so we ignore the request. * * If @shutdown is FALSE and @save_type is SmSaveLocal, then the * client wants us to ask some or all open applications to update * their current saved state, but not log out. At the moment, the * code only supports this for the !global case (ie, a client * requesting that it be allowed to update *its own* saved state, * but not having everyone else update their saved state). */
(In reply to comment #0) > The current gnome-session does not honor when gnome_client_request_save () is > called with "GNOME_INTERACT_NONE". It still shows a logout dialog. That's actually correct. SmInteractStyleNone doesn't mean "don't show a confirmation dialog", it means "don't ask the user what to do if there are unsaved files". (Which effectively means "throw away unsaved files".) The (de facto) "right" way to bypass the logout dialog is to pass TRUE for "fast" (the 5th arg to gnome_client_request_save). That works on old gnome-session, new gnome-session, KDE, and XFCE.
Thanks for the explaination Dan, I updated my code to set "fast" to TRUE now. Is it correct that I should use "GNOME_INTERACT_ANY" if I want to warn the user about unsaved files prior to the logout? Thanks, Michael P.S. I set this to "NOTABUG" because it is really not a bug in gnome-session but a misinterpretation by me.
(In reply to comment #5) > Thanks for the explaination Dan, I updated my code to set "fast" to TRUE now. > Is it correct that I should use "GNOME_INTERACT_ANY" if I want to warn the user > about unsaved files prior to the logout? Yes.