* The ServerWindow now memorizes the original BDirectWindow feel when switching

to full screen. Since BDirectWindows can have any feel, this does now
  correctly restore it instead of always reverting to B_NORMAL_WINDOW_FEEL.
* This fixes part of bug #2808.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27920 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-10-08 07:46:27 +00:00
parent 6f79e8aa0a
commit 54f92239a2
3 changed files with 19 additions and 8 deletions

View File

@ -167,7 +167,8 @@ ServerWindow::ServerWindow(const char *title, ServerApp *app,
fCurrentDrawingRegion(), fCurrentDrawingRegion(),
fCurrentDrawingRegionValid(false), fCurrentDrawingRegionValid(false),
fDirectWindowData(NULL) fDirectWindowData(NULL),
fDirectWindowFeel(B_NORMAL_WINDOW_FEEL)
{ {
STRACE(("ServerWindow(%s)::ServerWindow()\n", title)); STRACE(("ServerWindow(%s)::ServerWindow()\n", title));
@ -184,6 +185,7 @@ ServerWindow::ServerWindow(const char *title, ServerApp *app,
fDeathSemaphore = create_sem(0, "window death"); fDeathSemaphore = create_sem(0, "window death");
} }
#ifdef PROFILE_MESSAGE_LOOP #ifdef PROFILE_MESSAGE_LOOP
static int static int
compare_message_profiles(const void* _a, const void* _b) compare_message_profiles(const void* _a, const void* _b)
@ -1087,14 +1089,18 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
case AS_DIRECT_WINDOW_SET_FULLSCREEN: case AS_DIRECT_WINDOW_SET_FULLSCREEN:
{ {
// TODO: maybe there is more to do than this? // TODO: maybe there is more to do than this?
// (like resizing it to screen size?)
bool enable; bool enable;
link.Read<bool>(&enable); link.Read<bool>(&enable);
status_t status = B_OK; status_t status = B_OK;
if (!fWindow->IsOffscreenWindow()) { if (!fWindow->IsOffscreenWindow()) {
//fDesktop->UnlockSingleWindow(); //fDesktop->UnlockSingleWindow();
if (enable)
fDirectWindowFeel = fWindow->Feel();
fDesktop->SetWindowFeel(fWindow, fDesktop->SetWindowFeel(fWindow,
enable ? kWindowScreenFeel : B_NORMAL_WINDOW_FEEL); enable ? kWindowScreenFeel : fDirectWindowFeel);
//fDesktop->LockSingleWindow(); //fDesktop->LockSingleWindow();
} else } else
status = B_BAD_TYPE; status = B_BAD_TYPE;

View File

@ -163,6 +163,7 @@ private:
bool fCurrentDrawingRegionValid; bool fCurrentDrawingRegionValid;
direct_window_data* fDirectWindowData; direct_window_data* fDirectWindowData;
window_feel fDirectWindowFeel;
}; };
#endif // SERVER_WINDOW_H #endif // SERVER_WINDOW_H

View File

@ -151,7 +151,7 @@ Window::Window(const BRect& frame, const char *name,
// _ResizeBy() will adapt the frame for validity before resizing // _ResizeBy() will adapt the frame for validity before resizing
if (feel == kDesktopWindowFeel) { if (feel == kDesktopWindowFeel) {
// the desktop window spans over the whole screen // the desktop window spans over the whole screen
// ToDo: this functionality should be moved somewhere else // TODO: this functionality should be moved somewhere else
// (so that it is always used when the workspace is changed) // (so that it is always used when the workspace is changed)
uint16 width, height; uint16 width, height;
uint32 colorSpace; uint32 colorSpace;
@ -1505,6 +1505,10 @@ Window::RemoveFromSubset(Window* window)
} }
/*! Returns whether or not a window is in the subset of this window.
If a window is in the subset of this window, it means it should always
appear behind this window.
*/
bool bool
Window::HasInSubset(const Window* window) const Window::HasInSubset(const Window* window) const
{ {
@ -1516,7 +1520,7 @@ Window::HasInSubset(const Window* window) const
// of their application // of their application
if (fFeel == kMenuWindowFeel) if (fFeel == kMenuWindowFeel)
return window->ServerWindow()->App() == ServerWindow()->App(); return window->ServerWindow()->App() == ServerWindow()->App();
else if (window->Feel() == kMenuWindowFeel) if (window->Feel() == kMenuWindowFeel)
return false; return false;
// we have a few special feels that have a fixed order // we have a few special feels that have a fixed order