Skip to content

Commit b3180bc

Browse files
ColinKinlochExzap
authored andcommitted
Fix GamePad window when using vulkan with wayland
1 parent be1e771 commit b3180bc

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/gui/canvas/VulkanCanvas.cpp

+7-12
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,15 @@ VulkanCanvas::VulkanCanvas(wxWindow* parent, const wxSize& size, bool is_main_wi
1414
Bind(wxEVT_PAINT, &VulkanCanvas::OnPaint, this);
1515
Bind(wxEVT_SIZE, &VulkanCanvas::OnResize, this);
1616

17-
if(is_main_window)
17+
WindowHandleInfo& canvas = is_main_window ? gui_getWindowInfo().canvas_main : gui_getWindowInfo().canvas_pad;
18+
gui_initHandleContextFromWxWidgetsWindow(canvas, this);
19+
#if BOOST_OS_LINUX && HAS_WAYLAND
20+
if (canvas.backend == WindowHandleInfo::Backend::WAYLAND)
1821
{
19-
WindowHandleInfo& canvasMain = gui_getWindowInfo().canvas_main;
20-
gui_initHandleContextFromWxWidgetsWindow(canvasMain, this);
21-
#if BOOST_OS_LINUX && HAS_WAYLAND
22-
if(canvasMain.backend == WindowHandleInfo::Backend::WAYLAND)
23-
{
24-
m_subsurface = std::make_unique<wxWlSubsurface>(this);
25-
canvasMain.surface = m_subsurface->getSurface();
26-
}
27-
#endif
22+
m_subsurface = std::make_unique<wxWlSubsurface>(this);
23+
canvas.surface = m_subsurface->getSurface();
2824
}
29-
else
30-
gui_initHandleContextFromWxWidgetsWindow(gui_getWindowInfo().canvas_pad, this);
25+
#endif
3126

3227
cemu_assert(g_vulkan_available);
3328

0 commit comments

Comments
 (0)