diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index f59663f856..9f0ea7db11 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -443,7 +443,8 @@ VKGSRender::VKGSRender(utils::serial* ar) noexcept : GSRender(ar) using T = std::decay_t; if constexpr (std::is_same_v>) { - m_display_handle = p.first; XFlush(m_display_handle); + m_display_handle = p.first; + XFlush(m_display_handle); } }, display); #endif diff --git a/rpcs3/Emu/RSX/display.h b/rpcs3/Emu/RSX/display.h index 1cad84dba5..f86ca7d755 100644 --- a/rpcs3/Emu/RSX/display.h +++ b/rpcs3/Emu/RSX/display.h @@ -22,14 +22,16 @@ using display_handle_t = void*; // NSView #else #include using display_handle_t = std::variant< -#if defined(HAVE_X11) && defined(VK_USE_PLATFORM_WAYLAND_KHR) +#if defined(HAVE_X11) +#if defined(VK_USE_PLATFORM_WAYLAND_KHR) std::pair, std::pair -#elif defined(HAVE_X11) +#else std::pair +#endif #elif defined(VK_USE_PLATFORM_WAYLAND_KHR) std::pair #elif defined(ANDROID) - struct ANativeWindow * + struct ANativeWindow* #endif >; #endif diff --git a/rpcs3/rpcs3qt/gs_frame.cpp b/rpcs3/rpcs3qt/gs_frame.cpp index 8cd2a2bc9b..b4a11d1b8c 100644 --- a/rpcs3/rpcs3qt/gs_frame.cpp +++ b/rpcs3/rpcs3qt/gs_frame.cpp @@ -36,7 +36,7 @@ #elif defined(__APPLE__) //nothing #else -#ifdef HAVE_WAYLAND +#ifdef VK_USE_PLATFORM_WAYLAND_KHR #include #include #endif @@ -665,29 +665,22 @@ void gs_frame::show() display_handle_t gs_frame::handle() const { -#ifdef _WIN32 - return reinterpret_cast(this->winId()); -#elif defined(__APPLE__) - return reinterpret_cast(this->winId()); //NSView +#if defined(_WIN32) || defined(__APPLE__) + return reinterpret_cast(this->winId()); #else -#ifdef HAVE_WAYLAND - QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); - struct wl_display *wl_dpy = static_cast( - native->nativeResourceForWindow("display", NULL)); - struct wl_surface *wl_surf = static_cast( - native->nativeResourceForWindow("surface", const_cast(static_cast(this)))); - if (wl_dpy != nullptr && wl_surf != nullptr) +#ifdef VK_USE_PLATFORM_WAYLAND_KHR + QPlatformNativeInterface* native = QGuiApplication::platformNativeInterface(); + struct wl_display* wl_dpy = static_cast(native->nativeResourceForWindow("display", nullptr)); + struct wl_surface* wl_surf = static_cast(native->nativeResourceForWindow("surface", const_cast(static_cast(this)))); + if (wl_dpy && wl_surf) { return std::make_pair(wl_dpy, wl_surf); } - else #endif #ifdef HAVE_X11 - { - return std::make_pair(XOpenDisplay(0), static_cast(this->winId())); - } + return std::make_pair(XOpenDisplay(0), static_cast(this->winId())); #else - fmt::throw_exception("Vulkan X11 support disabled at compile-time."); + fmt::throw_exception("Vulkan X11 support disabled at compile-time."); #endif #endif }