View Single Post
Jaffa's Avatar
Posts: 2,535 | Thanked: 6,681 times | Joined on Mar 2008 @ UK
#10
Sorry for not replying sooner.

Short version (from a Gtk+ point of view): when you register with osso_context you can register for a DBus signal, sent when the display blanks/gets locked. Listen for that and stop all timers, saving off the current time and timer position. Stop updating the screen.

Similarly, there's a window property (or go off focus) which you can do similar with.

I don't know, OTTOMH, how to do these things in Qt; but those are the two main events you want to be listening for: not being on-top (and therefore visible) and the screen being locked/blanked (and therefore not being visible).
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
 

The Following 2 Users Say Thank You to Jaffa For This Useful Post: