! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfce4-session doesn't wait for SmcInteractDone()
Status:
RESOLVED: FIXED
Product:
Xfce4-session
Component:
General

Comments

Description Dimitar Zhekov 2008-08-15 12:31:26 CEST
+++ This bug was initially created as a clone of Bug #3441 +++

While writing session support for an application, I noticed that after a successful SmcInteractRequest(), xfce session does not wait for a SmcInteractDone(), but instead terminates the program. If InteractRequest is invoked during the 2nd phase (from a SmcRequestSaveYourselfPhase2 handler), xfce session waits for InteractDone, but if the first shutdown is canceled, the second will destroy the application windows decorations, wait several seconds and then terminate. If this sounds unclear (my english is far from perfect), hopefully this will be easier:

save_yourself_cb() -> SmcInteractRequest(handler)
will not wait for <handler> to signal a SmcInteractDone()

save_yourself_cb() -> SmcRequestSaveYourselfPhase2(save_phase_2_cb)
save_phase_2_cb() -> SmcInteractRequest(handler)
will wait for handler on the 1st shutdown, but if it's canceled \
will destroy window decorations and wait only several seconds on subsequent shutdown

When the applications have no unsaved documents (and so don't call SmcInteractRequest) everything works fine.

Reproducible: Always

Steps to Reproduce:
1.Open any application like gedit, kwrite
2.Write something without saving
3.Logout from xfce

Actual Results:  
Any unsaved files are lost.

Expected Results:  
Wait for user to asnwer the Save: YNC questions.
Comment 1 Dimitar Zhekov 2008-08-16 18:02:11 CEST
Created attachment 1778 
simple mousepad session interactivity demo

This is a simple patch using the libxfcegui4 functions to add a Save: Yes|No|Cancel question to mousepad if the current file is not saved (doesn't save it, just a demo). The static client variable is only required to send a SmcInteractDone(sms_conn, True) on Cancel, since xfcegui4'libs session client doesn't support canceling a shutdown.
Comment 2 Brian J. Tarricone (not reading bugmail) 2008-11-06 09:40:47 CET
Ok, it looks like both of your problems were caused by the same thing, because xfce4-session uses the same (buggy) code when deciding whether or not each phase is finished... in that it doesn't check whether or not a client is interacting or waiting to interact.

Anyhow, should be fixed in svn now.

Bug #4284

Reported by:
Dimitar Zhekov
Reported on: 2008-08-15
Last modified on: 2009-07-14

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
0 users

Version

Attachments

Additional information