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:
@@ -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,30 +255,48 @@ 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) {
|
||||||
BPoint pos;
|
case B_MOUSE_MOVED:
|
||||||
msg->FindPoint("where",&pos);
|
{
|
||||||
if ((fFrameNum++ % 32) == 0) // Every so many frames, update
|
BPoint pos;
|
||||||
UpdateRectangles();
|
message->FindPoint("where", &pos);
|
||||||
|
if ((fFrameNum++ % 32) == 0) // Every so many frames, update
|
||||||
if (fTopLeft.Contains(pos))
|
UpdateRectangles();
|
||||||
Cornered(UPLEFT);
|
|
||||||
else if (fTopRight.Contains(pos))
|
if (fTopLeft.Contains(pos))
|
||||||
Cornered(UPRIGHT);
|
Cornered(UPLEFT);
|
||||||
else if (fBottomLeft.Contains(pos))
|
else if (fTopRight.Contains(pos))
|
||||||
Cornered(DOWNLEFT);
|
Cornered(UPRIGHT);
|
||||||
else if (fBottomRight.Contains(pos))
|
else if (fBottomLeft.Contains(pos))
|
||||||
Cornered(DOWNRIGHT);
|
Cornered(DOWNLEFT);
|
||||||
else {
|
else if (fBottomRight.Contains(pos))
|
||||||
Cornered(NONE);
|
Cornered(DOWNRIGHT);
|
||||||
Banish();
|
else {
|
||||||
|
Cornered(NONE);
|
||||||
|
Banish();
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else
|
|
||||||
Banish();
|
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();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return B_DISPATCH_MESSAGE;
|
return B_DISPATCH_MESSAGE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user