* We now store the last window having focus in a separate array, or else the
windows visible on more than one workspace destroy the FFM experience (ie. restoring the last window that had focus on a workspace switch). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34207 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -339,6 +339,8 @@ Desktop::Desktop(uid_t userID, const char* targetScreen)
|
|||||||
fFront(NULL),
|
fFront(NULL),
|
||||||
fBack(NULL)
|
fBack(NULL)
|
||||||
{
|
{
|
||||||
|
memset(fLastWorkspaceFocus, 0, sizeof(fLastWorkspaceFocus));
|
||||||
|
|
||||||
char name[B_OS_NAME_LENGTH];
|
char name[B_OS_NAME_LENGTH];
|
||||||
Desktop::_GetLooperName(name, sizeof(name));
|
Desktop::_GetLooperName(name, sizeof(name));
|
||||||
|
|
||||||
@@ -2656,6 +2658,8 @@ Desktop::_ChangeWindowWorkspaces(Window* window, uint32 oldWorkspaces,
|
|||||||
// window is on this workspace, is it anymore?
|
// window is on this workspace, is it anymore?
|
||||||
if (!workspace_in_workspaces(i, newWorkspaces)) {
|
if (!workspace_in_workspaces(i, newWorkspaces)) {
|
||||||
_Windows(i).RemoveWindow(window);
|
_Windows(i).RemoveWindow(window);
|
||||||
|
if (fLastWorkspaceFocus[i] == window)
|
||||||
|
fLastWorkspaceFocus[i] = NULL;
|
||||||
|
|
||||||
if (i == CurrentWorkspace()) {
|
if (i == CurrentWorkspace()) {
|
||||||
// remove its appearance from the current workspace
|
// remove its appearance from the current workspace
|
||||||
@@ -3120,6 +3124,8 @@ Desktop::_SetWorkspace(int32 index, bool moveFocusWindow)
|
|||||||
movedWindow->Anchor(index).position = movedWindow->Frame().LeftTop();
|
movedWindow->Anchor(index).position = movedWindow->Frame().LeftTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fLastWorkspaceFocus[previousIndex] = FocusWindow();
|
||||||
|
|
||||||
// build region of windows that are no longer visible in the new workspace
|
// build region of windows that are no longer visible in the new workspace
|
||||||
|
|
||||||
BRegion dirty;
|
BRegion dirty;
|
||||||
@@ -3248,7 +3254,7 @@ Desktop::_SetWorkspace(int32 index, bool moveFocusWindow)
|
|||||||
// Set new focus, but keep focus to a floating window if still visible
|
// Set new focus, but keep focus to a floating window if still visible
|
||||||
if (!_Windows(index).HasWindow(FocusWindow())
|
if (!_Windows(index).HasWindow(FocusWindow())
|
||||||
|| !FocusWindow()->IsFloating())
|
|| !FocusWindow()->IsFloating())
|
||||||
SetFocusWindow();
|
SetFocusWindow(fLastWorkspaceFocus[index]);
|
||||||
|
|
||||||
_WindowChanged(NULL);
|
_WindowChanged(NULL);
|
||||||
MarkDirty(dirty);
|
MarkDirty(dirty);
|
||||||
|
|||||||
@@ -327,6 +327,7 @@ private:
|
|||||||
WindowList fAllWindows;
|
WindowList fAllWindows;
|
||||||
WindowList fSubsetWindows;
|
WindowList fSubsetWindows;
|
||||||
WindowList fFocusList;
|
WindowList fFocusList;
|
||||||
|
Window* fLastWorkspaceFocus[kMaxWorkspaces];
|
||||||
|
|
||||||
BObjectList<WorkspacesView> fWorkspacesViews;
|
BObjectList<WorkspacesView> fWorkspacesViews;
|
||||||
BLocker fWorkspacesLock;
|
BLocker fWorkspacesLock;
|
||||||
|
|||||||
Reference in New Issue
Block a user