* Implemented private functions do_minimize_team(), and do_bring_to_front_team()
used by the Deskbar (for "Hide All" and "Show All"). The latter doesn't work correctly yet, though, it just maximizes all windows of that application. * Added a TODO to ServerWindow AS_MINIMIZE_WINDOW on how to make it work correctly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16315 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -36,6 +36,8 @@ enum {
|
|||||||
// Desktop definitions
|
// Desktop definitions
|
||||||
AS_GET_WINDOW_LIST,
|
AS_GET_WINDOW_LIST,
|
||||||
AS_GET_WINDOW_INFO,
|
AS_GET_WINDOW_INFO,
|
||||||
|
AS_MINIMIZE_TEAM,
|
||||||
|
AS_BRING_TEAM_TO_FRONT,
|
||||||
|
|
||||||
// Application definitions
|
// Application definitions
|
||||||
AS_CREATE_APP,
|
AS_CREATE_APP,
|
||||||
|
|||||||
@@ -1055,16 +1055,28 @@ get_token_list(team_id team, int32 *_count)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
do_bring_to_front_team(BRect zoomRect, team_id app, bool zoom)
|
do_bring_to_front_team(BRect zoomRect, team_id team, bool zoom)
|
||||||
{
|
{
|
||||||
// ToDo: implement me, needed for Deskbar!
|
BPrivate::AppServerLink link;
|
||||||
|
|
||||||
|
link.StartMessage(AS_BRING_TEAM_TO_FRONT);
|
||||||
|
link.Attach<team_id>(team);
|
||||||
|
// we don't have any zooming effect
|
||||||
|
|
||||||
|
link.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
do_minimize_team(BRect zoomRect, team_id team, bool zoom)
|
do_minimize_team(BRect zoomRect, team_id team, bool zoom)
|
||||||
{
|
{
|
||||||
// ToDo: implement me, needed for Deskbar!
|
BPrivate::AppServerLink link;
|
||||||
|
|
||||||
|
link.StartMessage(AS_MINIMIZE_TEAM);
|
||||||
|
link.Attach<team_id>(team);
|
||||||
|
// we don't have any zooming effect
|
||||||
|
|
||||||
|
link.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1710,6 +1710,40 @@ Desktop::FindWindowLayerByClientToken(int32 token, team_id teamID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Desktop::MinimizeApplication(team_id team)
|
||||||
|
{
|
||||||
|
BAutolock locker(fWindowLock);
|
||||||
|
|
||||||
|
// Just minimize all windows of that application
|
||||||
|
|
||||||
|
for (WindowLayer *window = fAllWindows.FirstWindow(); window != NULL;
|
||||||
|
window = window->NextWindow(kAllWindowList)) {
|
||||||
|
if (window->ServerWindow()->ClientTeam() != team)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
window->ServerWindow()->NotifyMinimize(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Desktop::BringApplicationToFront(team_id team)
|
||||||
|
{
|
||||||
|
BAutolock locker(fWindowLock);
|
||||||
|
|
||||||
|
// TODO: for now, just maximize all windows of that application
|
||||||
|
|
||||||
|
for (WindowLayer *window = fAllWindows.FirstWindow(); window != NULL;
|
||||||
|
window = window->NextWindow(kAllWindowList)) {
|
||||||
|
if (window->ServerWindow()->ClientTeam() != team)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
window->ServerWindow()->NotifyMinimize(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Desktop::WriteWindowList(team_id team, BPrivate::LinkSender& sender)
|
Desktop::WriteWindowList(team_id team, BPrivate::LinkSender& sender)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -158,6 +158,9 @@ class Desktop : public MessageLooper, public ScreenOwner {
|
|||||||
BRegion& BackgroundRegion()
|
BRegion& BackgroundRegion()
|
||||||
{ return fBackgroundRegion; }
|
{ return fBackgroundRegion; }
|
||||||
|
|
||||||
|
void MinimizeApplication(team_id team);
|
||||||
|
void BringApplicationToFront(team_id team);
|
||||||
|
|
||||||
void WriteWindowList(team_id team,
|
void WriteWindowList(team_id team,
|
||||||
BPrivate::LinkSender& sender);
|
BPrivate::LinkSender& sender);
|
||||||
void WriteWindowInfo(int32 serverToken,
|
void WriteWindowInfo(int32 serverToken,
|
||||||
|
|||||||
@@ -426,18 +426,32 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
case AS_GET_WINDOW_LIST:
|
case AS_GET_WINDOW_LIST:
|
||||||
{
|
{
|
||||||
team_id team;
|
team_id team;
|
||||||
link.Read<team_id>(&team);
|
if (link.Read<team_id>(&team) == B_OK)
|
||||||
|
fDesktop->WriteWindowList(team, fLink.Sender());
|
||||||
fDesktop->WriteWindowList(team, fLink.Sender());
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case AS_GET_WINDOW_INFO:
|
case AS_GET_WINDOW_INFO:
|
||||||
{
|
{
|
||||||
int32 serverToken;
|
int32 serverToken;
|
||||||
link.Read<int32>(&serverToken);
|
if (link.Read<int32>(&serverToken) == B_OK)
|
||||||
|
fDesktop->WriteWindowInfo(serverToken, fLink.Sender());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
fDesktop->WriteWindowInfo(serverToken, fLink.Sender());
|
case AS_MINIMIZE_TEAM:
|
||||||
|
{
|
||||||
|
team_id team;
|
||||||
|
if (link.Read<team_id>(&team) == B_OK)
|
||||||
|
fDesktop->MinimizeApplication(team);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AS_BRING_TEAM_TO_FRONT:
|
||||||
|
{
|
||||||
|
team_id team;
|
||||||
|
if (link.Read<team_id>(&team) == B_OK)
|
||||||
|
fDesktop->BringApplicationToFront(team);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -574,6 +574,7 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
DTRACE(("ServerWindow %s: Message AS_MINIMIZE_WINDOW\n", Title()));
|
DTRACE(("ServerWindow %s: Message AS_MINIMIZE_WINDOW\n", Title()));
|
||||||
bool minimize;
|
bool minimize;
|
||||||
if (link.Read<bool>(&minimize) == B_OK) {
|
if (link.Read<bool>(&minimize) == B_OK) {
|
||||||
|
// TODO: this actually needs to take the window's show/hide counter into account
|
||||||
if (minimize && !fWindowLayer->IsHidden())
|
if (minimize && !fWindowLayer->IsHidden())
|
||||||
Hide();
|
Hide();
|
||||||
else if (!minimize && fWindowLayer->IsHidden())
|
else if (!minimize && fWindowLayer->IsHidden())
|
||||||
|
|||||||
Reference in New Issue
Block a user