diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-05-30 11:37:19 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-05-30 13:50:15 +0200 |
commit | c1452e73091412ba0bb72306329e1912df2ba513 (patch) | |
tree | e37191be44f42cdd46c6e0cd39d14a4ebb7468b6 /vcl/osx/salframeview.mm | |
parent | 3cce079c9307315f18b6f49f1de58f52e956e0d6 (diff) |
tdf#117872: Revert "tdf#115284: Unify LibreOffice and system full-screen..."
Instead, never participate in the macOS system full-screen mode. There
is just too much complexity involved, and the way LibreOffice works
really isn't prepared for the concept of windows having the option
from a system point of view to being full-screenable or not.
This means that the green bubble in window title bars changes from
being a (system) full-screen toggle to being a maximize/restore
toggle. Sure, the "maximize" concept also probably can be confused
with LibreOffice's own full-screen concept.
For instance, the Start Centre window is not expecting to be made
full-screen. Still, when you from the Start Centre open a Writer
document, it is the *same* window that is re-used as the Writer
window, and then suddenly should be prepared to handle going
full-screen.
Also, it is up to each separate kind of document window whether it can
be made full-screen (from the LibreOffice point of view) or not.
Writer windows can, but Impress windows can't, for example. The
View>Full Screen menu entry is added separately each case.
Maybe I will come back to this mess later, or not. Anybody else is
welcome to have a go, too, of course.
This reverts commit 4b42fd7e9516fbbd8a92d97680524f32dd260fb2.
Change-Id: I6983481cbd30c0e5190c450483b1246006c80632
Reviewed-on: https://gerrit.libreoffice.org/55049
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'vcl/osx/salframeview.mm')
-rw-r--r-- | vcl/osx/salframeview.mm | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index 7b670f835695..769170f206b5 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -19,7 +19,6 @@ #include <sal/config.h> -#include <comphelper/dispatchcommand.hxx> #include <sal/macros.h> #include <tools/helpers.hxx> @@ -178,12 +177,25 @@ static AquaSalFrame* getMouseContainerFrame() [pNSWindow useOptimizedDrawing: YES]; // OSX recommendation when there are no overlapping subviews within the receiver #endif - // Enable fullscreen options if available and useful - bool bAllowFullScreen = (SalFrameStyleFlags::NONE == (mpFrame->mnStyle & (SalFrameStyleFlags::DIALOG | SalFrameStyleFlags::TOOLTIP | SalFrameStyleFlags::SYSTEMCHILD | SalFrameStyleFlags::FLOAT | SalFrameStyleFlags::TOOLWINDOW | SalFrameStyleFlags::INTRO))); - bAllowFullScreen &= (SalFrameStyleFlags::NONE == (~mpFrame->mnStyle & SalFrameStyleFlags::SIZEABLE)); - bAllowFullScreen &= (mpFrame->mpParent == nullptr); + // Disallow full-screen mode on macOS >= 10.11 where it is enabled by default. We don't want it + // for now as it will just be confused with LibreOffice's home-grown full-screen concept, with + // which it has nothing to do, and one can get into all kinds of weird states by using them + // intermixedly. - [pNSWindow setCollectionBehavior: (bAllowFullScreen ? NSWindowCollectionBehaviorFullScreenPrimary : NSWindowCollectionBehaviorFullScreenAuxiliary)]; + // Ideally we should use the system full-screen mode and adapt the code for the home-grown thing + // to be in sync with that instead. (And we would then not need the button to get out of + // full-screen mode, as the normal way to get out of it is to either click on the green bubble + // again, or invoke the keyboard command again.) + + // (Confusingly, at the moment the home-grown full-screen mode is bound to Cmd+Shift+F, which is + // the keyboard command normally used in apps to get in and out of the system full-screen mode.) + + // Disabling system full-screen mode makes the green button on the title bar (on macOS >= 10.11) + // show a plus sign instead, and clicking it becomes identical to double-clicking the title bar, + // i.e. it maximizes / unmaximises the window. Sure, that state can also be confused with LO's + // home-grown full-screen mode. Oh well. + + [pNSWindow setCollectionBehavior: NSWindowCollectionBehaviorFullScreenNone]; // Disable window restoration until we support it directly [pNSWindow setRestorable: NO]; @@ -361,10 +373,7 @@ static AquaSalFrame* getMouseContainerFrame() if( !mpFrame || !AquaSalFrame::isAlive( mpFrame)) return; - - if ( !mpFrame->mbFullScreen ) - comphelper::dispatchCommand( ".uno:FullScreen", {} ); - + mpFrame->mbFullScreen = true; (void)pNotification; } @@ -374,10 +383,7 @@ static AquaSalFrame* getMouseContainerFrame() if( !mpFrame || !AquaSalFrame::isAlive( mpFrame)) return; - - if ( mpFrame->mbFullScreen ) - comphelper::dispatchCommand( ".uno:FullScreen", {} ); - + mpFrame->mbFullScreen = false; (void)pNotification; } |