diff options
author | André Silva <[email protected]> | 2024-02-21 13:48:48 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-02-21 13:48:48 +0000 |
commit | e5eb1bdf01013728293f4bf930dce81f1ebd366f (patch) | |
tree | 5ab10654d044173fc1b9324941f59487979a3d01 /src | |
parent | ddf022d61c63fb36b4abba392682772690c06b5c (diff) | |
download | Hyprland-e5eb1bdf01013728293f4bf930dce81f1ebd366f.tar.gz Hyprland-e5eb1bdf01013728293f4bf930dce81f1ebd366f.zip |
renderer: ignore set cursor surface if cursor should be hidden (#4780)
Diffstat (limited to 'src')
-rw-r--r-- | src/render/Renderer.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 863279ac..235c3f6f 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -2152,7 +2152,7 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR void CHyprRenderer::setCursorSurface(wlr_surface* surf, int hotspotX, int hotspotY, bool force) { m_bCursorHasSurface = surf; - if ((surf == m_sLastCursorData.surf || m_bCursorHidden) && hotspotX == m_sLastCursorData.hotspotX && hotspotY == m_sLastCursorData.hotspotY && !force) + if (surf == m_sLastCursorData.surf && hotspotX == m_sLastCursorData.hotspotX && hotspotY == m_sLastCursorData.hotspotY && !force) return; m_sLastCursorData.name = ""; @@ -2160,18 +2160,24 @@ void CHyprRenderer::setCursorSurface(wlr_surface* surf, int hotspotX, int hotspo m_sLastCursorData.hotspotX = hotspotX; m_sLastCursorData.hotspotY = hotspotY; + if (m_bCursorHidden && !force) + return; + wlr_cursor_set_surface(g_pCompositor->m_sWLRCursor, surf, hotspotX, hotspotY); } void CHyprRenderer::setCursorFromName(const std::string& name, bool force) { m_bCursorHasSurface = true; - if ((name == m_sLastCursorData.name || m_bCursorHidden) && !force) + if (name == m_sLastCursorData.name && !force) return; m_sLastCursorData.name = name; m_sLastCursorData.surf.reset(); + if (m_bCursorHidden && !force) + return; + wlr_cursor_set_xcursor(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sWLRXCursorMgr, name.c_str()); } |