* 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(),
fCurrentDrawingRegionValid(false),
fDirectWindowData(NULL)
fDirectWindowData(NULL),
fDirectWindowFeel(B_NORMAL_WINDOW_FEEL)
{
STRACE(("ServerWindow(%s)::ServerWindow()\n", title));
@ -184,6 +185,7 @@ ServerWindow::ServerWindow(const char *title, ServerApp *app,
fDeathSemaphore = create_sem(0, "window death");
}
#ifdef PROFILE_MESSAGE_LOOP
static int
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:
{
// TODO: maybe there is more to do than this?
// (like resizing it to screen size?)
bool enable;
link.Read<bool>(&enable);
status_t status = B_OK;
if (!fWindow->IsOffscreenWindow()) {
//fDesktop->UnlockSingleWindow();
if (enable)
fDirectWindowFeel = fWindow->Feel();
fDesktop->SetWindowFeel(fWindow,
enable ? kWindowScreenFeel : B_NORMAL_WINDOW_FEEL);
enable ? kWindowScreenFeel : fDirectWindowFeel);
//fDesktop->LockSingleWindow();
} else
status = B_BAD_TYPE;

View File

@ -50,7 +50,7 @@ struct window_info;
class ServerWindow : public MessageLooper {
public:
ServerWindow(const char *title, ServerApp *app,
port_id clientPort, port_id looperPort,
port_id clientPort, port_id looperPort,
int32 clientToken);
virtual ~ServerWindow();
@ -91,7 +91,7 @@ public:
// related thread/team_id(s).
inline team_id ClientTeam() const { return fClientTeam; }
void HandleDirectConnection(int32 bufferState = -1,
int32 driverState = -1);
@ -163,6 +163,7 @@ private:
bool fCurrentDrawingRegionValid;
direct_window_data* fDirectWindowData;
window_feel fDirectWindowFeel;
};
#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
if (feel == kDesktopWindowFeel) {
// 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)
uint16 width, height;
uint32 colorSpace;
@ -1435,7 +1435,7 @@ Window::HasModal() const
/*! \brief Returns the windows that's in behind of the backmost position
this window can get.
Returns NULL is this window can be the backmost window.
Returns NULL is this window can be the backmost window.
*/
Window*
Window::Backmost(Window* window, int32 workspace)
@ -1464,7 +1464,7 @@ Window::Backmost(Window* window, int32 workspace)
/*! \brief Returns the windows that's in front of the frontmost position
this window can get.
Returns NULL if this window can be the frontmost window.
Returns NULL if this window can be the frontmost window.
*/
Window*
Window::Frontmost(Window* first, int32 workspace)
@ -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
Window::HasInSubset(const Window* window) const
{
@ -1516,7 +1520,7 @@ Window::HasInSubset(const Window* window) const
// of their application
if (fFeel == kMenuWindowFeel)
return window->ServerWindow()->App() == ServerWindow()->App();
else if (window->Feel() == kMenuWindowFeel)
if (window->Feel() == kMenuWindowFeel)
return false;
// we have a few special feels that have a fixed order