mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] x11: invalidate the full window after timeout from expose
Invalidating the entire window on an Expose event causes poor WM performance when dragging the window around. Instead flag to redraw and wait for the expose events to stop for 100ms before doing it.
This commit is contained in:
parent
12d256c7c8
commit
64da3465b8
@ -643,6 +643,13 @@ static int x11EventThread(void * unused)
|
|||||||
|
|
||||||
while(app_isRunning())
|
while(app_isRunning())
|
||||||
{
|
{
|
||||||
|
const uint64_t lastWMEvent = atomic_load(&x11.lastWMEvent);
|
||||||
|
if (x11.invalidateAll && microtime() - lastWMEvent > 100000UL)
|
||||||
|
{
|
||||||
|
x11.invalidateAll = false;
|
||||||
|
app_invalidateWindow(true);
|
||||||
|
}
|
||||||
|
|
||||||
if (!XPending(x11.display))
|
if (!XPending(x11.display))
|
||||||
{
|
{
|
||||||
FD_ZERO(&in_fds);
|
FD_ZERO(&in_fds);
|
||||||
@ -710,7 +717,7 @@ static int x11EventThread(void * unused)
|
|||||||
case Expose:
|
case Expose:
|
||||||
{
|
{
|
||||||
atomic_store(&x11.lastWMEvent, microtime());
|
atomic_store(&x11.lastWMEvent, microtime());
|
||||||
app_invalidateWindow(false);
|
x11.invalidateAll = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ struct X11DSState
|
|||||||
XVisualInfo * visual;
|
XVisualInfo * visual;
|
||||||
|
|
||||||
_Atomic(uint64_t) lastWMEvent;
|
_Atomic(uint64_t) lastWMEvent;
|
||||||
|
bool invalidateAll;
|
||||||
|
|
||||||
int xpresentOp;
|
int xpresentOp;
|
||||||
bool jitRender;
|
bool jitRender;
|
||||||
|
Loading…
Reference in New Issue
Block a user