[Gambas-user] Inhibit shutdown/logout/etc if unsaved files.
bsteers4 at gmail.com
Wed Feb 22 19:11:19 CET 2023
Benoit, gedit does inhibit on a gtk level using gtk_application_inhibit()
could gb.gui implement inhibit? (if a qt alternative)
gedit inhibit code..
if (can_close && (priv->inhibition_cookie != 0))
gtk_application_uninhibit (GTK_APPLICATION (g_application_get_default ()),
priv->inhibition_cookie = 0;
else if (!can_close && (priv->inhibition_cookie == 0))
priv->inhibition_cookie = gtk_application_inhibit (GTK_APPLICATION
On Tue, 21 Feb 2023 at 20:08, Bruce Steers <bsteers4 at gmail.com> wrote:
> if you have made inhibit work on anything other than gnome2
> Or if you want a challenge and try to make it work on your system and have
> Then share the code on this post or the gambas.one forum topic i started,
> Wishing well
> On Tue, 21 Feb 2023 at 19:48, Bruce Steers <bsteers4 at gmail.com> wrote:
>> 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.
>> 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
>> 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 ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the User