diff options
author | Patrick Luby <guibmacdev@gmail.com> | 2024-12-14 19:38:03 -0500 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2024-12-19 23:19:00 +0100 |
commit | 1d524110b1863d448254529bd8911e061dac2eb0 (patch) | |
tree | 98b51e32b970fd9bcd87e043298b2213e2dab0d5 /ucb/test/com/sun/star | |
parent | 6966db05a83dc1e7ca2768d811776fcace50ecc3 (diff) |
tdf#161623 Handle windows that macOS forces to native full screen mode
Starting with commit c1452e73091412ba0bb72306329e1912df2ba513, native
full screen was disabled. However, in certain cases, macOS will force
a window into native full screen mode and this caused numerous bugs.
So add the following fixes to support native full screen windows. Note:
the green titlebar button will still zoom the window. That button will
only escape native full screen mode only when macOS has already forced
a window into native full screen mode:
- When in native full screen mode, -[NSWindow styleMask] will include
NSWindowStyleMaskFullScreen which can affect the frame and content
rectangle calculations so always use -[NSWindow styleMask] instead
of the mask that was used to create the window when doing such
calculations.
- A comment in commit c1452e73091412ba0bb72306329e1912df2ba513 mentions
crashing after ordering out a native full screen window. I have not
experienced any crashing, but I did find that ordering out would
leave the application in a state where there is no Desktop and both
the menubar and the Dock are hidden. The fix, which is to close
windows instead of ordering them out, was copied from the following
NeoOffice source code file which is licensed under the Mozilla Public
License, v. 2.0:
https://github.com/neooffice/NeoOffice/blob/NeoOffice-2022_7/vcl/java/source/window/salframe.mm
- In AquaSalFrame::GetWindowState(), add both the original and the
curent frame when the window is in LibreOffice and/or native full
screen mode.
- Track LibreOffice and native full screen state in separate instance
variables so that both modes can be activated independently and the
window is not set back to its original size unitl a window has exited
both full screen modes.
LibreOffice also has its own full screen mode which hides the menubar
and Dock, resizes to fill the screen, and hides all of its toolbars.
As much as possible, both full screen modes should coexist and the
user can enter or exit LibreOffice full screen mode while in native
full screen mode. So add the following fixes for LibreOffice full
screen mode:
- Do not add the window's titlebar height to the window's frame as
that will cause the titlebar to be pushed offscreen.
- The menubar and Dock are both hidden when a window enters LibreOffice
full screen mode. However, -[NSWindow setFrame:display:] shrinks the
window frame to allow room for the menubar if the window is on the
main screen. So, force the return value to match the frame that
LibreOffice expects.
- Multiple windows can be in LibreOffice full screen mode at the
same time so hide or show the menubar and Dock when a LibreOffice
full screen window gains or loses focus.
- When a window is in LibreOffice full screen mode, LibreOffice hides
the menubar. However, when in native full screen mode, hiding the
menubar causes the window's titlebar to either fail to display or
fail to hide when expected. So allow the menubar to remain visible
when a window is in both LibreOffice and native full screen mode
and disable all LibreOffice menus (like is done when a modal windowj
is displayed) to mimic the effect of hiding the menubar.
Note: this change is a combination of the following commits:
- Commit 13bdc2ba0cec0cb1c9e8077eb2217f69822a805f
- Commit 05b508f9f1397249079842dca86c36cbca01b43d
- Commit 2120acaa261aaa1adaafc051582ac7f7dd4de372
Change-Id: I94ae24a03d192a681d5500930f7fec70e595ffaf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178497
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Tested-by: Jenkins
(cherry picked from commit 13bdc2ba0cec0cb1c9e8077eb2217f69822a805f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178820
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'ucb/test/com/sun/star')
0 files changed, 0 insertions, 0 deletions