diff --git a/client/displayservers/Wayland/shell_libdecor.c b/client/displayservers/Wayland/shell_libdecor.c index 1f257bdb..a4733aac 100644 --- a/client/displayservers/Wayland/shell_libdecor.c +++ b/client/displayservers/Wayland/shell_libdecor.c @@ -70,6 +70,7 @@ static void libdecorFrameConfigure(struct libdecor_frame * frame, wlWm.needsResize = true; wlWm.resizeSerial = configuration->serial; app_invalidateWindow(); + waylandForceRender(); } else wlWm.configured = true; diff --git a/client/displayservers/Wayland/shell_xdg.c b/client/displayservers/Wayland/shell_xdg.c index 144537bc..f4b12d7b 100644 --- a/client/displayservers/Wayland/shell_xdg.c +++ b/client/displayservers/Wayland/shell_xdg.c @@ -47,6 +47,7 @@ static void xdgSurfaceConfigure(void * data, struct xdg_surface * xdgSurface, wlWm.needsResize = true; wlWm.resizeSerial = serial; app_invalidateWindow(); + waylandForceRender(); } else { diff --git a/client/displayservers/Wayland/wayland.c b/client/displayservers/Wayland/wayland.c index 2c6b6e85..21995b00 100644 --- a/client/displayservers/Wayland/wayland.c +++ b/client/displayservers/Wayland/wayland.c @@ -173,6 +173,7 @@ struct LG_DisplayServerOps LGDS_Wayland = .glSwapBuffers = waylandGLSwapBuffers, #endif .waitFrame = waylandWaitFrame, + .skipFrame = waylandSkipFrame, .guestPointerUpdated = waylandGuestPointerUpdated, .setPointer = waylandSetPointer, .grabPointer = waylandGrabPointer, diff --git a/client/displayservers/Wayland/wayland.h b/client/displayservers/Wayland/wayland.h index e4ff9e4c..bd8d39f3 100644 --- a/client/displayservers/Wayland/wayland.h +++ b/client/displayservers/Wayland/wayland.h @@ -307,3 +307,5 @@ void waylandWindowUpdateScale(void); void waylandSetWindowSize(int x, int y); bool waylandIsValidPointerPos(int x, int y); void waylandWaitFrame(void); +void waylandSkipFrame(void); +void waylandForceRender(void); diff --git a/client/displayservers/Wayland/window.c b/client/displayservers/Wayland/window.c index 2ef0ece1..39ff0976 100644 --- a/client/displayservers/Wayland/window.c +++ b/client/displayservers/Wayland/window.c @@ -144,3 +144,14 @@ void waylandWaitFrame(void) if (callback) wl_callback_add_listener(callback, &frame_listener, NULL); } + +void waylandSkipFrame(void) +{ + // If we decided to not render, we must commit the surface so that the callback is registered. + wl_surface_commit(wlWm.surface); +} + +void waylandForceRender(void) +{ + lgSignalEvent(wlWm.frameEvent); +}