When a focus locked window is hidden, we need to remove the focus lock.
Otherwise the focus cannot be changed to another window. In one case this could have a severe sideeffect: When a window is quit it is hidden to remove focus and remove it from screen. If this didn't work due to the focus lock, the fFocus member would become a stale pointer after the window was quit and deleted. The app_server would crash or corrupt memory on the next focus change. Easily seen when moderately quickly clicking away a few alert windows. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32929 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1065,16 +1065,21 @@ Desktop::HideWindow(Window* window)
|
|||||||
fMouseEventWindow = NULL;
|
fMouseEventWindow = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fLockedFocusWindow == window) {
|
||||||
|
// Remove the focus lock so the focus can be changed below
|
||||||
|
fLockedFocusWindow = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (window->InWorkspace(fCurrentWorkspace)) {
|
if (window->InWorkspace(fCurrentWorkspace)) {
|
||||||
_UpdateSubsetWorkspaces(window);
|
_UpdateSubsetWorkspaces(window);
|
||||||
_HideWindow(window);
|
_HideWindow(window);
|
||||||
_UpdateFronts();
|
_UpdateFronts();
|
||||||
|
|
||||||
if (FocusWindow() == window)
|
|
||||||
SetFocusWindow();
|
|
||||||
} else
|
} else
|
||||||
_WindowChanged(window);
|
_WindowChanged(window);
|
||||||
|
|
||||||
|
if (FocusWindow() == window)
|
||||||
|
SetFocusWindow();
|
||||||
|
|
||||||
_WindowRemoved(window);
|
_WindowRemoved(window);
|
||||||
|
|
||||||
if (window->HasWorkspacesViews()) {
|
if (window->HasWorkspacesViews()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user