summaryrefslogtreecommitdiff
diff options
authorBrandon Schaefer <brandontschaefer@gmail.com>2012-02-01 19:17:23 -0800
committerBrandon Schaefer <brandontschaefer@gmail.com>2012-02-01 19:17:23 -0800
commitc6cb16c049aa810d9b87cdc9c16c8ab9c49216ce (patch)
tree1f5a0cad5a4462ae7de86e8245a5546c6a4dbb95
parentceebb32f8dc0671ff9714f102930e6d4440977ab (diff)
Noticed from the last fix that when a window as getting restored it would always restore to the window that was active when key nav mode first started. Now the correct window gets focus when you leave key nav mode.
(bzr r1884.3.4)
-rw-r--r--plugins/unityshell/src/LauncherController.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/unityshell/src/LauncherController.cpp b/plugins/unityshell/src/LauncherController.cpp
index 488b0d386..dd9d1f868 100644
--- a/plugins/unityshell/src/LauncherController.cpp
+++ b/plugins/unityshell/src/LauncherController.cpp
@@ -170,6 +170,7 @@ public:
bool launcher_grabbed;
bool reactivate_keynav;
int reactivate_index;
+ bool keynav_restore_window_;
UBusManager ubus;
@@ -198,6 +199,7 @@ Controller::Impl::Impl(Display* display, Controller* parent)
launcher_keynav = false;
launcher_grabbed = false;
reactivate_keynav = false;
+ keynav_restore_window_ = true;
int i = 0;
for (auto monitor : monitors)
@@ -288,8 +290,9 @@ void Controller::Impl::OnWindowFocusChanged (guint32 xid)
if (keynav_first_focus)
{
- parent_->KeyNavTerminate(false);
keynav_first_focus = false;
+ keynav_restore_window_ = false;
+ parent_->KeyNavTerminate(false);
}
else if (launcher_keynav)
{
@@ -1033,6 +1036,7 @@ void Controller::KeyNavActivate()
pimpl->reactivate_keynav = false;
pimpl->launcher_keynav = true;
+ pimpl->keynav_restore_window_ = true;
pimpl->keyboard_launcher_ = pimpl->launchers[pimpl->MonitorWithMouse()];
pimpl->keyboard_launcher_->ShowShortcuts(false);
@@ -1040,7 +1044,6 @@ void Controller::KeyNavActivate()
pimpl->model_->SetSelection(0);
pimpl->ubus.SendMessage(UBUS_LAUNCHER_START_KEY_SWTICHER, g_variant_new_boolean(true));
-
pimpl->ubus.SendMessage(UBUS_LAUNCHER_START_KEY_NAV, NULL);
}
@@ -1076,8 +1079,7 @@ void Controller::KeyNavTerminate(bool activate)
pimpl->keyboard_launcher_.Release();
pimpl->ubus.SendMessage(UBUS_LAUNCHER_END_KEY_SWTICHER, g_variant_new_boolean(true));
-
- pimpl->ubus.SendMessage(UBUS_LAUNCHER_END_KEY_NAV, g_variant_new_boolean(true));
+ pimpl->ubus.SendMessage(UBUS_LAUNCHER_END_KEY_NAV, g_variant_new_boolean(pimpl->keynav_restore_window_));
}
bool Controller::KeyNavIsActive() const