The <Print-Screen> key is now ignored when the screen saver is running - this

should fix bug #456.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17066 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-04-10 23:29:36 +00:00
parent cc5da1fe65
commit 1bad82578f
@@ -1,5 +1,5 @@
/* /*
* Copyright 2003-2005, Haiku. * Copyright 2003-2006, Haiku.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -47,12 +47,12 @@ ScreenSaverController::ScreenSaverController(ScreenSaverFilter *filter)
void void
ScreenSaverController::MessageReceived(BMessage *msg) ScreenSaverController::MessageReceived(BMessage *message)
{ {
CALLED(); CALLED();
SERIAL_PRINT(("what %lx\n", msg->what)); SERIAL_PRINT(("what %lx\n", message->what));
switch (msg->what) { switch (message->what) {
case B_NODE_MONITOR: case B_NODE_MONITOR:
fFilter->ReloadSettings(); fFilter->ReloadSettings();
break; break;
@@ -60,9 +60,9 @@ ScreenSaverController::MessageReceived(BMessage *msg)
case B_SOME_APP_QUIT: case B_SOME_APP_QUIT:
{ {
const char *signature; const char *signature;
if (msg->FindString("be:signature", &signature) == B_OK if (message->FindString("be:signature", &signature) == B_OK
&& strcasecmp(signature, SCREEN_BLANKER_SIG) == 0) { && strcasecmp(signature, SCREEN_BLANKER_SIG) == 0) {
fFilter->SetEnabled(msg->what == B_SOME_APP_LAUNCHED); fFilter->SetEnabled(message->what == B_SOME_APP_LAUNCHED);
} }
SERIAL_PRINT(("mime_sig %s\n", signature)); SERIAL_PRINT(("mime_sig %s\n", signature));
break; break;
@@ -73,7 +73,7 @@ ScreenSaverController::MessageReceived(BMessage *msg)
break; break;
default: default:
BLooper::MessageReceived(msg); BLooper::MessageReceived(message);
} }
} }
@@ -255,13 +255,15 @@ ScreenSaverFilter::Cornered(arrowDirection pos)
filter_result filter_result
ScreenSaverFilter::Filter(BMessage *msg, BList *outList) ScreenSaverFilter::Filter(BMessage *message, BList *outList)
{ {
fLastEventTime = system_time(); fLastEventTime = system_time();
if (msg->what == B_MOUSE_MOVED) { switch (message->what) {
case B_MOUSE_MOVED:
{
BPoint pos; BPoint pos;
msg->FindPoint("where",&pos); message->FindPoint("where", &pos);
if ((fFrameNum++ % 32) == 0) // Every so many frames, update if ((fFrameNum++ % 32) == 0) // Every so many frames, update
UpdateRectangles(); UpdateRectangles();
@@ -277,8 +279,24 @@ ScreenSaverFilter::Filter(BMessage *msg, BList *outList)
Cornered(NONE); Cornered(NONE);
Banish(); Banish();
} }
} else break;
}
case B_KEY_UP:
case B_KEY_DOWN:
{
// we ignore the Print-Screen key to make screen shots of
// screen savers possible
int32 key;
if (fEnabled && message->FindInt32("key", &key) == B_OK && key == 0xe)
break;
// supposed to fall through
}
default:
Banish(); Banish();
break;
}
return B_DISPATCH_MESSAGE; return B_DISPATCH_MESSAGE;
} }