hrev52136 adds 1 changeset to branch 'master'
old head: 0fe68ab92c3ff16cb0e34987c82b1a8871e4117c
new head: fb7812fab0e014ddcd3745869699d1d2671187b7
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=fb7812fab0e0+%5E0fe68ab92c3f
----------------------------------------------------------------------------
fb7812fab0e0: BWindow: default Zoom() maximizes window when shift held down
In hrev51623 the default BWindow::Zoom() method was changed to respect
Deskbar, that is to say that the Window will zoom to screen area minus
the area taken up by Deskbar.
Some have complained that they miss the old maximize to full screen
frame behavior. This commit updates the default BWindow::Zoom() method
so that pressing Shift+zoom will maximize the window ignoring Deskbar,
the window will resize itself to take up the entire screen frame.
Note that if you override Zoom() in your app window then shift+zoom
will no longer work, this trick only works for apps which use the
default BWindow::Zoom() method.
Change-Id: Ic9f8fcb54f58663663db737103f6a7b42171ef46
[ John Scipione <jscipione@xxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev52136
Commit: fb7812fab0e014ddcd3745869699d1d2671187b7
URL: https://git.haiku-os.org/haiku/commit/?id=fb7812fab0e0
Author: John Scipione <jscipione@xxxxxxxxx>
Date: Tue Jul 24 00:22:45 2018 UTC
Committer: waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Wed Jul 25 02:33:30 2018 UTC
----------------------------------------------------------------------------
1 file changed, 3 insertions(+), 2 deletions(-)
src/kits/interface/Window.cpp | 5 +++--
----------------------------------------------------------------------------
diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp
index 81a0e60d8e..32dc5b4edb 100644
--- a/src/kits/interface/Window.cpp
+++ b/src/kits/interface/Window.cpp
@@ -1705,8 +1705,9 @@ BWindow::Zoom()
BDeskbar deskbar;
BRect deskbarFrame = deskbar.Frame();
- if (!deskbar.IsAutoHide()) {
- // remove area taken up by Deskbar (if not auto-hidden)
+ bool isShiftDown = (modifiers() & B_SHIFT_KEY) != 0;
+ if (!isShiftDown && !deskbar.IsAutoHide()) {
+ // remove area taken up by Deskbar unless hidden or shift is
held down
switch (deskbar.Location()) {
case B_DESKBAR_TOP:
zoomArea.top = deskbarFrame.bottom + 2;