Merge lp:~3v1n0/unity/maximized-mapped-window-title-fix into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Stephen M. Webb
Approved revision: no longer in the source branch.
Merged at revision: 3990
Proposed branch: lp:~3v1n0/unity/maximized-mapped-window-title-fix
Merge into: lp:unity
Diff against target: 44 lines (+16/-0)
2 files modified
panel/PanelMenuView.cpp (+15/-0)
panel/PanelMenuView.h (+1/-0)
To merge this branch: bzr merge lp:~3v1n0/unity/maximized-mapped-window-title-fix
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+264051@code.launchpad.net

Commit message

PanelMenuView: ensure that we connect to window signals as soon as the AppManager knows it

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
Stephen M. Webb (bregma) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'panel/PanelMenuView.cpp'
2--- panel/PanelMenuView.cpp 2015-04-20 18:42:25 +0000
3+++ panel/PanelMenuView.cpp 2015-07-07 16:21:39 +0000
4@@ -146,6 +146,8 @@
5 am.active_application_changed.connect(sigc::mem_fun(this, &PanelMenuView::OnActiveAppChanged));
6 am.application_started.connect(sigc::mem_fun(this, &PanelMenuView::OnApplicationStarted));
7 am.application_stopped.connect(sigc::mem_fun(this, &PanelMenuView::OnApplicationClosed));
8+ am.window_opened.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowOpened));
9+ am.window_closed.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowClosed));
10
11 mouse_enter.connect(sigc::mem_fun(this, &PanelMenuView::OnPanelViewMouseEnter));
12 mouse_leave.connect(sigc::mem_fun(this, &PanelMenuView::OnPanelViewMouseLeave));
13@@ -1028,6 +1030,19 @@
14 }
15 }
16
17+void PanelMenuView::OnWindowOpened(ApplicationWindowPtr const& win)
18+{
19+ if (win->window_id() == window_buttons_->controlled_window() &&
20+ win->title.changed.empty())
21+ {
22+ /* This is a not so nice workaround that we need to include here, since
23+ * BAMF might be late in informing us about a new window, and thus we
24+ * can't connect to it's signals (as not available in the App Manager). */
25+ window_buttons_->controlled_window = 0;
26+ UpdateTargetWindowItems();
27+ }
28+}
29+
30 void PanelMenuView::OnWindowClosed(ApplicationWindowPtr const& win)
31 {
32 /* FIXME, this can be removed when window_unmapped WindowManager signal
33
34=== modified file 'panel/PanelMenuView.h'
35--- panel/PanelMenuView.h 2015-04-20 17:58:31 +0000
36+++ panel/PanelMenuView.h 2015-07-07 16:21:39 +0000
37@@ -89,6 +89,7 @@
38 void OnEntryViewAdded(PanelIndicatorEntryView* view);
39 void OnApplicationStarted(ApplicationPtr const&);
40 void OnApplicationClosed(ApplicationPtr const&);
41+ void OnWindowOpened(ApplicationWindowPtr const&);
42 void OnWindowClosed(ApplicationWindowPtr const&);
43 void OnActiveWindowChanged(ApplicationWindowPtr const&);
44 void OnActiveAppChanged(ApplicationPtr const&);