After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 545123 - Please support the SmInteractStyleNone again
Please support the SmInteractStyleNone again
Status: RESOLVED NOTABUG
Product: gnome-session
Classification: Core
Component: general
2.23.x
Other All
: Normal minor
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-28 10:27 UTC by Michael Vogt
Modified: 2008-09-04 11:07 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
updated version of the patch for 2.23.6 (815 bytes, patch)
2008-08-08 12:23 UTC, Michael Vogt
none Details | Review

Description Michael Vogt 2008-07-28 10:27:48 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)
Comment 1 Michael Vogt 2008-07-28 10:38:33 UTC
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);
Comment 2 Michael Vogt 2008-08-08 12:23:31 UTC
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?
Comment 3 William Jon McCann 2008-09-03 14:50:20 UTC
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).
   */

Comment 4 Dan Winship 2008-09-03 15:48:49 UTC
(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.
Comment 5 Michael Vogt 2008-09-04 09:38:15 UTC
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.
Comment 6 Dan Winship 2008-09-04 11:07:50 UTC
(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.