A clean way to logout when GWorkspace is a subprocess of wmaker X session

Patrick CARDONA <[email protected]> Fri, 13 Mar 2026 17:15:25 +0100
Newsgroups gmane.comp.lib.gnustep.general
Message-ID <e1e8e79be2993020b5c82ca2c695a333@pi500>
Hello,

Finally I reverted to a more classic '.xsession', using 'exec' command 
with 'wmaker' and lauching GWorkspace then as a subprocess (autolaunch 
docked app).
With this hierarchy, the menu command of GWorkspace to disconnect only 
closes its app, not the underlying Window Manager.
So I need now a clean way to logout in one shot: i.e., closing apps 
and Window Manager with one action.

I created an in-purpose little app with one button using this method 
as action:

> - (void)endSession
> {
>     NSTask *task = [[NSTask alloc] init];
>     NSString *userName = NSUserName();
>     [task setLaunchPath:@"/usr/bin/loginctl"];
>     [task setArguments:[NSArray arrayWithObjects:@"terminate-user", 
> userName, nil]];
>     [task launch];
> }
> 

Well, it is working as expected. The X session closes and I get the 
login panel of LigthDM.

However I would be sure this way all remaining opened apps before 
session ends, namely GWorkspace, have time to save state and database, 
and to release memory. Do you think my method is a correct answer?

P.S.: I also looked a way to send a 'terminate:' message to the 
NSWorkspace instance of GWorkspace, before my task above will launch, 
but not found yet how it could be done. And if it is accurate to do 
this.

-- 
Patrick Cardona - Pi500 - GNU/Linux aarch64 (Debian 13.3)
Xorg (1:7.7+24) - libcairo2 (1.18.4-1+rpt1 arm64) - Window Maker 
(0.96.0-4)
GWorkspace (1.1.0 - 02 2025) - Theme: AGNOSTEP - Classic - MUA: 
GNUMail (1.4.0 - rev.947)