[Psi-devel] RC1 vs. suspend

Michał Jazłowiecki michalj at poczta.neostrada.pl
Sat Jun 23 13:14:43 PDT 2007


Remko Tronçon wrote:
>> Just before the system hibernates, WM_POWERBROADCAST message is sent
>> with PBT_APMSUSPEND as wParam and 0 as lParam.
>> *snip*
> 
> Well, we knew all that, looking at
> http://svn.psi-im.org/psi/trunk/src/tools/systemwatch/systemwatch_win.cpp
> It doesn't answer the question why it doesn't work, though. Can you
> check our implementation to see whether these messages are indeed
> detected by Psi?

Unfortunately, it seems not.


I've changed the above file a little by adding qDebug(QString) call in 
WinSystemWatch::WinSystemWatchPrivate::winEvent(MSG *, long *) method, 
in the code part responsible for handling of WM_POWERBROADCAST message 
with PBT_APMSUSPEND wParam.
I've introduced a similiar change in src/psicon.cpp file, in 
PsiCon::doSleep() method, compiled Psi and launched it. After starting 
SysInternals DebugView, I've hibernated my notebook, awaiting to see two 
messages in the log. However, after I have restored my system, the log 
did not contain those messages.

Moreover, when I added a qDebug (QString) call in 
WinSystemWatch::WinSystemWatchPrivate::winEvent(MSG *, long *) method, 
which wrote information about _ALL_ messages received by SystemWatch, 
log file was empty again.

After skimming through Qt4.2 docs I've found that own message handling 
requires overriding QCoreApplication::winEventFilter (MSG *, long *) 
method, so I took a look at src/psiapplication.cpp file and found no 
such method (as opposed to the similiar methods for Unices and MacOS X). 
Maybe this is a clue.

I'm still investigating the case.


Regards,


-- 
Michał Jazłowiecki (michalj)
Psi Forum & Wiki Moderator



More information about the psi-devel mailing list