Merge lp:~3v1n0/unity/panel-restore-button-partially-unmaximize into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 4190
Proposed branch: lp:~3v1n0/unity/panel-restore-button-partially-unmaximize
Merge into: lp:unity
Diff against target: 28 lines (+14/-1)
1 file modified
unity-shared/WindowButtons.cpp (+14/-1)
To merge this branch: bzr merge lp:~3v1n0/unity/panel-restore-button-partially-unmaximize
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
Review via email: mp+303707@code.launchpad.net

Commit message

WindowButton: properly partially unmaximize a window when middle/left clicking in the restore button

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'unity-shared/WindowButtons.cpp'
2--- unity-shared/WindowButtons.cpp 2016-03-07 18:37:24 +0000
3+++ unity-shared/WindowButtons.cpp 2016-08-24 11:27:24 +0000
4@@ -420,10 +420,23 @@
5 {
6 WindowManager& wm = WindowManager::Default();
7 Window to_restore = controlled_window();
8+ int button = nux::GetGraphicsDisplay()->GetCurrentEvent().GetEventButton();
9
10 wm.Raise(to_restore);
11 wm.Activate(to_restore);
12- wm.Restore(to_restore);
13+
14+ if (button == nux::NUX_MOUSE_BUTTON1)
15+ {
16+ wm.Restore(to_restore);
17+ }
18+ else if (button == nux::NUX_MOUSE_BUTTON2)
19+ {
20+ wm.VerticallyMaximize(to_restore);
21+ }
22+ else if (button == nux::NUX_MOUSE_BUTTON3)
23+ {
24+ wm.HorizontallyMaximize(to_restore);
25+ }
26 }
27
28 restore_clicked.emit();