summaryrefslogtreecommitdiff
diff options
authorChris Townsend <christopher.townsend@canonical.com>2014-02-08 00:47:48 +0000
committerTarmac <>2014-02-08 00:47:48 +0000
commitf6fb71e10c124fd4c62fd6eb4285a9f98c7a4ae7 (patch)
tree69746c215d520ba291e598b80cd46bb331196c62
parent94d59de81214bcd9ca487fd669b5e0f78cefa67c (diff)
parent29533fc75baae9b944f6c8a8ddadddb1596b0341 (diff)
Fixes some Autopilot Panel test failures:
* Emit the signal to call OnIndicatorViewUpdated() when the active window position has changed. * Account for an overlay (Dash/Hud) to be opened when testing if the window buttons should be shown in the Panel. This was removed some revisions ago and it looks like it shouldn't have been. * Fix up a Panel test since it was failing in a part that didn't need to be ran anyways. Fixes: https://bugs.launchpad.net/bugs/1277265. Approved by PS Jenkins bot, Brandon Schaefer. (bzr r3647)
-rw-r--r--panel/PanelIndicatorsView.cpp6
-rw-r--r--panel/PanelIndicatorsView.h2
-rw-r--r--panel/PanelMenuView.cpp3
-rw-r--r--panel/PanelView.cpp2
-rw-r--r--panel/PanelView.h2
-rw-r--r--tests/autopilot/unity/tests/test_panel.py3
6 files changed, 9 insertions, 9 deletions
diff --git a/panel/PanelIndicatorsView.cpp b/panel/PanelIndicatorsView.cpp
index 97ac92241..3d5cef935 100644
--- a/panel/PanelIndicatorsView.cpp
+++ b/panel/PanelIndicatorsView.cpp
@@ -296,7 +296,7 @@ void PanelIndicatorsView::AddEntryView(PanelIndicatorEntryView* view, IndicatorE
{
view->refreshed.connect(sigc::mem_fun(this, &PanelIndicatorsView::OnEntryRefreshed));
entries_.insert({entry_id, view});
- on_indicator_updated.emit(view);
+ on_indicator_updated.emit();
entry_added.emit(view);
}
}
@@ -318,7 +318,7 @@ void PanelIndicatorsView::OnEntryRefreshed(PanelIndicatorEntryView* view)
{
QueueRelayout();
QueueDraw();
- on_indicator_updated.emit(view);
+ on_indicator_updated.emit();
}
void PanelIndicatorsView::RemoveEntryView(PanelIndicatorEntryView* view)
@@ -334,7 +334,7 @@ void PanelIndicatorsView::RemoveEntryView(PanelIndicatorEntryView* view)
RemoveChild(view);
entries_.erase(view->GetEntryID());
layout_->RemoveChildObject(view);
- on_indicator_updated.emit(view);
+ on_indicator_updated.emit();
QueueRelayout();
QueueDraw();
diff --git a/panel/PanelIndicatorsView.h b/panel/PanelIndicatorsView.h
index 8067a02d9..cdcdd889f 100644
--- a/panel/PanelIndicatorsView.h
+++ b/panel/PanelIndicatorsView.h
@@ -71,7 +71,7 @@ public:
nux::Property<double> opacity;
- sigc::signal<void, PanelIndicatorEntryView*> on_indicator_updated;
+ sigc::signal<void> on_indicator_updated;
sigc::signal<void, PanelIndicatorEntryView*> entry_added;
sigc::signal<void, PanelIndicatorEntryView*> entry_removed;
diff --git a/panel/PanelMenuView.cpp b/panel/PanelMenuView.cpp
index ae3b29032..940cdd985 100644
--- a/panel/PanelMenuView.cpp
+++ b/panel/PanelMenuView.cpp
@@ -1114,6 +1114,9 @@ bool PanelMenuView::UpdateActiveWindowPosition()
{
we_control_active_ = we_control_window;
+ if (!entries_.empty())
+ on_indicator_updated.emit();
+
if (Refresh())
QueueDraw();
}
diff --git a/panel/PanelView.cpp b/panel/PanelView.cpp
index 1ac209ad3..666e5e54a 100644
--- a/panel/PanelView.cpp
+++ b/panel/PanelView.cpp
@@ -562,7 +562,7 @@ void PanelView::OnObjectRemoved(indicator::Indicator::Ptr const& proxy)
QueueDraw();
}
-void PanelView::OnIndicatorViewUpdated(PanelIndicatorEntryView* view)
+void PanelView::OnIndicatorViewUpdated()
{
needs_geo_sync_ = true;
QueueRelayout();
diff --git a/panel/PanelView.h b/panel/PanelView.h
index c2888fe66..3fe479367 100644
--- a/panel/PanelView.h
+++ b/panel/PanelView.h
@@ -91,7 +91,7 @@ protected:
void OnObjectAdded(indicator::Indicator::Ptr const& proxy);
void OnObjectRemoved(indicator::Indicator::Ptr const& proxy);
- void OnIndicatorViewUpdated(PanelIndicatorEntryView* view);
+ void OnIndicatorViewUpdated();
void OnMenuPointerMoved(int x, int y);
void OnEntryActivateRequest(std::string const& entry_id);
void OnEntryActivated(std::string const& entry_id, nux::Rect const& geo);
diff --git a/tests/autopilot/unity/tests/test_panel.py b/tests/autopilot/unity/tests/test_panel.py
index 67eaac70f..d9472bc42 100644
--- a/tests/autopilot/unity/tests/test_panel.py
+++ b/tests/autopilot/unity/tests/test_panel.py
@@ -1030,9 +1030,6 @@ class PanelKeyNavigationTests(PanelTestsBase):
expected_indicator = self.panel.get_indicator_entries(include_hidden_menus=True)[0]
self.assertThat(open_indicator.entry_id, Eventually(Equals(expected_indicator.entry_id)))
- self.keybinding("panel/open_first_menu")
- self.assertThat(self.panel.get_active_indicator, Eventually(Equals(None)))
-
def test_panel_menu_accelerators_work(self):
"""Pressing a valid menu accelerator must open the correct menu item."""
self.open_new_application_window("Text Editor")