[Gambas-user] Inhibit shutdown/logout/etc if unsaved files.
bsteers4 at gmail.com
Thu Feb 23 17:29:17 CET 2023
On Thu, 23 Feb 2023 at 09:39, Benoit Minisini <
benoit.minisini at gambas-basic.org> wrote:
> Le 23/02/2023 à 10:37, Benoit Minisini a écrit :
> > I guess the DBus desktop portal was made for replacing the xdg scripts.
> > Maybe one should make a 'gb.desktop.portal' component that implements
> > most of the portal methods for 'gb.desktop'? 'gb.desktop' should be able
> > to use the old implementation if 'gb.desktop.portal' is not used.
> > Regards,
> I'm not sure that all methods exposed by the portal interface are
> actually implemented in the desktop current in use. Something to check.
> Benoît Minisini.
If you make a bare bones starter class i'll test it and could probably add
stuff to it once i know how it should be done.
I think the gnome.SessionManager inhibit function is super simplified. just
use Inhibit, note the cookie number then either use Uninhibit with the
cookie or kill the task, simple.
for desktop.Portal and many others i think a message/reply deal has to be
set up that involves recieving shutdown messages from the bus and replying
right away with is_okay boolean
unlike gnome.SessionManager that pops open a dialog on shutdown listing
active Inhibits The Inhibit method kate uses (qt lib) involves using it's
own requester that pops up and inhibits the shutdown till it's conditions
And like i said, kate Inhibit has worked on everything i tried. tested by
opening kate typing some chars then attempting a logout.
desktop.Portal does seem to have rather a lot of functions in it's various
(i could be wrong but i believe portal is designed as a generic interface
to point to the systems configured method of the desired function)
I do not think any DBus methods are guaranteed to work on everything.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the User