mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 14:57:20 +00:00
[client] wayland: make waitFrame work when not rendering
Implement skipFrame and do various things to wake waitFrame.
This commit is contained in:
parent
16aa04d539
commit
2e4614cbc4
@ -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;
|
||||
|
@ -47,6 +47,7 @@ static void xdgSurfaceConfigure(void * data, struct xdg_surface * xdgSurface,
|
||||
wlWm.needsResize = true;
|
||||
wlWm.resizeSerial = serial;
|
||||
app_invalidateWindow();
|
||||
waylandForceRender();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -173,6 +173,7 @@ struct LG_DisplayServerOps LGDS_Wayland =
|
||||
.glSwapBuffers = waylandGLSwapBuffers,
|
||||
#endif
|
||||
.waitFrame = waylandWaitFrame,
|
||||
.skipFrame = waylandSkipFrame,
|
||||
.guestPointerUpdated = waylandGuestPointerUpdated,
|
||||
.setPointer = waylandSetPointer,
|
||||
.grabPointer = waylandGrabPointer,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user