! 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 !
add a way to delete sessions
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-session
Component:
General

Comments

Description Pavol Klačanský 2009-09-03 19:36:34 CEST
I've selected option to save session after logout, then I disable that option but XFCE still starts application after login

I solved it by deleting entries in "$HOME/.cache/sessions"

but I think that could be run automatically
Comment 1 Brian J. Tarricone (not reading bugmail) 2009-09-03 20:31:10 CEST
No, unchecking that box doesn't delete sessions, it just doesn't save any new ones.  It behaves as expected.
Comment 2 Pavol Klačanský 2009-09-04 05:11:27 CEST
Ok, but then add button which deletes old one, or the other concept
Comment 3 Nick Schermer editbugs 2010-11-15 23:42:14 CET
Reassign to xfce-bugs@xfce.org.
Comment 4 Butesa 2011-03-02 11:49:32 CET
I think an option 'don't load saved session on startup' in the startup settings would be nice.
Comment 5 Lionel Le Folgoc 2011-03-28 20:08:04 CEST
Created attachment 3587 
Proposed patch

The following patch adds a "clear saved sessions" on the "Session" tab in xfce4-session-settings, which deletes "$XDG_CACHE_HOME/sessions/xfce4-session-*". I don't know if it's worth/safe to delete more (e.g. the xfwm4 or thunar states stored in there). Also, feel free to move the button at a more suitable place. :p

I tested it on Xfce 4.8 (I don't currently have master running), and it worked fine here.
Comment 6 Lionel Le Folgoc 2011-03-29 09:36:26 CEST
Mmmh (just my 2 cents), it might look better if the button is placed near the "save session" button. It seems that removing "<property name="pack_type">end</property>" from my patch does that.
Comment 7 Jérôme Guelfucci editbugs 2011-03-30 18:40:43 CEST
The current patch looks ok.

I have two suggestions though:

1) I think the button should only be sensitive when there is something to delete. A check when creating the dialog is enough, no need to monitor. When finishing the cache cleaning, we would just set the state to insensitive. It's not a big deal but it makes sense IMO.

2) The description in the confirmation dialog could be improved by saying what could potentially be lost. I don't know everything we can store in session files, but at least saved applications.

Re deleting Thunar and Xfwm4 session files, it makes sense IMO.
Comment 8 Jérôme Guelfucci editbugs 2011-03-30 18:43:45 CEST
Sorry, form accidentally validated...

So, I'm adding Nick and Jannis as CC to get feedback on thunar and xfwm4 files.

And one last point, it would be great if you added the bug number at the end of the patch summary like '(bug #xxxx).', that way I don't even have to do that (or to forget to do it) ;)

And finally, THANKS!
Comment 9 Nick Schermer editbugs 2011-03-30 18:47:04 CEST
When you start a new session the thunar xfwm4 and other session files are invalid because the app is assigned a new client-id, so you can safely delete those too.
Comment 10 Nick Schermer editbugs 2011-03-30 18:54:31 CEST
Officially xfce4-session does not depend on gio and because session files are always local, I'd say a g_dir_open; walk; g_unlink; will do.
Comment 11 Lionel Le Folgoc 2011-03-31 12:46:59 CEST
Created attachment 3590 
Proposed patch (2)

Thanks for the feedback!

(In reply to comment #7)
> The current patch looks ok.
> 
> I have two suggestions though:
> 
> 1) I think the button should only be sensitive when there is something to
> delete. A check when creating the dialog is enough, no need to monitor. When
> finishing the cache cleaning, we would just set the state to insensitive. It's
> not a big deal but it makes sense IMO.
> 
> 2) The description in the confirmation dialog could be improved by saying what
> could potentially be lost. I don't know everything we can store in session
> files, but at least saved applications.
> 
> Re deleting Thunar and Xfwm4 session files, it makes sense IMO.

1) I think it's more annoying than expected, because the "save session" button can write items in there, and restarting Thunar/xfwm4 also (and in this case, if the button stays greyed out it's misleading).

2) I tried to improve that a bit, feel free to change it.

