microtrigger / lightpack

Automatically exported from code.google.com/p/lightpack
GNU General Public License v3.0
1 stars 0 forks source link

Sleep problem #357

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Put PC into sleep
2.
3.

What is the expected output? What do you see instead?
Expect lightpack leds to go out. They are on.

What version of the product are you using? On what operating system?
fw 7.5, prismatik 5.10.4, windows 8.1

Please provide any additional information below.

Original issue reported on code.google.com by piotr.re...@gmail.com on 20 Jan 2014 at 3:31

GoogleCodeExporter commented 9 years ago
I'm having same issue with Windows 7

Original comment by jpetr...@realtaentertainment.com on 7 Feb 2014 at 12:43

GoogleCodeExporter commented 9 years ago
As for now, you have to double click prismatik icon in system tray, to turn 
leds on and off.

But that's hard to remember. Hope they add option to have them turn off 
automatically when computer goes to sleep.

Original comment by piotr.re...@gmail.com on 7 Feb 2014 at 1:35

GoogleCodeExporter commented 9 years ago

Original comment by tim.hell...@gmail.com on 31 Mar 2014 at 10:01

GoogleCodeExporter commented 9 years ago
I fixed this locally by implementing SettingsWindow::nativeEvent() as below.  
Seems to take care of the problem for the most part.

bool SettingsWindow::nativeEvent(const QByteArray & eventType, void * message, 
long * result)
{
    if (eventType == "windows_generic_MSG")
    {
        MSG *msg = reinterpret_cast<MSG *>(message);
        if (msg->message == WM_POWERBROADCAST)
        {
            if (msg->wParam == PBT_APMSUSPEND)
            {
                DEBUG_LOW_LEVEL << Q_FUNC_INFO << "SLEEP!";
            }
            else if (msg->wParam == PBT_APMRESUMEAUTOMATIC)
            {
                DEBUG_LOW_LEVEL << Q_FUNC_INFO << "AWAKEN!";
            }
            return getLightpackApp()->winEventFilter ( msg, result );
        }
    }
    return false;
}

P.S. I think #define DEBUG_OUT_FUNC_INFO( DEBUG_LEVEL ) in debug.h should be <= 
instead of >=, so the debug macros DEBUG_XXX_LEVEL actually work as specified 
in the comments around line 37 in debug.h.

Original comment by jpetr...@realtaentertainment.com on 31 Mar 2014 at 11:57