An Esc pressed while the password window is showing will close it and resume
the screen saver. I added this to the filter in the ScreenSaverWindow instead of the PasswordWindow to avoid having to add another BMessageFilter. It already is getting all keydowns anyhow. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29521 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -23,7 +23,7 @@ PasswordWindow::PasswordWindow()
|
|||||||
: BWindow(BRect(100, 100, 400, 230), "Enter Password",
|
: BWindow(BRect(100, 100, 400, 230), "Enter Password",
|
||||||
B_NO_BORDER_WINDOW_LOOK, kPasswordWindowFeel
|
B_NO_BORDER_WINDOW_LOOK, kPasswordWindowFeel
|
||||||
/* TODO: B_MODAL_APP_WINDOW_FEEL should also behave correctly */,
|
/* TODO: B_MODAL_APP_WINDOW_FEEL should also behave correctly */,
|
||||||
B_NOT_MOVABLE | B_NOT_CLOSABLE |B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE
|
B_NOT_MOVABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE
|
||||||
| B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS, B_ALL_WORKSPACES)
|
| B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS, B_ALL_WORKSPACES)
|
||||||
{
|
{
|
||||||
BView* topView = new BView(Bounds(), "topView", B_FOLLOW_ALL, B_WILL_DRAW);
|
BView* topView = new BView(Bounds(), "topView", B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
|
||||||
|
|
||||||
const static uint32 kMsgResumeSaver = 'RSSV';
|
|
||||||
const static uint32 kMsgTurnOffScreen = 'tofs';
|
const static uint32 kMsgTurnOffScreen = 'tofs';
|
||||||
const static uint32 kMsgSuspendScreen = 'suss';
|
const static uint32 kMsgSuspendScreen = 'suss';
|
||||||
const static uint32 kMsgStandByScreen = 'stbs';
|
const static uint32 kMsgStandByScreen = 'stbs';
|
||||||
@@ -230,6 +229,7 @@ ScreenBlanker::MessageReceived(BMessage* message)
|
|||||||
{
|
{
|
||||||
if (fWindow->Lock()) {
|
if (fWindow->Lock()) {
|
||||||
HideCursor();
|
HideCursor();
|
||||||
|
fPasswordWindow->SetPassword("");
|
||||||
fPasswordWindow->Hide();
|
fPasswordWindow->Hide();
|
||||||
|
|
||||||
fRunner->Resume();
|
fRunner->Resume();
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
#include <MessageRunner.h>
|
#include <MessageRunner.h>
|
||||||
|
|
||||||
|
|
||||||
|
const static uint32 kMsgResumeSaver = 'RSSV';
|
||||||
|
|
||||||
|
|
||||||
class ScreenBlanker : public BApplication {
|
class ScreenBlanker : public BApplication {
|
||||||
public:
|
public:
|
||||||
ScreenBlanker();
|
ScreenBlanker();
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "ScreenBlanker.h"
|
||||||
#include "ScreenSaverWindow.h"
|
#include "ScreenSaverWindow.h"
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
@@ -51,6 +52,11 @@ ScreenSaverFilter::Filter(BMessage* message, BHandler** target)
|
|||||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else if (message->what == B_KEY_DOWN) {
|
||||||
|
// Handle the escape key when the password window is showing
|
||||||
|
const char *string = NULL;
|
||||||
|
if (message->FindString("bytes", &string) == B_OK && string[0] == B_ESCAPE)
|
||||||
|
be_app->PostMessage(kMsgResumeSaver);
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_DISPATCH_MESSAGE;
|
return B_DISPATCH_MESSAGE;
|
||||||
|
|||||||
Reference in New Issue
Block a user