Merge lp:~townsend/unity/fix-lp1255241 into lp:unity

Proposed by Christopher Townsend
Status: Merged
Approved by: Christopher Townsend
Approved revision: no longer in the source branch.
Merged at revision: 3605
Proposed branch: lp:~townsend/unity/fix-lp1255241
Merge into: lp:unity
Diff against target: 53 lines (+6/-5)
2 files modified
launcher/HudLauncherIcon.cpp (+5/-5)
launcher/HudLauncherIcon.h (+1/-0)
To merge this branch: bzr merge lp:~townsend/unity/fix-lp1255241
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Eleni Maria Stea (community) Approve
Review via email: mp+196791@code.launchpad.net

Commit message

Use IsVisibleOnMonitor() instead of IsVisible() for checking to close the Hud when clicking the Hud icon. This is due to the icon's quirk only being set for the current monitor.

Description of the change

= Issue =
Hud AP test failure due to clicking the Hud icon would not close the Hud. I confirmed this both through the AP test and manually.

Some fairly recent changes went into Unity that allowed quirks to be set on icons per monitor. The method to handle closing the Hud by clicking on the Hud icon was not updated and looked to see if all possible monitors had the quirk set instead of the monitor that had the Hud overlay open.

= Fix =
Use IsVisibleOnMonitor() instead of IsVisible() and add a new overlay_monitor_ member to keep track of which monitor the Hud overlay is open on.

= Test =
AP test is already included.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Eleni Maria Stea (hikiko) wrote :

Looks good! +1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/HudLauncherIcon.cpp'
2--- launcher/HudLauncherIcon.cpp 2013-11-14 00:17:19 +0000
3+++ launcher/HudLauncherIcon.cpp 2013-11-27 20:28:36 +0000
4@@ -35,6 +35,7 @@
5 HudLauncherIcon::HudLauncherIcon(LauncherHideMode hide_mode)
6 : SingleMonitorLauncherIcon(IconType::HUD)
7 , launcher_hide_mode_(hide_mode)
8+ , overlay_monitor_(0)
9 {
10 tooltip_text = _("HUD");
11 tooltip_enabled = false;
12@@ -84,17 +85,16 @@
13 {
14 unity::glib::String overlay_identity;
15 gboolean can_maximise = FALSE;
16- gint32 overlay_monitor = 0;
17 int width, height;
18 g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING,
19- &overlay_identity, &can_maximise, &overlay_monitor, &width, &height);
20+ &overlay_identity, &can_maximise, &overlay_monitor_, &width, &height);
21
22 // If the hud is open, we show the HUD button if we have a locked launcher
23 if (overlay_identity.Str() == "hud" &&
24 launcher_hide_mode_ == LAUNCHER_HIDE_NEVER)
25 {
26- SetMonitor(visible ? overlay_monitor : -1);
27- SkipQuirkAnimation(Quirk::VISIBLE, overlay_monitor);
28+ SetMonitor(visible ? overlay_monitor_ : -1);
29+ SkipQuirkAnimation(Quirk::VISIBLE, overlay_monitor_);
30 }
31 }
32
33@@ -110,7 +110,7 @@
34
35 void HudLauncherIcon::ActivateLauncherIcon(ActionArg arg)
36 {
37- if (IsVisible())
38+ if (IsVisibleOnMonitor(overlay_monitor_))
39 {
40 ubus_manager_.SendMessage(UBUS_HUD_CLOSE_REQUEST);
41 }
42
43=== modified file 'launcher/HudLauncherIcon.h'
44--- launcher/HudLauncherIcon.h 2012-11-06 18:19:09 +0000
45+++ launcher/HudLauncherIcon.h 2013-11-27 20:28:36 +0000
46@@ -52,6 +52,7 @@
47 nux::Color background_color_;
48 LauncherHideMode launcher_hide_mode_;
49 UBusManager ubus_manager_;
50+ gint32 overlay_monitor_;
51 };
52
53 }