[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: Separate updating of pin indicator image visibility with notification handler

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Tue Jun 18 17:08:25 UTC 2024



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
713d1596 by Claudio Cambra at 2024-06-18T16:56:09+00:00
macosx: Separate updating of pin indicator image visibility with notification handler

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
54c32fc9 by Claudio Cambra at 2024-06-18T16:56:09+00:00
macosx: Update float on top indicator on view load

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


1 changed file:

- modules/gui/macosx/windows/video/VLCMainVideoViewController.m


Changes:

=====================================
modules/gui/macosx/windows/video/VLCMainVideoViewController.m
=====================================
@@ -172,6 +172,7 @@
 
     [self setupAudioDecorativeView];
     [self.controlsBar update];
+    [self updateFloatOnTopIndicator];
 }
 
 - (void)updateDecorativeViewVisibilityOnControllerChange:(VLCPlayerController *)controller
@@ -233,11 +234,24 @@
 {
     VLCVideoWindowCommon * const videoWindow = (VLCVideoWindowCommon *)notification.object;
     NSAssert(videoWindow != nil, @"Received video window should not be nil!");
-    NSDictionary<NSString *, NSNumber *> * const userInfo = notification.userInfo;
-    NSAssert(userInfo != nil, @"Received user info should not be nil!");
-    NSNumber * const enabledNumberWrapper = userInfo[VLCWindowFloatOnTopEnabledNotificationKey];
-    NSAssert(enabledNumberWrapper != nil, @"Received user info enabled wrapper should not be nil!");
-    self.floatOnTopIndicatorImageView.hidden = !enabledNumberWrapper.boolValue;
+    VLCVideoWindowCommon * const selfVideoWindow = (VLCVideoWindowCommon *)self.view.window;
+
+    if (videoWindow != selfVideoWindow) {
+        return;
+    }
+
+    [self updateFloatOnTopIndicator];
+}
+
+- (void)updateFloatOnTopIndicator
+{
+    vout_thread_t * const voutThread = self.voutView.voutThread;
+    if (voutThread == NULL) {
+        return;
+    }
+
+    const bool floatOnTopEnabled = var_GetBool(voutThread, "video-on-top");
+    self.floatOnTopIndicatorImageView.hidden = !floatOnTopEnabled;
 }
 
 - (BOOL)mouseOnControls



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/50aa68ea7e53420d008cc17131d7f8ef6be98fbd...54c32fc9eae608309d86c663eea8799deab1fde6

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/50aa68ea7e53420d008cc17131d7f8ef6be98fbd...54c32fc9eae608309d86c663eea8799deab1fde6
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list