mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-07 21:46:00 +01:00
a bit of fixes to cursor hiding
This commit is contained in:
parent
4d09101e23
commit
f5c2dfc706
3 changed files with 18 additions and 1 deletions
|
@ -57,6 +57,15 @@ void Events::listener_mouseAxis(wl_listener* listener, void* data) {
|
|||
void Events::listener_requestMouse(wl_listener* listener, void* data) {
|
||||
const auto EVENT = (wlr_seat_pointer_request_set_cursor_event*)data;
|
||||
|
||||
if (!g_pHyprRenderer->shouldRenderCursor())
|
||||
return;
|
||||
|
||||
if (!EVENT->surface) {
|
||||
g_pHyprRenderer->m_bWindowRequestedCursorHide = true;
|
||||
} else {
|
||||
g_pHyprRenderer->m_bWindowRequestedCursorHide = false;
|
||||
}
|
||||
|
||||
if (EVENT->seat_client == g_pCompositor->m_sSeat.seat->pointer_state.focused_client)
|
||||
wlr_cursor_set_surface(g_pCompositor->m_sWLRCursor, EVENT->surface, EVENT->hotspot_x, EVENT->hotspot_y);
|
||||
}
|
||||
|
|
|
@ -772,6 +772,7 @@ void CHyprRenderer::ensureCursorRenderingMode() {
|
|||
} else if (*PCURSORTIMEOUT > PASSEDCURSORSECONDS && !m_bHasARenderedCursor) {
|
||||
m_bHasARenderedCursor = true;
|
||||
|
||||
if (!m_bWindowRequestedCursorHide)
|
||||
wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "left_ptr", g_pCompositor->m_sWLRCursor);
|
||||
|
||||
Debug::log(LOG, "Showing the cursor (timeout)");
|
||||
|
@ -783,3 +784,7 @@ void CHyprRenderer::ensureCursorRenderingMode() {
|
|||
m_bHasARenderedCursor = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool CHyprRenderer::shouldRenderCursor() {
|
||||
return m_bHasARenderedCursor;
|
||||
}
|
|
@ -32,6 +32,9 @@ public:
|
|||
bool shouldRenderWindow(CWindow*, SMonitor*);
|
||||
bool shouldRenderWindow(CWindow*);
|
||||
void ensureCursorRenderingMode();
|
||||
bool shouldRenderCursor();
|
||||
|
||||
bool m_bWindowRequestedCursorHide = false;
|
||||
|
||||
DAMAGETRACKINGMODES damageTrackingModeFromStr(const std::string&);
|
||||
|
||||
|
|
Loading…
Reference in a new issue