Skip to content
Snippets Groups Projects
Commit fd6fa7ac authored by Felix Paul Kühne's avatar Felix Paul Kühne Committed by Steve Lhomme
Browse files

iosvlc: add support for visionOS

This enables the pinch gesture and solves a problem with UIScreen being
unavailable on this platform
parent c27a4b9d
No related branches found
No related tags found
1 merge request!5507iosvlc: add support for visionOS
Pipeline #476864 passed with warnings with stage
in 11 minutes and 47 seconds
......@@ -449,6 +449,10 @@ if HAVE_TVOS
noinst_PROGRAMS += vlccoreios
endif
if HAVE_XROS
noinst_PROGRAMS += vlccoreios
endif
vlc_window_SOURCES = vlc-window.c
vlc_window_CPPFLAGS = $(AM_CPPFLAGS) -I../include/
vlc_window_LDADD = ../lib/libvlc.la ../src/libvlccore.la ../compat/libcompat.la
......
......@@ -46,7 +46,7 @@
UIWindow *window;
UIView *subview;
#if TARGET_OS_IOS
#if !TARGET_OS_TV
UIPinchGestureRecognizer *_pinchRecognizer;
#endif
......@@ -58,7 +58,7 @@
@implementation AppDelegate
#if TARGET_OS_IOS
#if !TARGET_OS_TV
- (void)pinchRecognized:(UIPinchGestureRecognizer *)pinchRecognizer
{
UIGestureRecognizerState state = [pinchRecognizer state];
......@@ -113,7 +113,12 @@
return NO;
/* Initialize main window */
#if TARGET_OS_VISION
/* UIScreen is unavailable so we need create a size on our own */
window = [[UIWindow alloc] initWithFrame:CGRectMake(0., 0., 1200., 800.)];
#else
window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
#endif
window.rootViewController = [[UIViewController alloc] init];
window.backgroundColor = [UIColor whiteColor];
......@@ -122,7 +127,7 @@
[window addSubview:subview];
[window makeKeyAndVisible];
#if TARGET_OS_IOS
#if !TARGET_OS_TV
_pinchRecognizer = [[UIPinchGestureRecognizer alloc]
initWithTarget:self action:@selector(pinchRecognized:)];
[window addGestureRecognizer:_pinchRecognizer];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment