[vlc-commits] [Git][videolan/vlc][master] 5 commits: macosx: Only track video view rect for mouse moved in library window
Steve Lhomme (@robUx4)
gitlab at videolan.org
Mon Feb 27 15:17:48 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
1cd9e6f3 by Claudio Cambra at 2023-02-27T15:05:32+00:00
macosx: Only track video view rect for mouse moved in library window
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
12f34b7e by Claudio Cambra at 2023-02-27T15:05:32+00:00
macosx: Don't hide video controls if mouse is hovering on them
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
8dc1e02b by Claudio Cambra at 2023-02-27T15:05:32+00:00
macosx: Expose if mouse is hovering controls as a property on VLCMainVideoViewController
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
34b7ffe1 by Claudio Cambra at 2023-02-27T15:05:32+00:00
macosx: Fix flickering of titlebar on VLCFullVideoViewWindow
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
4f02040a by Claudio Cambra at 2023-02-27T15:05:32+00:00
macosx: Don't hide controls if video is paused
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
5 changed files:
- modules/gui/macosx/UI/VLCMainVideoView.xib
- modules/gui/macosx/library/VLCLibraryWindow.m
- modules/gui/macosx/windows/video/VLCFullVideoViewWindow.m
- modules/gui/macosx/windows/video/VLCMainVideoViewController.h
- modules/gui/macosx/windows/video/VLCMainVideoViewController.m
Changes:
=====================================
modules/gui/macosx/UI/VLCMainVideoView.xib
=====================================
@@ -9,6 +9,7 @@
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="VLCMainVideoViewController">
<connections>
+ <outlet property="centralControlsStackView" destination="CvV-yX-Nbh" id="zyI-Rb-bem"/>
<outlet property="controlsBar" destination="3" id="Mfq-2w-2uR"/>
<outlet property="mainControlsView" destination="D4V-Zd-qvB" id="KwM-ya-ETn"/>
<outlet property="playlistButton" destination="Drq-if-dw4" id="BZe-Cr-mzZ"/>
=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -856,9 +856,10 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
{
if (!self.videoViewController.view.hidden) {
NSPoint mouseLocation = [o_event locationInWindow];
- NSRect windowRectWithFrame = [self frameRectForContentRect:self.contentView.frame];
+ NSView *videoView = self.videoViewController.view;
+ NSRect videoViewRect = [videoView convertRect:videoView.frame toView:self.contentView];
- if ([self.contentView mouse:mouseLocation inRect:windowRectWithFrame]) {
+ if ([self.contentView mouse:mouseLocation inRect:videoViewRect]) {
[[NSNotificationCenter defaultCenter] postNotificationName:VLCVideoWindowShouldShowFullscreenController
object:self];
}
=====================================
modules/gui/macosx/windows/video/VLCFullVideoViewWindow.m
=====================================
@@ -22,8 +22,13 @@
#import "VLCFullVideoViewWindow.h"
+#import "VLCMainVideoViewController.h"
+
#import "main/VLCMain.h"
+#import "playlist/VLCPlaylistController.h"
+#import "playlist/VLCPlayerController.h"
+
@interface VLCFullVideoViewWindow ()
{
BOOL _autohideTitlebar;
@@ -88,6 +93,13 @@
- (void)hideTitleBar:(id)sender
{
[self stopTitlebarAutohideTimer];
+
+ if (self.videoViewController.mouseOnControls ||
+ VLCMain.sharedInstance.playlistController.playerController.playerState == VLC_PLAYER_STATE_PAUSED) {
+ [self showTitleBar];
+ return;
+ }
+
[self standardWindowButton:NSWindowCloseButton].superview.hidden = YES;
}
=====================================
modules/gui/macosx/windows/video/VLCMainVideoViewController.h
=====================================
@@ -31,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (readwrite, strong) IBOutlet VLCVoutView *voutView;
@property (readwrite, strong) IBOutlet NSBox *mainControlsView;
+ at property (readwrite, strong) IBOutlet NSStackView *centralControlsStackView;
@property (readwrite, strong) IBOutlet VLCControlsBarCommon *controlsBar;
@property (readwrite, strong) IBOutlet NSButton *returnButton;
@property (readwrite, strong) IBOutlet NSButton *playlistButton;
@@ -39,6 +40,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (readwrite, nonatomic) BOOL autohideControls;
@property (readwrite, nonatomic) BOOL displayLibraryControls;
+ at property (readonly) BOOL mouseOnControls;
- (void)showControls;
=====================================
modules/gui/macosx/windows/video/VLCMainVideoViewController.m
=====================================
@@ -27,6 +27,9 @@
#import "main/VLCMain.h"
+#import "playlist/VLCPlaylistController.h"
+#import "playlist/VLCPlayerController.h"
+
#import "views/VLCBottomBarView.h"
#import "windows/video/VLCVideoWindowCommon.h"
@@ -63,6 +66,16 @@
object:nil];
}
+- (BOOL)mouseOnControls
+{
+ NSPoint mousePos = [self.view.window mouseLocationOutsideOfEventStream];
+
+ return [_centralControlsStackView mouse:mousePos inRect:_centralControlsStackView.frame] ||
+ [_controlsBar.bottomBarView mouse:mousePos inRect: _controlsBar.bottomBarView.frame] ||
+ [_returnButton mouse:mousePos inRect: _returnButton.frame] ||
+ [_playlistButton mouse:mousePos inRect: _playlistButton.frame];
+}
+
- (void)stopAutohideTimer
{
[_hideControlsTimer invalidate];
@@ -88,6 +101,15 @@
- (void)hideControls:(id)sender
{
[self stopAutohideTimer];
+
+ NSPoint mousePos = [self.view.window mouseLocationOutsideOfEventStream];
+
+ if ([self mouseOnControls] ||
+ VLCMain.sharedInstance.playlistController.playerController.playerState == VLC_PLAYER_STATE_PAUSED) {
+ [self showControls];
+ return;
+ }
+
_mainControlsView.hidden = YES;
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e1ddf339c14982c75e9344cca23c10f8f099e56b...4f02040acee747d5df7fb98b4ec89c1c541539f8
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e1ddf339c14982c75e9344cca23c10f8f099e56b...4f02040acee747d5df7fb98b4ec89c1c541539f8
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