Merge lp:~ismise/unity/fix-864708 into lp:unity

Proposed by Jay Ó Broin
Status: Merged
Merge reported by: Neil J. Patel
Merged at revision: not available
Proposed branch: lp:~ismise/unity/fix-864708
Merge into: lp:unity
Diff against target: 44 lines (+16/-0)
2 files modified
plugins/unityshell/src/PanelMenuView.cpp (+15/-0)
plugins/unityshell/src/PanelMenuView.h (+1/-0)
To merge this branch: bzr merge lp:~ismise/unity/fix-864708
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+78861@code.launchpad.net

Description of the change

Bug fix: Add handler to raise maximized window on left-click on panel (LP: #864708)

To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) :
review: Approve
Revision history for this message
Neil J. Patel (njpatel) wrote :

Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/PanelMenuView.cpp'
2--- plugins/unityshell/src/PanelMenuView.cpp 2011-10-06 16:42:39 +0000
3+++ plugins/unityshell/src/PanelMenuView.cpp 2011-10-10 15:49:24 +0000
4@@ -119,6 +119,7 @@
5 _panel_titlebar_grab_area = new PanelTitlebarGrabArea();
6 _panel_titlebar_grab_area->SetParentObject(this);
7 _panel_titlebar_grab_area->SinkReference();
8+ _panel_titlebar_grab_area->mouse_down.connect(sigc::mem_fun(this, &PanelMenuView::OnMouseClicked));
9 _panel_titlebar_grab_area->mouse_down.connect(sigc::mem_fun(this, &PanelMenuView::OnMouseMiddleClicked));
10 _panel_titlebar_grab_area->mouse_down.connect(sigc::mem_fun(this, &PanelMenuView::OnMaximizedGrabStart));
11 _panel_titlebar_grab_area->mouse_drag.connect(sigc::mem_fun(this, &PanelMenuView::OnMaximizedGrabMove));
12@@ -1340,6 +1341,20 @@
13 }
14
15 void
16+PanelMenuView::OnMouseClicked(int x, int y, unsigned long button_flags, unsigned long)
17+{
18+ if (nux::GetEventButton(button_flags) != 1)
19+ return;
20+
21+ guint32 window_xid = GetMaximizedWindow();
22+
23+ if (window_xid != 0)
24+ {
25+ WindowManager::Default()->Raise(window_xid);
26+ }
27+}
28+
29+void
30 PanelMenuView::OnMouseMiddleClicked(int x, int y, unsigned long button_flags, unsigned long)
31 {
32 if (nux::GetEventButton(button_flags) != 2)
33
34=== modified file 'plugins/unityshell/src/PanelMenuView.h'
35--- plugins/unityshell/src/PanelMenuView.h 2011-10-01 06:15:51 +0000
36+++ plugins/unityshell/src/PanelMenuView.h 2011-10-10 15:49:24 +0000
37@@ -84,6 +84,7 @@
38 void OnMaximizedGrabMove(int, int, int, int, unsigned long, unsigned long);
39 void OnMaximizedGrabEnd(int, int, unsigned long, unsigned long);
40 void OnMouseDoubleClicked(int, int, unsigned long, unsigned long);
41+ void OnMouseClicked(int, int, unsigned long, unsigned long);
42 void OnMouseMiddleClicked(int, int, unsigned long, unsigned long);
43
44 void Refresh();