mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-10 23:07:04 +00:00
[client] opengl: mouse shape updates bypass the draw timeout
This commit is contained in:
parent
c1379a45d2
commit
f7420317f1
@ -82,6 +82,7 @@ struct LGR_OpenGL
|
||||
SDL_Rect fpsRect;
|
||||
|
||||
bool mouseUpdate;
|
||||
bool newShape;
|
||||
uint64_t lastMouseDraw;
|
||||
LG_RendererCursor mouseType;
|
||||
bool mouseVisible;
|
||||
@ -493,6 +494,7 @@ bool lgr_opengl_on_mouse_shape(void * opaque, const LG_RendererCursor cursor, co
|
||||
}
|
||||
|
||||
this->mouseUpdate = true;
|
||||
this->newShape = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -702,10 +704,14 @@ bool lgr_opengl_render(void * opaque)
|
||||
if (!this->mouseUpdate)
|
||||
return true;
|
||||
|
||||
// don't update the mouse too fast
|
||||
const uint64_t delta = nanotime() - this->lastMouseDraw;
|
||||
if (delta < 5e6)
|
||||
return true;
|
||||
if (!this->newShape)
|
||||
{
|
||||
// don't update the mouse too fast
|
||||
const uint64_t delta = nanotime() - this->lastMouseDraw;
|
||||
if (delta < 5e6)
|
||||
return true;
|
||||
}
|
||||
this->newShape = false;
|
||||
}
|
||||
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
|
Loading…
Reference in New Issue
Block a user