diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-07-02 04:38:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-02 04:38:26 +0200 |
commit | ae7e9b54692741a706610cb228da9631db939771 (patch) | |
tree | a8b9813e124b39e067c179032dd7f3b215487266 /src/yuzu/qt_common.cpp | |
parent | Merge pull request #10970 from Morph1984/thing (diff) | |
parent | yuzu: Use test window with VulkanSurface to check for present modes. (diff) | |
download | yuzu-ae7e9b54692741a706610cb228da9631db939771.tar yuzu-ae7e9b54692741a706610cb228da9631db939771.tar.gz yuzu-ae7e9b54692741a706610cb228da9631db939771.tar.bz2 yuzu-ae7e9b54692741a706610cb228da9631db939771.tar.lz yuzu-ae7e9b54692741a706610cb228da9631db939771.tar.xz yuzu-ae7e9b54692741a706610cb228da9631db939771.tar.zst yuzu-ae7e9b54692741a706610cb228da9631db939771.zip |
Diffstat (limited to 'src/yuzu/qt_common.cpp')
-rw-r--r-- | src/yuzu/qt_common.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/yuzu/qt_common.cpp b/src/yuzu/qt_common.cpp index 5d0fd7674..413402165 100644 --- a/src/yuzu/qt_common.cpp +++ b/src/yuzu/qt_common.cpp @@ -10,6 +10,8 @@ #if !defined(WIN32) && !defined(__APPLE__) #include <qpa/qplatformnativeinterface.h> +#elif defined(__APPLE__) +#include <objc/message.h> #endif namespace QtCommon { @@ -37,9 +39,12 @@ Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow* window) Core::Frontend::EmuWindow::WindowSystemInfo wsi; wsi.type = GetWindowSystemType(); +#if defined(WIN32) // Our Win32 Qt external doesn't have the private API. -#if defined(WIN32) || defined(__APPLE__) - wsi.render_surface = window ? reinterpret_cast<void*>(window->winId()) : nullptr; + wsi.render_surface = reinterpret_cast<void*>(window->winId()); +#elif defined(__APPLE__) + wsi.render_surface = reinterpret_cast<void* (*)(id, SEL)>(objc_msgSend)( + reinterpret_cast<id>(window->winId()), sel_registerName("layer")); #else QPlatformNativeInterface* pni = QGuiApplication::platformNativeInterface(); wsi.display_connection = pni->nativeResourceForWindow("display", window); |