mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 21:25:59 +01:00
ratelimit setting cursor
This commit is contained in:
parent
3c20ecb04d
commit
09495375b5
2 changed files with 14 additions and 4 deletions
|
@ -209,11 +209,18 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
|
||||||
if (!foundSurface)
|
if (!foundSurface)
|
||||||
foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &PMONITOR->m_aLayerSurfaceLists[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], &surfaceCoords, &pFoundLayerSurface);
|
foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &PMONITOR->m_aLayerSurfaceLists[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], &surfaceCoords, &pFoundLayerSurface);
|
||||||
|
|
||||||
|
g_pCompositor->scheduleFrameForMonitor(g_pCompositor->m_pLastMonitor);
|
||||||
|
|
||||||
if (!foundSurface) {
|
if (!foundSurface) {
|
||||||
if (m_ecbClickBehavior == CLICKMODE_KILL)
|
if (!m_bEmptyFocusCursorSet) {
|
||||||
wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "crosshair", g_pCompositor->m_sWLRCursor);
|
// TODO: maybe wrap?
|
||||||
else
|
if (m_ecbClickBehavior == CLICKMODE_KILL)
|
||||||
wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "left_ptr", g_pCompositor->m_sWLRCursor);
|
wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "crosshair", g_pCompositor->m_sWLRCursor);
|
||||||
|
else
|
||||||
|
wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "left_ptr", g_pCompositor->m_sWLRCursor);
|
||||||
|
|
||||||
|
m_bEmptyFocusCursorSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
wlr_seat_pointer_clear_focus(g_pCompositor->m_sSeat.seat);
|
wlr_seat_pointer_clear_focus(g_pCompositor->m_sSeat.seat);
|
||||||
|
|
||||||
|
@ -224,6 +231,8 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_bEmptyFocusCursorSet = false;
|
||||||
|
|
||||||
if (time)
|
if (time)
|
||||||
wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat);
|
wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat);
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,7 @@ private:
|
||||||
|
|
||||||
// for click behavior override
|
// for click behavior override
|
||||||
eClickBehaviorMode m_ecbClickBehavior = CLICKMODE_DEFAULT;
|
eClickBehaviorMode m_ecbClickBehavior = CLICKMODE_DEFAULT;
|
||||||
|
bool m_bEmptyFocusCursorSet = false;
|
||||||
Vector2D m_vLastCursorPosFloored = Vector2D();
|
Vector2D m_vLastCursorPosFloored = Vector2D();
|
||||||
|
|
||||||
void processMouseDownNormal(wlr_pointer_button_event* e);
|
void processMouseDownNormal(wlr_pointer_button_event* e);
|
||||||
|
|
Loading…
Reference in a new issue