[vlc-commits] [Git][videolan/vlc][master] 2 commits: vout apple : Add tapRecognizer to the view only if not nil
Hugo Beauzée-Luyssen (@chouquette)
gitlab at videolan.org
Fri Jul 8 12:48:06 UTC 2022
Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC
Commits:
702b317c by Maxime Chapelet at 2022-07-08T12:30:10+00:00
vout apple : Add tapRecognizer to the view only if not nil
- - - - -
329cc5b9 by Maxime Chapelet at 2022-07-08T12:30:10+00:00
vout apple : use the mouse-events var to activate tap gestures driven mouse events
- - - - -
1 changed file:
- modules/video_output/apple/VLCVideoUIView.m
Changes:
=====================================
modules/video_output/apple/VLCVideoUIView.m
=====================================
@@ -120,8 +120,10 @@
return nil;
/* add tap gesture recognizer for DVD menus and stuff */
- _tapRecognizer = [[UITapGestureRecognizer alloc]
- initWithTarget:self action:@selector(tapRecognized:)];
+ if (var_InheritBool( wnd, "mouse-events" ) == true) {
+ _tapRecognizer = [[UITapGestureRecognizer alloc]
+ initWithTarget:self action:@selector(tapRecognized:)];
+ }
CGSize size = _viewContainer.bounds.size;
[self reportEvent:^{
@@ -276,8 +278,15 @@
assert(_subviews == 0);
_enabled = YES;
- /* Bind tapRecognizer. */
- [self addGestureRecognizer:_tapRecognizer];
+ /**
+ * Given -[UIView addGestureRecognizer:] can raise an exception if
+ * tapRecognizer is nil and given tapRecognizer can be nil if
+ * "mouse-events" var == false, then add tapRecognizer to the view only if
+ * it's not nil
+ */
+ if (_tapRecognizer != nil) {
+ [self addGestureRecognizer:_tapRecognizer];
+ }
_tapRecognizer.cancelsTouchesInView = NO;
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ea8ffe90af43501ce17ce582f4894cd0cb6edebb...329cc5b9eddd3cf5cac7c5711a2a24b707422142
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ea8ffe90af43501ce17ce582f4894cd0cb6edebb...329cc5b9eddd3cf5cac7c5711a2a24b707422142
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