mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38: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.needsResize = true;
|
||||||
wlWm.resizeSerial = configuration->serial;
|
wlWm.resizeSerial = configuration->serial;
|
||||||
app_invalidateWindow();
|
app_invalidateWindow();
|
||||||
|
waylandForceRender();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
wlWm.configured = true;
|
wlWm.configured = true;
|
||||||
|
@ -47,6 +47,7 @@ static void xdgSurfaceConfigure(void * data, struct xdg_surface * xdgSurface,
|
|||||||
wlWm.needsResize = true;
|
wlWm.needsResize = true;
|
||||||
wlWm.resizeSerial = serial;
|
wlWm.resizeSerial = serial;
|
||||||
app_invalidateWindow();
|
app_invalidateWindow();
|
||||||
|
waylandForceRender();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -173,6 +173,7 @@ struct LG_DisplayServerOps LGDS_Wayland =
|
|||||||
.glSwapBuffers = waylandGLSwapBuffers,
|
.glSwapBuffers = waylandGLSwapBuffers,
|
||||||
#endif
|
#endif
|
||||||
.waitFrame = waylandWaitFrame,
|
.waitFrame = waylandWaitFrame,
|
||||||
|
.skipFrame = waylandSkipFrame,
|
||||||
.guestPointerUpdated = waylandGuestPointerUpdated,
|
.guestPointerUpdated = waylandGuestPointerUpdated,
|
||||||
.setPointer = waylandSetPointer,
|
.setPointer = waylandSetPointer,
|
||||||
.grabPointer = waylandGrabPointer,
|
.grabPointer = waylandGrabPointer,
|
||||||
|
@ -307,3 +307,5 @@ void waylandWindowUpdateScale(void);
|
|||||||
void waylandSetWindowSize(int x, int y);
|
void waylandSetWindowSize(int x, int y);
|
||||||
bool waylandIsValidPointerPos(int x, int y);
|
bool waylandIsValidPointerPos(int x, int y);
|
||||||
void waylandWaitFrame(void);
|
void waylandWaitFrame(void);
|
||||||
|
void waylandSkipFrame(void);
|
||||||
|
void waylandForceRender(void);
|
||||||
|
@ -144,3 +144,14 @@ void waylandWaitFrame(void)
|
|||||||
if (callback)
|
if (callback)
|
||||||
wl_callback_add_listener(callback, &frame_listener, NULL);
|
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