mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 13:37:22 +00:00
[client] x11: don't allow window manager events to skew cal timing
This commit is contained in:
parent
e5a138d854
commit
ec56b2760a
@ -674,6 +674,8 @@ static int x11EventThread(void * unused)
|
||||
|
||||
case ConfigureNotify:
|
||||
{
|
||||
atomic_store(&x11.lastWMEvent, microtime());
|
||||
|
||||
int x, y;
|
||||
|
||||
/* the window may have been re-parented so we need to translate to
|
||||
@ -707,6 +709,7 @@ static int x11EventThread(void * unused)
|
||||
|
||||
case Expose:
|
||||
{
|
||||
atomic_store(&x11.lastWMEvent, microtime());
|
||||
app_invalidateWindow(false);
|
||||
break;
|
||||
}
|
||||
@ -1227,7 +1230,9 @@ static bool x11WaitFrame(void)
|
||||
lastmsc = msc;
|
||||
|
||||
/* adjustments if we are still seeing odd skips */
|
||||
if (delay > 0 && deltamsc > 1)
|
||||
const uint64_t lastWMEvent = atomic_load(&x11.lastWMEvent);
|
||||
const uint64_t eventDelta = ust > lastWMEvent ? ust - lastWMEvent : 0;
|
||||
if (delay > 0 && deltamsc > 1 && eventDelta > 1000000UL)
|
||||
{
|
||||
/* only adjust if the last skip was less then 1s ago */
|
||||
static uint64_t lastSkip = 0;
|
||||
|
@ -40,6 +40,8 @@ struct X11DSState
|
||||
Window window;
|
||||
XVisualInfo * visual;
|
||||
|
||||
_Atomic(uint64_t) lastWMEvent;
|
||||
|
||||
int xpresentOp;
|
||||
bool jitRender;
|
||||
_Atomic(uint64_t) presentMsc, presentUst;
|
||||
|
Loading…
Reference in New Issue
Block a user