Implement support for power events and preventing sleep/suspend in wxGTK - #25147
Conversation
No real changes, just show how this argument can be used.
Allow passing it to GTK or glib functions to be filled in by them. The name of the function is consistent with wxGtkError, although not with wxGtkVariant which uses ByRef().
f28a5f5 to
eb7f476
Compare
Implement wxPowerResource::Acquire(wxPOWER_RESOURCE_SYSTEM) for wxGTK under Linux when using systemd. Closes wxWidgets#22396.
Generate these events on the systems running systemd, which provides org.freedesktop.login1 D-Bus interface, but require acquiring system power resource with the special new wxPOWER_DELAY "block mode" in order to do it. This means that existing applications need to be updated in order to start getting these events, but it has the advantage of avoiding to have to open the D-Bus connection on startup of every program, even if it's never going to use it, and also forces the program to provide the explanatory message, which is nice to have as it is shown by tools such as systemd-inhibit to show what could be preventing system sleep. Closes wxWidgets#23717.
eb7f476 to
e549a2b
Compare
|
I'm getting link errors: I think caused by this line. The events are implemented in Line 43 in aa1f7db |
|
Oops, it indeed looks like this can't work (so I wonder how does it manage to work nevertheless for me and in the CI builds too, and what's the difference with your build). Worse, I'm not sure how to fix it. I think we're going to need to move all |
|
Not sure what is different, my build should be the same as |
|
It would make perfect sense for a Windows service (using base only) to prevent sleep. However, I'm unsure whether |
|
It's going to be a lot of work to make this available in MSW console applications and I don't think it's worth it, so for now I've only created #25174. If we really, really need them in base, they could be virtualized later but, again, I just don't think it's worth investing time into this. |
This mainly addresses #23717 but also happens to implement #22396 as a side effect.