diff options
| author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2016-09-01 23:57:49 +0000 | 
|---|---|---|
| committer | Bileto Bot <ci-train-bot@canonical.com> | 2016-09-01 23:57:49 +0000 | 
| commit | fee779111435e7cfda848142092623d3d8bd50ca (patch) | |
| tree | b6bfb889201322779c35a751db1cb7db50f89f22 /unity-shared | |
| parent | 6d9df9a3dfd7eed6ded4dabd42c1ccee797276b0 (diff) | |
| parent | 6c1211e515b363c204ffbf13bd9427db3a9a50fb (diff) | |
WindowButton: properly partially unmaximize a window when middle/left clicking in the restore button (LP: #1616136)
Approved by: Andrea Azzarone (bzr r4190)
Diffstat (limited to 'unity-shared')
| -rw-r--r-- | unity-shared/WindowButtons.cpp | 15 | 
1 files changed, 14 insertions, 1 deletions
| diff --git a/unity-shared/WindowButtons.cpp b/unity-shared/WindowButtons.cpp index af2bf512e..bd88aaf1d 100644 --- a/unity-shared/WindowButtons.cpp +++ b/unity-shared/WindowButtons.cpp @@ -420,10 +420,23 @@ void WindowButtons::OnRestoreClicked(nux::Button *button)  {  WindowManager& wm = WindowManager::Default();  Window to_restore = controlled_window(); + int button = nux::GetGraphicsDisplay()->GetCurrentEvent().GetEventButton();  wm.Raise(to_restore);  wm.Activate(to_restore); - wm.Restore(to_restore); + + if (button == nux::NUX_MOUSE_BUTTON1) + { + wm.Restore(to_restore); + } + else if (button == nux::NUX_MOUSE_BUTTON2) + { + wm.VerticallyMaximize(to_restore); + } + else if (button == nux::NUX_MOUSE_BUTTON3) + { + wm.HorizontallyMaximize(to_restore); + }  }  restore_clicked.emit(); | 
