SetWorkspace() now also move the subset windows of the mouse event window to

the new workspace - this fixes bug #755. Unlike floating windows, they aren't
even redrawn :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18592 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-08-23 21:21:45 +00:00
parent 85e2542930
commit 6474795008
2 changed files with 17 additions and 4 deletions

View File

@ -751,6 +751,8 @@ Desktop::SetWorkspace(int32 index)
_Windows(index).AddWindow(fMouseEventWindow); _Windows(index).AddWindow(fMouseEventWindow);
_Windows(previousIndex).RemoveWindow(fMouseEventWindow); _Windows(previousIndex).RemoveWindow(fMouseEventWindow);
_UpdateSubsetWorkspaces(fMouseEventWindow, previousIndex, index);
// send B_WORKSPACES_CHANGED message // send B_WORKSPACES_CHANGED message
fMouseEventWindow->WorkspacesChanged(oldWorkspaces, fMouseEventWindow->WorkspacesChanged(oldWorkspaces,
fMouseEventWindow->Workspaces()); fMouseEventWindow->Workspaces());
@ -837,7 +839,8 @@ Desktop::SetWorkspace(int32 index)
window->WorkspaceActivated(index, true); window->WorkspaceActivated(index, true);
if (window->InWorkspace(previousIndex) if (window->InWorkspace(previousIndex)
|| (window == fMouseEventWindow && fMouseEventWindow->IsNormal())) { || (window == fMouseEventWindow && fMouseEventWindow->IsNormal())
|| (!window->IsFloating() && !window->IsNormal() && window->HasInSubset(fMouseEventWindow))) {
// this window was visible before, and is already handled in the above loop // this window was visible before, and is already handled in the above loop
continue; continue;
} }
@ -1647,9 +1650,13 @@ Desktop::SetWindowDecoratorSettings(WindowLayer* window,
/*! /*!
Updates the workspaces of all subset windows with regard to the Updates the workspaces of all subset windows with regard to the
specifed window. specifed window.
If newIndex is not -1, it will move all subset windows that belong to
the specifed window to the new workspace; this form is only called by
SetWorkspace().
*/ */
void void
Desktop::_UpdateSubsetWorkspaces(WindowLayer* window) Desktop::_UpdateSubsetWorkspaces(WindowLayer* window, int32 previousIndex,
int32 newIndex)
{ {
STRACE(("_UpdateSubsetWorkspaces(window %p, %s)\n", window, window->Title())); STRACE(("_UpdateSubsetWorkspaces(window %p, %s)\n", window, window->Title()));
@ -1675,7 +1682,11 @@ Desktop::_UpdateSubsetWorkspaces(WindowLayer* window)
if (subset->HasInSubset(window)) { if (subset->HasInSubset(window)) {
// adopt the workspace change // adopt the workspace change
SetWindowWorkspaces(subset, subset->SubsetWorkspaces()); if (newIndex != -1) {
_Windows(newIndex).AddWindow(subset);
_Windows(previousIndex).RemoveWindow(subset);
} else
SetWindowWorkspaces(subset, subset->SubsetWorkspaces());
} }
} }
} }

View File

@ -184,7 +184,9 @@ class Desktop : public MessageLooper, public ScreenOwner {
bool affectsOtherWindows = true); bool affectsOtherWindows = true);
void _HideWindow(WindowLayer* window); void _HideWindow(WindowLayer* window);
void _UpdateSubsetWorkspaces(WindowLayer* window); void _UpdateSubsetWorkspaces(WindowLayer* window,
int32 previousIndex = -1,
int32 newIndex = -1);
void _ChangeWindowWorkspaces(WindowLayer* window, void _ChangeWindowWorkspaces(WindowLayer* window,
uint32 oldWorkspaces, uint32 newWorkspaces); uint32 oldWorkspaces, uint32 newWorkspaces);
void _BringWindowsToFront(WindowList& windows, void _BringWindowsToFront(WindowList& windows,