renderer: Add cursor:invisible to allow to hide the cursor (#11058)

This commit is contained in:
Mozzarella32
2025-07-20 10:40:21 +00:00
committed by GitHub
parent 58b6eceb6d
commit b7a91e02e9
3 changed files with 14 additions and 2 deletions

View File

@@ -2030,6 +2030,7 @@ void CHyprRenderer::setCursorFromName(const std::string& name, bool force) {
}
void CHyprRenderer::ensureCursorRenderingMode() {
static auto PINVISIBLE = CConfigValue<Hyprlang::INT>("cursor:invisible");
static auto PCURSORTIMEOUT = CConfigValue<Hyprlang::FLOAT>("cursor:inactive_timeout");
static auto PHIDEONTOUCH = CConfigValue<Hyprlang::INT>("cursor:hide_on_touch");
static auto PHIDEONKEY = CConfigValue<Hyprlang::INT>("cursor:hide_on_key_press");
@@ -2044,7 +2045,7 @@ void CHyprRenderer::ensureCursorRenderingMode() {
if (*PCURSORTIMEOUT > 0)
m_cursorHiddenConditions.hiddenOnTimeout = *PCURSORTIMEOUT < g_pInputManager->m_lastCursorMovement.getSeconds();
const bool HIDE = m_cursorHiddenConditions.hiddenOnTimeout || m_cursorHiddenConditions.hiddenOnTouch || m_cursorHiddenConditions.hiddenOnKeyboard;
const bool HIDE = m_cursorHiddenConditions.hiddenOnTimeout || m_cursorHiddenConditions.hiddenOnTouch || m_cursorHiddenConditions.hiddenOnKeyboard || (*PINVISIBLE != 0);
if (HIDE == m_cursorHidden)
return;