aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Borges de Freitas <92enen@gmail.com>2023-02-13 10:48:39 +0000
committerMiguel Borges de Freitas <92enen@gmail.com>2023-02-21 11:23:37 +0000
commite0cb6ad8bc5825f512a68cddf202250974372a05 (patch)
tree028149e47ab5257ebd35a9293840a2703df8f062
parent8f5ae0848ce97ad0ee7fb7a3c41224f1f5100085 (diff)
[macos][nativewindowing] fix: frame and window must only be accessed from the main thread
-rw-r--r--xbmc/windowing/osx/WinSystemOSX.mm10
1 files changed, 6 insertions, 4 deletions
diff --git a/xbmc/windowing/osx/WinSystemOSX.mm b/xbmc/windowing/osx/WinSystemOSX.mm
index 6c5cb05a32..ba2e327cd2 100644
--- a/xbmc/windowing/osx/WinSystemOSX.mm
+++ b/xbmc/windowing/osx/WinSystemOSX.mm
@@ -1244,10 +1244,12 @@ void CWinSystemOSX::OnMove(int x, int y)
oldRefreshRate = m_refreshRate;
// send a message so that videoresolution (and refreshrate) is changed
- NSWindow* win = m_appWindow;
- NSRect frame = win.contentView.frame;
- CServiceBroker::GetAppMessenger()->PostMsg(TMSG_VIDEORESIZE, frame.size.width,
- frame.size.height);
+ dispatch_sync(dispatch_get_main_queue(), ^{
+ NSWindow* win = m_appWindow;
+ NSRect frame = win.contentView.frame;
+ CServiceBroker::GetAppMessenger()->PostMsg(TMSG_VIDEORESIZE, frame.size.width,
+ frame.size.height);
+ });
}
// store window position in window mode
if (!m_bFullScreen)