From 34ce0e42d47869b916133ff39b1fa02ee7164d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 5 Jul 2005 20:28:40 +0000 Subject: [PATCH] As it turns out, window_info::type is really the window's "feel". Basic support for the desktop window feel: WinBorder will now resize a window with kDesktopWindowFeel to span over the whole screen. Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13462 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/app/WindowInfo.h | 10 +--------- headers/private/interface/WindowPrivate.h | 10 +++++----- src/servers/app/ServerWindow.cpp | 5 +++-- src/servers/app/WinBorder.cpp | 15 +++++++++++++-- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/headers/private/app/WindowInfo.h b/headers/private/app/WindowInfo.h index b7156d442b..6182226840 100644 --- a/headers/private/app/WindowInfo.h +++ b/headers/private/app/WindowInfo.h @@ -22,7 +22,7 @@ struct window_info { uint32 workspaces; int32 layer; // whatever this is... - uint32 type; // see below + uint32 feel; uint32 flags; int32 window_left; int32 window_top; @@ -37,14 +37,6 @@ struct client_window_info : window_info { char name[1]; } _PACKED; -enum { - // taken from Deskbar - kNormalWindow = 0, - kDesktopWindow = 1024, - kMenuWindow = 1025, - kWindowScreen = 1026, -}; - enum window_action { B_MINIMIZE_WINDOW, B_BRING_TO_FRONT diff --git a/headers/private/interface/WindowPrivate.h b/headers/private/interface/WindowPrivate.h index e0a7fdc724..4f22b69a5c 100644 --- a/headers/private/interface/WindowPrivate.h +++ b/headers/private/interface/WindowPrivate.h @@ -1,14 +1,14 @@ /* - * Copyright 2005, Jérôme Duval, jerome.duval@free.fr. - + * Copyright 2005, Jérôme Duval, jerome.duval@free.fr. * Distributed under the terms of the MIT License. */ - #ifndef _WINDOW_PRIVATE_H #define _WINDOW_PRIVATE_H + #include + /* Private window looks */ const window_look kDesktopWindowLook = window_look(4); @@ -18,6 +18,7 @@ const window_look kLeftTitledWindowLook = window_look(25); const window_feel kDesktopWindowFeel = window_feel(1024); const window_feel kMenuWindowFeel = window_feel(1025); +const window_feel kWindowScreenFeel = window_feel(1026); /* Private window types */ @@ -28,5 +29,4 @@ const window_type kWindowScreenWindow = window_type(1026); const uint32 kWorkspacesWindowFlag = 0x8000; const uint32 kWindowScreenFlag = 0x10000; -#endif //_WINDOW_PRIVATE_H - +#endif // _WINDOW_PRIVATE_H diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index 617bf9acc5..cfcd470ddc 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "AppServer.h" #include "BGet++.h" @@ -361,7 +362,7 @@ ServerWindow::GetInfo(window_info& info) info.workspaces = fWinBorder->Workspaces(); info.layer = 0; // ToDo: what is this??? - info.type = kNormalWindow; // ToDo: do this for real + info.feel = fWinBorder->Feel(); info.flags = fWinBorder->WindowFlags(); info.window_left = (int)floor(fWinBorder->Frame().left); info.window_top = (int)floor(fWinBorder->Frame().top); @@ -433,7 +434,7 @@ ServerWindow::CreateLayerTree(BPrivate::LinkReceiver &link, Layer **_parent) Layer *newLayer; if (link.Code() == AS_LAYER_CREATE_ROOT - && (fWinBorder->WindowFlags() & 0x00008000) != 0) { + && (fWinBorder->WindowFlags() & kWorkspacesWindowFlag) != 0) { // this is a workspaces window! newLayer = new WorkspacesLayer(frame, name, token, resizeMask, flags, fWinBorder->GetDisplayDriver()); diff --git a/src/servers/app/WinBorder.cpp b/src/servers/app/WinBorder.cpp index 6b45de5bef..65f6ec054b 100644 --- a/src/servers/app/WinBorder.cpp +++ b/src/servers/app/WinBorder.cpp @@ -14,6 +14,7 @@ #include // for mouse button defines #include +#include #include "DebugInfoManager.h" #include "Decorator.h" @@ -123,7 +124,17 @@ WinBorder::WinBorder(const BRect &frame, // do we need to change our size to let the decorator fit? // _ResizeBy() will adapt the frame for validity before resizing - _ResizeBy(0, 0); + if (feel == kDesktopWindowFeel) { + // the desktop window spans over the whole screen + // ToDo: this functionality should be moved somewhere else (so that it + // is always used when the workspace is changed) + uint16 width, height; + uint32 colorSpace; + float frequency; + gDesktop->ActiveScreen()->GetMode(width, height, colorSpace, frequency); + _ResizeBy(width - frame.Width(), height - frame.Height()); + } else + _ResizeBy(0, 0); #ifndef NEW_CLIPPING RebuildFullRegion(); @@ -687,7 +698,7 @@ WinBorder::QuietlySetFeel(int32 feel) } // floating and modal windows must appear in every workspace where - // their main window is present. Thus their wksIndex will be set to + // their main window is present. Thus their fWorkspaces will be set to // '0x0' and they will be made visible when needed. switch (fFeel) { case B_MODAL_APP_WINDOW_FEEL: