From fb7812fab0e014ddcd3745869699d1d2671187b7 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Mon, 23 Jul 2018 17:22:45 -0700 Subject: [PATCH] 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 --- src/kits/interface/Window.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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;