GTK power change event

Hi,
Could someone please point me to the documentation and/or the code sample on how to handle suspend/resume and dock/undock events in GTK application?

Google gave me this, but I guess it is very recent and will be available in GTK+4.x.

Is there something I can use right now with GTK+3?

Thank you.

GTK (or GLib) have no API for power change events. You will need platform specific API for that.

Emmanuelle,
So what would be the proper way for *nix?
Also, can you confirm that the article I referenced is correct and it will be something available in the future?

Thank you.

There is not such thing as “Unix”. If you’re asking about how to handle power events on Linux, you can look at upower.

I have no idea what the article you linked is talking about, outside of describing a project that moved from a GNOME Shell extension to a GTK application. You can look at its source code, in any case, to see what it does.

GTK has no plan to add any power management feature; it has nothing to do with a GUI toolkit.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.