summaryrefslogtreecommitdiff
diff options
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-10-12 00:49:29 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-10-12 00:49:29 +0800
commit279724cfd62d32209714bac86800d1bf4ee37f35 (patch)
treed84b5ee4d9e239778e12b4201fb062ce4729dba8
parentf69bde24e3a5aaf0abbecdfa25d6563dd78e5378 (diff)
Always focus the window when the titlebar is grabbed
Fixes LP#843958 Fixes LP: #843958 (bzr r1713.1.1)
-rw-r--r--plugins/unityshell/src/PanelMenuView.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/unityshell/src/PanelMenuView.cpp b/plugins/unityshell/src/PanelMenuView.cpp
index 2751223fb..d83120be3 100644
--- a/plugins/unityshell/src/PanelMenuView.cpp
+++ b/plugins/unityshell/src/PanelMenuView.cpp
@@ -1258,6 +1258,7 @@ PanelMenuView::GetMaximizedWindow()
void
PanelMenuView::OnMaximizedGrabStart(int x, int y, unsigned long button_flags, unsigned long)
{
+ Window maximized_win;
if (nux::GetEventButton(button_flags) != 1 || _places_showing)
return;
@@ -1266,8 +1267,15 @@ PanelMenuView::OnMaximizedGrabStart(int x, int y, unsigned long button_flags, un
//
// This is a workaround to avoid that the grid plugin would be fired
// showing the window shape preview effect. See bug #838923
- if (GetMaximizedWindow() != 0)
+
+ maximized_win = GetMaximizedWindow ();
+
+ if (maximized_win != 0)
+ {
+ /* Always activate the window in case it is on another monitor */
+ WindowManager::Default ()->Activate (maximized_win);
_panel_titlebar_grab_area->SetGrabbed(true);
+ }
}
void