List Info

Thread: Re: A couple of SystemWatch related things




Re: A couple of SystemWatch related things
user name
2007-06-25 04:22:54
> Nice work getting this working again, guys. I wonder
why it ever worked
> without the winEventFilter stuff. Maybe it's a QT3 vs.
QT4 thing.

If it ever worked, it has to be a Qt4.x->Qt4.y thing.

> It was mentioned when this stuff was done originally
that we might want to
> prevent going to sleep when a file transfer was in
progress. I recently
> discovered the SetThreadExecutionState API, which is
the recommended way of
> preventing the system idling to sleep (I think the
*only* way on Vista). The
> idea is that a program calls this API periodically
during a
> non-interruptible operation to reset the system idle
timer.

We probably want an 'allowSleep()' in systemwatch which does
the right
thing for every platform. On OS X, you prevent sleeping by
reacting on
the 'sleep' request. On windows, it would trigger a
periodical call of
this api.

As for the UI thing, we indeed want something like that in
the future.

cheers,
Remko
_______________________________________________
psi-devel mailing list
psi-devellists.affinix.com
http://lists.affinix.com/listinfo.cgi/psi-devel-affin
ix.com

Re: A couple of SystemWatch related things
user name
2007-06-25 13:31:05
On 25/06/07, Remko Tronçon < remkoel-tramo.be">remkoel-tramo.be> wrote:
> It was mentioned when this stuff was done originally that we might want to
> prevent going to sleep when a file transfer was in progress. I recently
&gt; discovered the SetThreadExecutionState API, which is the recommended way of
> preventing the system idling to sleep (I think the *only* way on Vista). The
> idea is that a program calls this API periodically during a
> non-interruptible operation to reset the system idle timer.

We probably want an 'allowSleep()'; in systemwatch which does the right
thing for every platform. On OS X, you prevent sleeping by reacting on
the 'sleep' request. On windows, it would trigger a periodical call of
this api.

Yeah, that would be good.

That Windows API does have an "until I say otherwise&quot; version, but it obviously leaves you vulnerable if you get your error handling wrong, or something.

On XP you can cancel a sleep request a similar way (in the WM_POWERBROADCAST handler), but they don't honour cancel requests it in Vista because it was abused too much. Too many users with no battery left after they walked away from or closed their laptop. :-(

I feel guilty now, because my company9;s software can do that to you at the moment. :-/

James
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )