* 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:
parent
6f79e8aa0a
commit
54f92239a2
|
@ -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;
|
||||||
|
|
|
@ -50,7 +50,7 @@ struct window_info;
|
||||||
class ServerWindow : public MessageLooper {
|
class ServerWindow : public MessageLooper {
|
||||||
public:
|
public:
|
||||||
ServerWindow(const char *title, ServerApp *app,
|
ServerWindow(const char *title, ServerApp *app,
|
||||||
port_id clientPort, port_id looperPort,
|
port_id clientPort, port_id looperPort,
|
||||||
int32 clientToken);
|
int32 clientToken);
|
||||||
virtual ~ServerWindow();
|
virtual ~ServerWindow();
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public:
|
||||||
|
|
||||||
// related thread/team_id(s).
|
// related thread/team_id(s).
|
||||||
inline team_id ClientTeam() const { return fClientTeam; }
|
inline team_id ClientTeam() const { return fClientTeam; }
|
||||||
|
|
||||||
void HandleDirectConnection(int32 bufferState = -1,
|
void HandleDirectConnection(int32 bufferState = -1,
|
||||||
int32 driverState = -1);
|
int32 driverState = -1);
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -1435,7 +1435,7 @@ Window::HasModal() const
|
||||||
|
|
||||||
/*! \brief Returns the windows that's in behind of the backmost position
|
/*! \brief Returns the windows that's in behind of the backmost position
|
||||||
this window can get.
|
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*
|
||||||
Window::Backmost(Window* window, int32 workspace)
|
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
|
/*! \brief Returns the windows that's in front of the frontmost position
|
||||||
this window can get.
|
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*
|
||||||
Window::Frontmost(Window* first, int32 workspace)
|
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
|
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
|
||||||
|
|
Loading…
Reference in New Issue