[vlc-commits] macosx: fs panel: Ensure fs panel always stays inside the vout rect
David Fuhrmann
git at videolan.org
Wed Jan 15 21:55:09 CET 2020
vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Wed Jan 15 21:43:14 2020 +0100| [f7855c3327d9a68fab8de125657b852ff7e9ceb2] | committer: David Fuhrmann
macosx: fs panel: Ensure fs panel always stays inside the vout rect
In very rare cases, it was possible to move the fs panel to another
monitor, and it was not recentered once fullscreen was started
on a different monitor again. This led to the fullscreen window
and the fs panel being shown on different screens.
To trigger the bug, the user needed to move a native fullscreen window
to another monitor using Expose, which was undetected by VLC and thus
invalidated the internal state.
This commit adds a second check to detect this case and also
ensure recentering of the panel here.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f7855c3327d9a68fab8de125657b852ff7e9ceb2
---
modules/gui/macosx/windows/video/VLCFSPanelController.m | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules/gui/macosx/windows/video/VLCFSPanelController.m b/modules/gui/macosx/windows/video/VLCFSPanelController.m
index 28d0a6f249..4a433ef6df 100644
--- a/modules/gui/macosx/windows/video/VLCFSPanelController.m
+++ b/modules/gui/macosx/windows/video/VLCFSPanelController.m
@@ -461,7 +461,14 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
_associatedVoutWindow = voutWindow;
NSRect voutRect = voutWindow.frame;
- if (!NSEqualRects(_associatedVoutFrame, voutRect)) {
+
+ // In some cases, the FSPanel frame has moved outside of the
+ // vout view --> Also re-center in this case
+ NSRect currentFrame = [self.window frame];
+ NSRect constrainedFrame = [self contrainFrameToAssociatedVoutWindow: currentFrame];
+
+ if (!NSEqualRects(_associatedVoutFrame, voutRect) ||
+ !NSEqualRects(currentFrame, constrainedFrame)) {
_associatedVoutFrame = voutRect;
[[NSUserDefaults standardUserDefaults] setObject:NSStringFromRect(_associatedVoutFrame) forKey:kAssociatedFullscreenRect];
More information about the vlc-commits
mailing list