macosx: Remove all internal PIP handling in video windows, just toggle float on top config value when pressing button

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
Claudio Cambra 2024-04-07 18:38:27 +08:00 committed by Steve Lhomme
parent 46b3cf0040
commit 57daae9801
5 changed files with 5 additions and 25 deletions

View File

@ -26,8 +26,6 @@ NS_ASSUME_NONNULL_BEGIN
@interface VLCFullVideoViewWindow : VLCVideoWindowCommon
@property (readwrite, nonatomic) BOOL pipModeEnabled;
- (void)stopTitlebarAutohideTimer;
- (void)startTitlebarAutohideTimer;
- (void)showTitleBar;

View File

@ -45,7 +45,6 @@
{
[super setup];
_autohideTitlebar = NO;
_pipModeEnabled = NO;
NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self
@ -59,22 +58,6 @@
self.acceptsMouseMovedEvents = YES;
}
- (void)setPipModeEnabled:(BOOL)pipModeEnabled
{
_pipModeEnabled = pipModeEnabled;
if (self.pipModeEnabled) {
self.level = NSMainMenuWindowLevel;
self.collectionBehavior = NSWindowCollectionBehaviorCanJoinAllSpaces |
NSWindowCollectionBehaviorIgnoresCycle |
NSWindowCollectionBehaviorTransient |
NSWindowCollectionBehaviorFullScreenAuxiliary;
[self hideTitleBar:self];
} else {
self.level = NSNormalWindowLevel;
self.collectionBehavior = NSWindowCollectionBehaviorDefault;
}
}
- (void)stopTitlebarAutohideTimer
{
[_hideTitlebarTimer invalidate];

View File

@ -50,7 +50,6 @@ NS_ASSUME_NONNULL_BEGIN
@property (readwrite, nonatomic) BOOL autohideControls;
@property (readwrite, nonatomic) BOOL displayLibraryControls;
@property (readwrite, nonatomic) BOOL pipModeEnabled;
@property (readonly) BOOL mouseOnControls;
- (void)showControls;

View File

@ -384,11 +384,11 @@
- (IBAction)togglePictureInPicture:(id)sender
{
VLCFullVideoViewWindow * const videoWindow = (VLCFullVideoViewWindow *)self.view.window;
if (videoWindow != nil) {
videoWindow.pipModeEnabled = !videoWindow.pipModeEnabled;
vout_thread_t * const p_vout = self.voutView.voutThread;
if (p_vout) {
var_ToggleBool(p_vout, "video-on-top");
vout_Release(p_vout);
}
self.pipModeEnabled = !self.pipModeEnabled;
}
@end

View File

@ -522,7 +522,7 @@ int WindowOpen(vlc_window_t *p_wnd)
if(i_level == NSStatusWindowLevel) {
_statusLevelWindowCounter++;
// window level need to stay on normal in fullscreen mode
if (![o_window fullscreen] && ![o_window inFullscreenTransition]) {
if (!o_window.fullscreen && !o_window.inFullscreenTransition) {
// make sure float on top can join all spaces, including full-screen ones
NSApp.activationPolicy = NSApplicationActivationPolicyAccessory;
[self updateWindowLevelForHelperWindows:i_level];