Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
0c248bd9 by Claudio Cambra at 2026-02-21T08:04:38+00:00
macosx: Prevent crash on clicking PiP button when using non-native full screen
mode
Signed-off-by: Claudio Cambra <[email protected]>
- - - - -
c8173f35 by Claudio Cambra at 2026-02-21T08:04:38+00:00
macosx: Leave non-native full screen when engaging PiP
Signed-off-by: Claudio Cambra <[email protected]>
- - - - -
2 changed files:
- modules/gui/macosx/windows/controlsbar/VLCMainVideoViewControlsBar.m
- modules/gui/macosx/windows/video/VLCMainVideoViewController.m
Changes:
=====================================
modules/gui/macosx/windows/controlsbar/VLCMainVideoViewControlsBar.m
=====================================
@@ -141,34 +141,29 @@
- (void)floatOnTopChanged:(NSNotification *)notification
{
- VLCVideoWindowCommon * const videoWindow = (VLCVideoWindowCommon
*)notification.object;
- NSAssert(videoWindow != nil, @"Received video window should not be nil!");
- VLCVideoWindowCommon * const selfVideoWindow =
- (VLCVideoWindowCommon *)self.floatOnTopButton.window;
-
- if (videoWindow != selfVideoWindow) {
- return;
- }
-
[self updateFloatOnTopButton];
}
-- (void)updateFloatOnTopButton
+- (vout_thread_t *)windowVoutThread
{
- VLCVideoWindowCommon * const videoWindow = (VLCVideoWindowCommon
*)self.floatOnTopButton.window;
- if (videoWindow == nil) {
- return;
+ NSWindow * const window = self.floatOnTopButton.window;
+ if ([window isKindOfClass:VLCVideoWindowCommon.class]) {
+ vout_thread_t * const p_vout =
+ ((VLCVideoWindowCommon
*)window).videoViewController.voutView.voutThread;
+ if (p_vout) return p_vout;
}
+ return _playerController.mainVideoOutputThread;
+}
- VLCVoutView * const voutView = videoWindow.videoViewController.voutView;
- NSAssert(voutView != nil, @"Vout view should not be nil!");
- vout_thread_t * const voutThread = voutView.voutThread;
-
+- (void)updateFloatOnTopButton
+{
+ vout_thread_t * const voutThread = [self windowVoutThread];
if (voutThread == NULL) {
return;
}
const bool floatOnTopEnabled = var_GetBool(voutThread, "video-on-top");
+ vout_Release(voutThread);
if (@available(macOS 10.14, *)) {
self.floatOnTopButton.contentTintColor =
@@ -259,11 +254,7 @@
- (IBAction)toggleFloatOnTop:(id)sender
{
- VLCVideoWindowCommon * const window = (VLCVideoWindowCommon
*)self.floatOnTopButton.window;
- if (window == nil) {
- return;
- }
- vout_thread_t * const p_vout =
window.videoViewController.voutView.voutThread;
+ vout_thread_t * const p_vout = [self windowVoutThread];
if (!p_vout) {
return;
}
=====================================
modules/gui/macosx/windows/video/VLCMainVideoViewController.m
=====================================
@@ -605,6 +605,12 @@ NSString * const VLCUseClassicVideoPlayerLayoutKey =
@"VLCUseClassicVideoPlayerL
return;
}
+ VLCVideoWindowCommon * const videoWindow =
+ [VLCMain.sharedInstance.voutProvider
videoWindowForVoutView:self.voutView];
+ if (videoWindow.fullscreen && !videoWindow.isInNativeFullscreen) {
+ [videoWindow leaveFullscreenWithAnimation:NO];
+ }
+
NSWindow * const window = self.view.window;
[window orderOut:window];
self.retainedWindow = window;
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/9504c30ea9e0bee6eb1ba1a5ff56ecd6b7e4d698...c8173f354bcfb097d8beaa135905b685ad9b027a
--
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/9504c30ea9e0bee6eb1ba1a5ff56ecd6b7e4d698...c8173f354bcfb097d8beaa135905b685ad9b027a
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits