Fix regression in ea2a929f, check for Wayland

Fix regression in ea2a929f, which broke x11 support by not checking for
Wayland when making the Wayland EGL subsurface move call.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2022-10-25 19:17:40 +00:00
parent 873de5f667
commit 0bfb88d0e3
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
2 changed files with 4 additions and 1 deletions

View File

@ -2364,7 +2364,8 @@ void GLDrawingPanel::OnSize(wxSizeEvent& ev)
AdjustViewport();
// Temporary hack to backport 800d6ed69b from wxWidgets until 3.2.2 is released.
MoveWaylandSubsurface(this);
if (IsWayland())
MoveWaylandSubsurface(this);
ev.Skip();
}

View File

@ -17,6 +17,8 @@ bool IsWayland() { return GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default()); }
void MoveWaylandSubsurface(wxGLCanvas* win)
{
if (!IsWayland()) return;
int x, y;
gdk_window_get_origin(win->GTKGetDrawingWindow(), &x, &y);
wl_subsurface_set_position(win->m_wlSubsurface, x, y);