Merge lp:~3v1n0/unity/quicklist-on-expo.stable into lp:unity/4.0

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 1731
Proposed branch: lp:~3v1n0/unity/quicklist-on-expo.stable
Merge into: lp:unity/4.0
Prerequisite: lp:~3v1n0/unity/manual-tests.stable
Diff against target: 98 lines (+44/-16)
3 files modified
manual-tests/QuicklistOnExpo.txt (+14/-0)
plugins/unityshell/src/LauncherIcon.cpp (+29/-16)
plugins/unityshell/src/LauncherIcon.h (+1/-0)
To merge this branch: bzr merge lp:~3v1n0/unity/quicklist-on-expo.stable
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+84424@code.launchpad.net

This proposal supersedes a proposal from 2011-12-05.

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

> auto menus = Menus();

I really don't like this idiom. Please provide a meaningful name for the type
std::list<DbusmenuMenuitem*> rather than use auto.

typedef std::list<DbusmenuMenuitem*> MenuList;

MenuList menus = Menus();

> auto win_manager = WindowManager::Default();

Here too. Please lets not abuse auto.

review: Needs Fixing
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> > auto menus = Menus();
>
> I really don't like this idiom. Please provide a meaningful name for the type
> std::list<DbusmenuMenuitem*> rather than use auto.

Ok, I've reverted the type for this one.

> > auto win_manager = WindowManager::Default();
>
> Here too. Please lets not abuse auto.

I this case I've not removed the auto. I don't think that I'm abusing of it in this case since we're retrieving something that has a very explicit type also reading the right-hand operator...
So I'd keep it here.

Revision history for this message
Tim Penhey (thumper) wrote :

OK.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'manual-tests/QuicklistOnExpo.txt'
2--- manual-tests/QuicklistOnExpo.txt 1970-01-01 00:00:00 +0000
3+++ manual-tests/QuicklistOnExpo.txt 2011-12-08 03:52:25 +0000
4@@ -0,0 +1,14 @@
5+Test Quicklist while on Expo
6+============================
7+
8+This test shows how the launcher quicklists work when the expo plugin is activated.
9+
10+#. Start with a clear screen
11+#. Press Super+S or select the workspace switcher on the launcher
12+#. When the workspace switcher is running, right-click over a launcher icon
13+
14+Outcome
15+ The expo should terminate, and the quicklist should be shown once the
16+ workspace switcher has been closed.
17+ Clicking over a quicklist item should work as expected and clicking outside
18+ that quicklist, should close it.
19
20=== modified file 'plugins/unityshell/src/LauncherIcon.cpp'
21--- plugins/unityshell/src/LauncherIcon.cpp 2011-09-27 18:16:32 +0000
22+++ plugins/unityshell/src/LauncherIcon.cpp 2011-12-08 03:52:25 +0000
23@@ -531,26 +531,21 @@
24
25 bool LauncherIcon::OpenQuicklist(bool default_to_first_item)
26 {
27- if (_tooltip_delay_handle)
28- g_source_remove(_tooltip_delay_handle);
29- _tooltip_delay_handle = 0;
30- _skip_tooltip_delay = false;
31-
32- _tooltip->ShowWindow(false);
33- _quicklist->RemoveAllMenuItem();
34-
35 std::list<DbusmenuMenuitem*> menus = Menus();
36+
37 if (menus.empty())
38 return false;
39
40- if (WindowManager::Default()->IsScaleActive())
41- WindowManager::Default()->TerminateScale();
42-
43- std::list<DbusmenuMenuitem*>::iterator it;
44- for (it = menus.begin(); it != menus.end(); it++)
45+ if (_tooltip_delay_handle)
46+ g_source_remove(_tooltip_delay_handle);
47+ _tooltip_delay_handle = 0;
48+ _skip_tooltip_delay = false;
49+
50+ _tooltip->ShowWindow(false);
51+ _quicklist->RemoveAllMenuItem();
52+
53+ for (auto menu_item : menus)
54 {
55- DbusmenuMenuitem* menu_item = *it;
56-
57 const gchar* type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TYPE);
58 const gchar* toggle_type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE);
59 gboolean prop_visible = dbusmenu_menuitem_property_get_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE);
60@@ -596,7 +591,25 @@
61 tip_x = 0;
62 tip_y = _center.y;
63 }
64- QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y);
65+
66+ auto win_manager = WindowManager::Default();
67+
68+ if (win_manager->IsScaleActive())
69+ win_manager->TerminateScale();
70+
71+ /* If the expo plugin is active, we need to wait it to be termated, before
72+ * shwing the icon quicklist. */
73+ if (win_manager->IsExpoActive())
74+ {
75+ on_expo_terminated_connection = win_manager->terminate_expo.connect([&]() {
76+ QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y);
77+ on_expo_terminated_connection.disconnect();
78+ });
79+ }
80+ else
81+ {
82+ QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y);
83+ }
84
85 return true;
86 }
87
88=== modified file 'plugins/unityshell/src/LauncherIcon.h'
89--- plugins/unityshell/src/LauncherIcon.h 2011-09-28 21:46:40 +0000
90+++ plugins/unityshell/src/LauncherIcon.h 2011-12-08 03:52:25 +0000
91@@ -190,6 +190,7 @@
92 sigc::connection on_icon_added_connection;
93 sigc::connection on_icon_removed_connection;
94 sigc::connection on_order_changed_connection;
95+ sigc::connection on_expo_terminated_connection;
96
97 protected:
98 const gchar* GetName();

Subscribers

People subscribed via source and target branches