aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Borges de Freitas <92enen@gmail.com>2023-02-11 14:11:41 +0000
committerMiguel Borges de Freitas <92enen@gmail.com>2023-02-21 11:23:37 +0000
commit70b7934e54eced039c946009f2da231abbb6c473 (patch)
treeb4fbd975296ae3daf1a98524177f7268f9963d50
parent4e7f3bcabef0fb9e143b6c87a9e424cb350cbdf2 (diff)
[macOS][windowing] Fix move event detection
-rw-r--r--xbmc/windowing/osx/OpenGL/OSXGLWindow.mm20
1 files changed, 9 insertions, 11 deletions
diff --git a/xbmc/windowing/osx/OpenGL/OSXGLWindow.mm b/xbmc/windowing/osx/OpenGL/OSXGLWindow.mm
index afe8738b60..c7028e7f8e 100644
--- a/xbmc/windowing/osx/OpenGL/OSXGLWindow.mm
+++ b/xbmc/windowing/osx/OpenGL/OSXGLWindow.mm
@@ -64,19 +64,17 @@
- (void)windowDidMove:(NSNotification*)aNotification
{
- NSOpenGLContext* context = NSOpenGLContext.currentContext;
- if (context)
+ if (self.contentView)
{
- if (context.view)
+ NSPoint window_origin = [self.contentView frame].origin;
+ XBMC_Event newEvent = {};
+ newEvent.type = XBMC_VIDEOMOVE;
+ newEvent.move.x = window_origin.x;
+ newEvent.move.y = window_origin.y;
+ std::shared_ptr<CAppInboundProtocol> appPort = CServiceBroker::GetAppPort();
+ if (appPort)
{
- NSPoint window_origin = [[[context view] window] frame].origin;
- XBMC_Event newEvent = {};
- newEvent.type = XBMC_VIDEOMOVE;
- newEvent.move.x = window_origin.x;
- newEvent.move.y = window_origin.y;
- std::shared_ptr<CAppInboundProtocol> appPort = CServiceBroker::GetAppPort();
- if (appPort)
- appPort->OnEvent(newEvent);
+ appPort->OnEvent(newEvent);
}
}
}