* Made the screen saver window as well as the password window kWindowScreenFeel.

* This makes them highest in the window order, so that floating all windows
  like the Deskbar cannot compromise the password protection anymore.
  This fixes #2808.
* Note, the password window should also block uses of Alt-Tab, even though this
  is usually harmless (as only other windows with kWindowScreenFeel can be
  promoted to the front).
* Also note, the password window should actually be an app modal window that
  appears in front of the screen saver window. However, the app_server currently
  doesn't allow anything but menus on top of a kWindowScreenFeel window.
* Removed changing full screen setting of the ScreenSaver window, as this
  shouldn't matter.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27921 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-10-08 07:58:41 +00:00
parent 54f92239a2
commit 4a1b989745
2 changed files with 14 additions and 12 deletions
+9 -8
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2003-2007, Haiku, Inc. All Rights Reserved. * Copyright 2003-2008, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -11,30 +11,31 @@
#include "PasswordWindow.h" #include "PasswordWindow.h"
#include <Application.h> #include <Application.h>
#include <Box.h> #include <Box.h>
#include <Button.h> #include <Button.h>
#include <Screen.h> #include <Screen.h>
#include <WindowPrivate.h>
PasswordWindow::PasswordWindow() PasswordWindow::PasswordWindow()
: BWindow(BRect(100, 100, 400, 230), "Enter Password", B_NO_BORDER_WINDOW_LOOK, : BWindow(BRect(100, 100, 400, 230), "Enter Password",
B_FLOATING_ALL_WINDOW_FEEL, B_NO_BORDER_WINDOW_LOOK, kWindowScreenFeel /* TODO: should be B_MODAL_APP_WINDOW_FEEL*/,
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);
topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
AddChild(topView); AddChild(topView);
BRect bounds(Bounds()); BRect bounds(Bounds());
bounds.InsetBy(10.0, 10.0); bounds.InsetBy(10.0, 10.0);
BBox *customBox = new BBox(bounds, "customBox", B_FOLLOW_NONE); BBox *customBox = new BBox(bounds, "customBox", B_FOLLOW_NONE);
topView->AddChild(customBox); topView->AddChild(customBox);
customBox->SetLabel("Unlock screen saver"); customBox->SetLabel("Unlock screen saver");
bounds.top += 10.0; bounds.top += 10.0;
fPassword = new BTextControl(bounds, "password", "Enter password:", fPassword = new BTextControl(bounds, "password", "Enter password:",
"VeryLongPasswordPossible", B_FOLLOW_NONE); "VeryLongPasswordPossible", B_FOLLOW_NONE);
@@ -44,7 +45,7 @@ PasswordWindow::PasswordWindow()
fPassword->TextView()->HideTyping(true); fPassword->TextView()->HideTyping(true);
fPassword->SetDivider(be_plain_font->StringWidth("Enter password:") + 5.0); fPassword->SetDivider(be_plain_font->StringWidth("Enter password:") + 5.0);
BButton* button = new BButton(BRect(), "unlock", "Unlock", BButton* button = new BButton(BRect(), "unlock", "Unlock",
new BMessage(kMsgUnlock), B_FOLLOW_NONE); new BMessage(kMsgUnlock), B_FOLLOW_NONE);
customBox->AddChild(button); customBox->AddChild(button);
button->MakeDefault(true); button->MakeDefault(true);
+5 -4
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2003-2006, Haiku. * Copyright 2003-2008, Haiku.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -10,11 +10,11 @@
#include "ScreenSaverWindow.h" #include "ScreenSaverWindow.h"
#include <WindowPrivate.h>
#include <Application.h> #include <Application.h>
#include <View.h> #include <View.h>
#include <WindowPrivate.h>
/*! /*!
This is the BDirectWindow subclass that rendering occurs in. This is the BDirectWindow subclass that rendering occurs in.
@@ -22,7 +22,8 @@
*/ */
ScreenSaverWindow::ScreenSaverWindow(BRect frame) ScreenSaverWindow::ScreenSaverWindow(BRect frame)
: BDirectWindow(frame, "ScreenSaver Window", : BDirectWindow(frame, "ScreenSaver Window",
B_NO_BORDER_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_NOT_RESIZABLE | B_NOT_ZOOMABLE), B_NO_BORDER_WINDOW_LOOK, kWindowScreenFeel,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE),
fSaver(NULL) fSaver(NULL)
{ {
frame.OffsetTo(0, 0); frame.OffsetTo(0, 0);