mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-24 22:37:19 +00:00
[client] core: invalidate the pointer state when overlay is disabled
This commit is contained in:
parent
8ab130deba
commit
bbd9c84896
@ -907,6 +907,7 @@ void app_setOverlay(bool enable)
|
||||
g_state.io->ConfigFlags |= ImGuiConfigFlags_NoMouse;
|
||||
core_resetOverlayInputState();
|
||||
core_setGrabQuiet(wasGrabbed);
|
||||
core_invalidatePointer();
|
||||
app_invalidateWindow(false);
|
||||
}
|
||||
}
|
||||
|
@ -37,33 +37,16 @@ bool core_inputEnabled(void)
|
||||
((g_cursor.grab && g_params.captureInputOnly) || !g_params.captureInputOnly);
|
||||
}
|
||||
|
||||
void core_setCursorInView(bool enable)
|
||||
void core_invalidatePointer(void)
|
||||
{
|
||||
// if the state has not changed, don't do anything else
|
||||
if (g_cursor.inView == enable)
|
||||
return;
|
||||
|
||||
if (enable && !g_state.focused)
|
||||
return;
|
||||
|
||||
// do not allow the view to become active if any mouse buttons are being held,
|
||||
// this fixes issues with meta window resizing.
|
||||
if (enable && g_cursor.buttons)
|
||||
return;
|
||||
|
||||
g_cursor.inView = enable;
|
||||
g_cursor.draw = (g_params.alwaysShowCursor || g_params.captureInputOnly)
|
||||
? true : enable;
|
||||
g_cursor.redraw = true;
|
||||
|
||||
/* if the display server does not support warp, then we can not operate in
|
||||
* always relative mode and we should not grab the pointer */
|
||||
enum LG_DSWarpSupport warpSupport = LG_DS_WARP_NONE;
|
||||
app_getProp(LG_DS_WARP_SUPPORT, &warpSupport);
|
||||
|
||||
g_cursor.warpState = enable ? WARP_STATE_ON : WARP_STATE_OFF;
|
||||
g_cursor.warpState = g_cursor.inView ? WARP_STATE_ON : WARP_STATE_OFF;
|
||||
|
||||
if (enable)
|
||||
if (g_cursor.inView)
|
||||
{
|
||||
if (g_params.hideMouse)
|
||||
g_state.ds->setPointer(LG_POINTER_NONE);
|
||||
@ -88,6 +71,28 @@ void core_setCursorInView(bool enable)
|
||||
g_cursor.warpState = WARP_STATE_ON;
|
||||
}
|
||||
|
||||
void core_setCursorInView(bool enable)
|
||||
{
|
||||
// if the state has not changed, don't do anything else
|
||||
if (g_cursor.inView == enable)
|
||||
return;
|
||||
|
||||
if (enable && !g_state.focused)
|
||||
return;
|
||||
|
||||
// do not allow the view to become active if any mouse buttons are being held,
|
||||
// this fixes issues with meta window resizing.
|
||||
if (enable && g_cursor.buttons)
|
||||
return;
|
||||
|
||||
g_cursor.inView = enable;
|
||||
g_cursor.draw = (g_params.alwaysShowCursor || g_params.captureInputOnly)
|
||||
? true : enable;
|
||||
g_cursor.redraw = true;
|
||||
|
||||
core_invalidatePointer();
|
||||
}
|
||||
|
||||
void core_setGrab(bool enable)
|
||||
{
|
||||
core_setGrabQuiet(enable);
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
bool core_inputEnabled(void);
|
||||
void core_invalidatePointer(void);
|
||||
void core_setCursorInView(bool enable);
|
||||
void core_setGrab(bool enable);
|
||||
void core_setGrabQuiet(bool enable);
|
||||
|
Loading…
Reference in New Issue
Block a user