~unity-team/unity/trunk

« back to all changes in this revision

Viewing changes to launcher/HudLauncherIcon.cpp

  • Committer: Tarmac
  • Author(s): Chris Townsend
  • Date: 2013-12-02 22:49:25 UTC
  • mfrom: (3602.3.2 fix-lp1255241)
  • Revision ID: tarmac-20131202224925-2e3rkg7eil5nhuq2
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. Fixes: https://bugs.launchpad.net/bugs/1255241.

Approved by PS Jenkins bot, Eleni Maria Stea.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
HudLauncherIcon::HudLauncherIcon(LauncherHideMode hide_mode)
36
36
 : SingleMonitorLauncherIcon(IconType::HUD)
37
37
 , launcher_hide_mode_(hide_mode)
 
38
 , overlay_monitor_(0)
38
39
{
39
40
  tooltip_text = _("HUD");
40
41
  tooltip_enabled = false;
84
85
{
85
86
  unity::glib::String overlay_identity;
86
87
  gboolean can_maximise = FALSE;
87
 
  gint32 overlay_monitor = 0;
88
88
  int width, height;
89
89
  g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING,
90
 
                &overlay_identity, &can_maximise, &overlay_monitor, &width, &height);
 
90
                &overlay_identity, &can_maximise, &overlay_monitor_, &width, &height);
91
91
 
92
92
  // If the hud is open, we show the HUD button if we have a locked launcher
93
93
  if (overlay_identity.Str() == "hud" &&
94
94
      launcher_hide_mode_ == LAUNCHER_HIDE_NEVER)
95
95
  {
96
 
    SetMonitor(visible ? overlay_monitor : -1);
97
 
    SkipQuirkAnimation(Quirk::VISIBLE, overlay_monitor);
 
96
    SetMonitor(visible ? overlay_monitor_ : -1);
 
97
    SkipQuirkAnimation(Quirk::VISIBLE, overlay_monitor_);
98
98
  }
99
99
}
100
100
 
110
110
 
111
111
void HudLauncherIcon::ActivateLauncherIcon(ActionArg arg)
112
112
{
113
 
  if (IsVisible())
 
113
  if (IsVisibleOnMonitor(overlay_monitor_))
114
114
  {
115
115
    ubus_manager_.SendMessage(UBUS_HUD_CLOSE_REQUEST);
116
116
  }