From 74ae32484914da6442d0ce20d3a7f6f598c28e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 11 Jan 2006 22:30:12 +0000 Subject: [PATCH] * when the parent ServerApp of the focus window changes, it's Activate() method is called, if there is no new focus app, the cursor is unhidden for safety. The most notable difference: After having run a screen saver, the cursor will be visible again. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15919 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Desktop.cpp | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index a06f7fac9e..4fe3371787 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -920,15 +920,36 @@ Desktop::SetFocusWindow(WindowLayer* focus) focus = focus->PreviousWindow(fCurrentWorkspace); } - if (fFocus != NULL) + ServerApp* oldActiveApp = NULL; + ServerApp* newActiveApp = NULL; + + if (fFocus != NULL) { fFocus->SetFocus(false); + oldActiveApp = fFocus->ServerWindow()->App(); + } fFocus = focus; - if (focus != NULL) - focus->SetFocus(true); + if (fFocus != NULL) { + fFocus->SetFocus(true); + newActiveApp = fFocus->ServerWindow()->App(); + } UnlockAllWindows(); + + // change the "active" app if appropriate + if (oldActiveApp != newActiveApp) { + if (oldActiveApp) { + oldActiveApp->Activate(false); + } + + if (newActiveApp) { + newActiveApp->Activate(true); + } else { + // make sure the cursor is visible + HWInterface()->SetCursorVisible(true); + } + } }