diff options
| author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2011-12-08 00:06:03 -0500 |
|---|---|---|
| committer | Tarmac <> | 2011-12-08 00:06:03 -0500 |
| commit | c5db72096a49f288c97f33ac89db16ab28f3ab5b (patch) | |
| tree | 5b36faf894cf0f6a8eaca5c3ef69f63b9bee928a | |
| parent | 5a53b7647c4757923039a74748fae8f5d3e4b09a (diff) | |
| parent | b2e363d8abe78cec452f15c3e7b3243c59ba1d39 (diff) | |
Doing work to fix bug #791810 properly.
When a quicklist is opened when the expo is currently running, we just wait it to be closed, before showing the quicklist itself.. Fixes: https://bugs.launchpad.net/bugs/791810. Appoved by Tim Penhey. (bzr r1769)
| -rw-r--r-- | manual-tests/QuicklistOnExpo.txt | 14 | ||||
| -rw-r--r-- | plugins/unityshell/src/LauncherIcon.cpp | 37 | ||||
| -rw-r--r-- | plugins/unityshell/src/LauncherIcon.h | 1 |
3 files changed, 40 insertions, 12 deletions
diff --git a/manual-tests/QuicklistOnExpo.txt b/manual-tests/QuicklistOnExpo.txt new file mode 100644 index 000000000..47b7aec53 --- /dev/null +++ b/manual-tests/QuicklistOnExpo.txt @@ -0,0 +1,14 @@ +Test Quicklist while on Expo +============================ + +This test shows how the launcher quicklists work when the expo plugin is activated. + +#. Start with a clear screen +#. Press Super+S or select the workspace switcher on the launcher +#. When the workspace switcher is running, right-click over a launcher icon + +Outcome + The expo should terminate, and the quicklist should be shown once the + workspace switcher has been closed. + Clicking over a quicklist item should work as expected and clicking outside + that quicklist, should close it. diff --git a/plugins/unityshell/src/LauncherIcon.cpp b/plugins/unityshell/src/LauncherIcon.cpp index 98fdd9b07..af100d580 100644 --- a/plugins/unityshell/src/LauncherIcon.cpp +++ b/plugins/unityshell/src/LauncherIcon.cpp @@ -534,6 +534,11 @@ void LauncherIcon::RecvMouseLeave() bool LauncherIcon::OpenQuicklist(bool default_to_first_item) { + std::list<DbusmenuMenuitem*> menus = Menus(); + + if (menus.empty()) + return false; + if (_tooltip_delay_handle) g_source_remove(_tooltip_delay_handle); _tooltip_delay_handle = 0; @@ -542,18 +547,8 @@ bool LauncherIcon::OpenQuicklist(bool default_to_first_item) _tooltip->ShowWindow(false); _quicklist->RemoveAllMenuItem(); - std::list<DbusmenuMenuitem*> menus = Menus(); - if (menus.empty()) - return false; - - if (WindowManager::Default()->IsScaleActive()) - WindowManager::Default()->TerminateScale(); - - std::list<DbusmenuMenuitem*>::iterator it; - for (it = menus.begin(); it != menus.end(); it++) + for (auto menu_item : menus) { - DbusmenuMenuitem* menu_item = *it; - const gchar* type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TYPE); const gchar* toggle_type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE); gboolean prop_visible = dbusmenu_menuitem_property_get_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE); @@ -599,7 +594,25 @@ bool LauncherIcon::OpenQuicklist(bool default_to_first_item) tip_x = 0; tip_y = _center.y; } - QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y); + + auto win_manager = WindowManager::Default(); + + if (win_manager->IsScaleActive()) + win_manager->TerminateScale(); + + /* If the expo plugin is active, we need to wait it to be termated, before + * shwing the icon quicklist. */ + if (win_manager->IsExpoActive()) + { + on_expo_terminated_connection = win_manager->terminate_expo.connect([&]() { + QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y); + on_expo_terminated_connection.disconnect(); + }); + } + else + { + QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y); + } return true; } diff --git a/plugins/unityshell/src/LauncherIcon.h b/plugins/unityshell/src/LauncherIcon.h index 3ad781def..552d6b8c7 100644 --- a/plugins/unityshell/src/LauncherIcon.h +++ b/plugins/unityshell/src/LauncherIcon.h @@ -195,6 +195,7 @@ public: sigc::connection on_icon_added_connection; sigc::connection on_icon_removed_connection; sigc::connection on_order_changed_connection; + sigc::connection on_expo_terminated_connection; protected: const gchar* GetName(); |