(In reply to comment #9)
> When you start a new session the thunar xfwm4 and other session files are
> invalid because the app is assigned a new client-id, so you can safely delete
> those too.

I included a check to delete them as well. However, when thunar/xfwm4 starts, a state file is written for them with their *current* client-id... Is it really safe to remove that?

(In reply to comment #10)
> Officially xfce4-session does not depend on gio and because session files are
> always local, I'd say a g_dir_open; walk; g_unlink; will do.

Done. It doesn't delete everything though (I'm thinking about people using several desktop environments who won't be happy if everything is deleted, so I only delete "xfce4-session-*", "Thunar-*", "xfwm4-*"...).
Comment 12 Jérôme Guelfucci editbugs 2011-03-31 23:32:11 CEST
(In reply to comment #11)
> Created attachment 3590 
> Proposed patch (2)
> 
> Thanks for the feedback!

Thanks for the quick follow up!

> 
> (In reply to comment #7)
> > The current patch looks ok.
> > 
> > I have two suggestions though:
> > 
> > 1) I think the button should only be sensitive when there is something to
> > delete. A check when creating the dialog is enough, no need to monitor. When
> > finishing the cache cleaning, we would just set the state to insensitive. It's
> > not a big deal but it makes sense IMO.
> > 
> > 2) The description in the confirmation dialog could be improved by saying what
> > could potentially be lost. I don't know everything we can store in session
> > files, but at least saved applications.
> > 
> > Re deleting Thunar and Xfwm4 session files, it makes sense IMO.
> 
> 1) I think it's more annoying than expected, because the "save session" button
> can write items in there, and restarting Thunar/xfwm4 also (and in this case,
> if the button stays greyed out it's misleading).

Good point which I hadn't considered, let's forget this then!

> 
> 2) I tried to improve that a bit, feel free to change it.

Looks fine to me.
> 
> (In reply to comment #9)
> > When you start a new session the thunar xfwm4 and other session files are
> > invalid because the app is assigned a new client-id, so you can safely delete
> > those too.
> 
> I included a check to delete them as well. However, when thunar/xfwm4 starts, a
> state file is written for them with their *current* client-id... Is it really
> safe to remove that?
> 
> (In reply to comment #10)
> > Officially xfce4-session does not depend on gio and because session files are
> > always local, I'd say a g_dir_open; walk; g_unlink; will do.
> 
> Done. It doesn't delete everything though (I'm thinking about people using
> several desktop environments who won't be happy if everything is deleted, so I
> only delete "xfce4-session-*", "Thunar-*", "xfwm4-*"...).

I just have one itch with the new patch, the g_critical and g_warning: I know this shouldn't happen in most cases but I don't like throwing errors to the console and filling logs which are never read. Shouldn't we warn the user with a dialog that clearing the session failed (like in the first version of your patch)?
Comment 13 Lionel Le Folgoc 2011-04-01 10:43:08 CEST
(In reply to comment #12)
> 
> I just have one itch with the new patch, the g_critical and g_warning: I know
> this shouldn't happen in most cases but I don't like throwing errors to the
> console and filling logs which are never read. Shouldn't we warn the user with
> a dialog that clearing the session failed (like in the first version of your
> patch)?

Indeed, I'm not especially happy with that. My first patch would have displayed a warning dialog for each failure, which is too much. Then, I wanted to display one single warning if something went wrong, e.g. "Unable to clear some cache item, you might have to do it manually.", but I'm thinking it's pretty useless and meaningless for an average user. That's why I chose to "hide" that in .xsession-errors.
Ideas are welcome... ;-)
Comment 14 Jérôme Guelfucci editbugs 2011-04-05 07:47:49 CEST
I just pushed this to git master with two small follow up patches. Thanks a lot for your contribution, that's one release goal fixed!
Comment 15 Jérôme Guelfucci editbugs 2011-04-05 07:52:24 CEST
I just realize re-reading your last message that I picked the "useless" solution for user feedback ^^ I don't know what we can improve there, but I think some feedback is better here. It shouldn't happen that often thought, so it's ok IMO if the warning is not crystal clear. We will see if we can improve this.

Bug #5730

Reported by:
Pavol Klačanský
Reported on: 2009-09-03
Last modified on: 2011-04-05

People

Assignee:
Xfce Bug Triage
CC List:
6 users

Version

Attachments

Proposed patch (7.03 KB, patch)
2011-03-28 20:08 CEST , Lionel Le Folgoc
no flags
Proposed patch (2) (6.57 KB, patch)
2011-03-31 12:46 CEST , Lionel Le Folgoc
no flags

Additional information