The server now differentiates between hidden and minimized - that concept somehow
got lost, before. It might not work 100% correctly yet, but it works good enough to hide the Tracker status window from the Deskbar, and thus, fixing bug #133. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16314 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -72,6 +72,7 @@ enum {
|
|||||||
// Window definitions
|
// Window definitions
|
||||||
AS_SHOW_WINDOW,
|
AS_SHOW_WINDOW,
|
||||||
AS_HIDE_WINDOW,
|
AS_HIDE_WINDOW,
|
||||||
|
AS_MINIMIZE_WINDOW,
|
||||||
AS_QUIT_WINDOW,
|
AS_QUIT_WINDOW,
|
||||||
AS_SEND_BEHIND,
|
AS_SEND_BEHIND,
|
||||||
AS_SET_LOOK,
|
AS_SET_LOOK,
|
||||||
@@ -93,7 +94,6 @@ enum {
|
|||||||
AS_WINDOW_MOVE,
|
AS_WINDOW_MOVE,
|
||||||
AS_SET_SIZE_LIMITS,
|
AS_SET_SIZE_LIMITS,
|
||||||
AS_ACTIVATE_WINDOW,
|
AS_ACTIVATE_WINDOW,
|
||||||
AS_WINDOW_MINIMIZE,
|
|
||||||
AS_UPDATE_IF_NEEDED,
|
AS_UPDATE_IF_NEEDED,
|
||||||
|
|
||||||
// BPicture definitions
|
// BPicture definitions
|
||||||
|
|||||||
@@ -463,21 +463,17 @@ BWindow::ChildAt(int32 index) const
|
|||||||
void
|
void
|
||||||
BWindow::Minimize(bool minimize)
|
BWindow::Minimize(bool minimize)
|
||||||
{
|
{
|
||||||
if (IsModal())
|
if (IsModal() || IsFloating() || fMinimized == minimize)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (IsFloating())
|
Lock();
|
||||||
return;
|
|
||||||
|
|
||||||
if (fMinimized == minimize)
|
|
||||||
return;
|
|
||||||
|
|
||||||
fMinimized = minimize;
|
fMinimized = minimize;
|
||||||
|
|
||||||
Lock();
|
fLink->StartMessage(AS_MINIMIZE_WINDOW);
|
||||||
fLink->StartMessage(AS_WINDOW_MINIMIZE);
|
|
||||||
fLink->Attach<bool>(minimize);
|
fLink->Attach<bool>(minimize);
|
||||||
fLink->Flush();
|
fLink->Flush();
|
||||||
|
|
||||||
Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -407,32 +407,15 @@ ServerWindow::NotifyQuitRequested()
|
|||||||
void
|
void
|
||||||
ServerWindow::NotifyMinimize(bool minimize)
|
ServerWindow::NotifyMinimize(bool minimize)
|
||||||
{
|
{
|
||||||
// NOTE: if you do something else, other than sending a port message, PLEASE lock
|
// The client is responsible for the actual minimization
|
||||||
// This function doesn't need much -- check to make sure that we should and
|
|
||||||
// send the message to the client. According to the BeBook, the BWindow hook function
|
|
||||||
// does all the heavy lifting for us. :)
|
|
||||||
bool sendMessages = false;
|
|
||||||
|
|
||||||
if (minimize) {
|
|
||||||
if (!fWindowLayer->IsHidden()) {
|
|
||||||
Hide();
|
|
||||||
sendMessages = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (fWindowLayer->IsHidden()) {
|
|
||||||
Show();
|
|
||||||
sendMessages = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sendMessages) {
|
|
||||||
BMessage msg(B_MINIMIZE);
|
BMessage msg(B_MINIMIZE);
|
||||||
msg.AddInt64("when", real_time_clock_usecs());
|
msg.AddInt64("when", real_time_clock_usecs());
|
||||||
msg.AddBool("minimize", minimize);
|
msg.AddBool("minimize", minimize);
|
||||||
|
|
||||||
SendMessageToClient(&msg);
|
SendMessageToClient(&msg);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//! Sends a message to the client to perform a Zoom
|
//! Sends a message to the client to perform a Zoom
|
||||||
void
|
void
|
||||||
@@ -463,8 +446,8 @@ ServerWindow::GetInfo(window_info& info)
|
|||||||
info.window_right = (int)floor(fWindowLayer->Frame().right);
|
info.window_right = (int)floor(fWindowLayer->Frame().right);
|
||||||
info.window_bottom = (int)floor(fWindowLayer->Frame().bottom);
|
info.window_bottom = (int)floor(fWindowLayer->Frame().bottom);
|
||||||
|
|
||||||
info.show_hide_level = fWindowLayer->IsHidden() ? 1 : -1; // ???
|
info.show_hide_level = fWindowLayer->IsHidden() ? 1 : 0; // ???
|
||||||
info.is_mini = fWindowLayer->IsHidden();
|
info.is_mini = fWindowLayer->IsMinimized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -586,6 +569,21 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
Hide();
|
Hide();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case AS_MINIMIZE_WINDOW:
|
||||||
|
{
|
||||||
|
DTRACE(("ServerWindow %s: Message AS_MINIMIZE_WINDOW\n", Title()));
|
||||||
|
bool minimize;
|
||||||
|
if (link.Read<bool>(&minimize) == B_OK) {
|
||||||
|
if (minimize && !fWindowLayer->IsHidden())
|
||||||
|
Hide();
|
||||||
|
else if (!minimize && fWindowLayer->IsHidden())
|
||||||
|
Show();
|
||||||
|
|
||||||
|
fWindowLayer->SetMinimized(minimize);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case AS_ACTIVATE_WINDOW:
|
case AS_ACTIVATE_WINDOW:
|
||||||
{
|
{
|
||||||
DTRACE(("ServerWindow %s: Message AS_ACTIVATE_WINDOW: ViewLayer: %s\n", Title(), fCurrentLayer->Name()));
|
DTRACE(("ServerWindow %s: Message AS_ACTIVATE_WINDOW: ViewLayer: %s\n", Title(), fCurrentLayer->Name()));
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ WindowLayer::WindowLayer(const BRect& frame, const char *name,
|
|||||||
|
|
||||||
// windows start hidden
|
// windows start hidden
|
||||||
fHidden(true),
|
fHidden(true),
|
||||||
|
fMinimized(false),
|
||||||
fIsFocus(false),
|
fIsFocus(false),
|
||||||
|
|
||||||
fLook(look),
|
fLook(look),
|
||||||
@@ -1091,6 +1092,16 @@ WindowLayer::SetHidden(bool hidden)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
WindowLayer::SetMinimized(bool minimized)
|
||||||
|
{
|
||||||
|
if (minimized == fMinimized)
|
||||||
|
return;
|
||||||
|
|
||||||
|
fMinimized = minimized;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
WindowLayer::IsVisible() const
|
WindowLayer::IsVisible() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001-2005, Haiku, Inc.
|
* Copyright (c) 2001-2006, Haiku, Inc.
|
||||||
* Distributed under the terms of the MIT license.
|
* Distributed under the terms of the MIT license.
|
||||||
*
|
*
|
||||||
* Author: DarkWyrm <bpmagic@columbus.rr.com>
|
* Author: DarkWyrm <bpmagic@columbus.rr.com>
|
||||||
@@ -139,6 +139,9 @@ class WindowLayer {
|
|||||||
void SetHidden(bool hidden);
|
void SetHidden(bool hidden);
|
||||||
inline bool IsHidden() const { return fHidden; }
|
inline bool IsHidden() const { return fHidden; }
|
||||||
|
|
||||||
|
void SetMinimized(bool minimized);
|
||||||
|
inline bool IsMinimized() const { return fMinimized; }
|
||||||
|
|
||||||
void SetCurrentWorkspace(int32 index)
|
void SetCurrentWorkspace(int32 index)
|
||||||
{ fCurrentWorkspace = index; }
|
{ fCurrentWorkspace = index; }
|
||||||
bool IsVisible() const;
|
bool IsVisible() const;
|
||||||
@@ -302,6 +305,7 @@ class WindowLayer {
|
|||||||
bool fInUpdate;
|
bool fInUpdate;
|
||||||
|
|
||||||
bool fHidden;
|
bool fHidden;
|
||||||
|
bool fMinimized;
|
||||||
bool fIsFocus;
|
bool fIsFocus;
|
||||||
|
|
||||||
window_look fLook;
|
window_look fLook;
|
||||||
|
|||||||
Reference in New Issue
Block a user