diff options
| author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2015-12-11 12:45:07 +0000 |
|---|---|---|
| committer | CI Train Bot <ci-train-bot@canonical.com> | 2015-12-11 12:45:07 +0000 |
| commit | 9c80c5d0abf2949f027bbe7d70dbf2e2e05fd948 (patch) | |
| tree | e031da621bdc191803f089e6322f1105021635de | |
| parent | 9b3af11f35caaa23dab9c606432f66cd07f1c0ba (diff) | |
| parent | 217988d7e8405328c346f40c61bd49819b2d9ff1 (diff) | |
PanelIndicatorEntryView: Activate menus on click, by drawing them as active Fixes: #1513523
Approved by: Andrea Azzarone (bzr r4043)
| -rw-r--r-- | panel/PanelIndicatorEntryView.cpp | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/panel/PanelIndicatorEntryView.cpp b/panel/PanelIndicatorEntryView.cpp index 9c0273ede..b4f75f1c4 100644 --- a/panel/PanelIndicatorEntryView.cpp +++ b/panel/PanelIndicatorEntryView.cpp @@ -98,29 +98,6 @@ void PanelIndicatorEntryView::OnActiveChanged(bool is_active) void PanelIndicatorEntryView::ShowMenu(int button) { - WindowManager& wm = WindowManager::Default(); - - if (wm.IsExpoActive()) - { - // Delay the activation until expo is closed - auto conn = std::make_shared<connection::Wrapper>(); - *conn = wm.terminate_expo.connect([this, conn, button] { - ShowMenu(button); - (*conn)->disconnect(); - }); - - wm.TerminateExpo(); - return; - } - - if (wm.IsScaleActive()) - { - if (type_ == MENU) - return; - - wm.TerminateScale(); - } - auto const& abs_geo = GetAbsoluteGeometry(); proxy_->ShowMenu(abs_geo.x, abs_geo.y + abs_geo.height, button); } @@ -142,8 +119,30 @@ void PanelIndicatorEntryView::OnMouseDown(int x, int y, long button_flags, long } else { - ShowMenu(button); - Refresh(); + WindowManager& wm = WindowManager::Default(); + + if (wm.IsExpoActive()) + { + // Delay the activation until expo is closed + auto conn = std::make_shared<connection::Wrapper>(); + *conn = wm.terminate_expo.connect([this, conn, button] { + Activate(button); + (*conn)->disconnect(); + }); + + wm.TerminateExpo(); + return; + } + + if (wm.IsScaleActive()) + { + if (type_ == MENU) + return; + + wm.TerminateScale(); + } + + Activate(button); } } } |
