[Gambas-user] Inhibit shutdown/logout/etc if unsaved files.
Benoit Minisini
benoit.minisini at gambas-basic.org
Thu Feb 23 10:02:22 CET 2023
Le 21/02/2023 à 20:48, Bruce Steers a écrit :
> Well i got part way then hit a roadblock.
> See this discussion for more details and a demo-app / screenshot of it
> working with gambas IDE.
> https://forum.gambas.one/viewtopic.php?t=1483
> <https://forum.gambas.one/viewtopic.php?t=1483>
>
> The class is currently very simple but limited to only working on gnome2
> based os's (mate, cinnamon, gnomoe-fallback)
> does not work for gnome3 (gnome shell), kde plasma, others
>
> But i use MATE and now my system CANNOT close down with an open unsaved
> gambas project running so i'm pretty happy about that. :)
>
> (it's a tiny 17k so i'll attach my demo to this post, i've added the
> same class to my gambas and edited the editors Modify and Save methods
> to enable/kill the inhibitors
> https://gitlab.com/bsteers4/gambas/-/tree/bruces-patched/app/src/gambas3/.src <https://gitlab.com/bsteers4/gambas/-/tree/bruces-patched/app/src/gambas3/.src>)
>
> the roadblock is that org.gnome.SessionManager.Inhibit was the only one
> i could get to work properly. and that seems to only work on gnome2 systems.
>
> I have looked into many other ways.
> org.freedesktop.portal.Desktop (doesn't seem to work)
> System://org.freedesktop.login1 (just gives me segfault 11)
> a few others.
>
> I've tried various methods. the gnome.SessionManager is absolute
> simplicity compared to others.
>
> Anyone had any success with Inhibit on anything other than
> gnome.SessionManager ?
>
> Respects
> BruceS
>
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
Apparently The "inhibition" is done through the DBus
'org.freedesktop.portal.Inhibit' interface.
I found that documentation:
https://flatpak.github.io/xdg-desktop-portal/
I found that interface under the 'org.freedesktop.portal.Desktop' DBus
name, but I can't browse it with the IDE DBus explorer, so I guess there
is something special with it.
Regards,
--
Benoît Minisini.
More information about the User
mailing list