mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-10-16 23:16:01 +00:00
config: set no_hw_cursors to auto by default and disable on tearing
when tearing, updates to the overlay plane may be ignored by the kernel. To avoid the cursor being a slideshow, disable hw cursors
This commit is contained in:
@@ -1356,7 +1356,7 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
|
|||||||
},
|
},
|
||||||
SConfigOptionDescription{
|
SConfigOptionDescription{
|
||||||
.value = "cursor:no_hardware_cursors",
|
.value = "cursor:no_hardware_cursors",
|
||||||
.description = "disables hardware cursors",
|
.description = "disables hardware cursors. Auto = disable when tearing",
|
||||||
.type = CONFIG_OPTION_CHOICE,
|
.type = CONFIG_OPTION_CHOICE,
|
||||||
.data = SConfigOptionDescription::SChoiceData{0, "Disabled,Enabled,Auto"},
|
.data = SConfigOptionDescription::SChoiceData{0, "Disabled,Enabled,Auto"},
|
||||||
},
|
},
|
||||||
|
@@ -621,7 +621,7 @@ CConfigManager::CConfigManager() {
|
|||||||
|
|
||||||
m_pConfig->addConfigValue("opengl:nvidia_anti_flicker", Hyprlang::INT{1});
|
m_pConfig->addConfigValue("opengl:nvidia_anti_flicker", Hyprlang::INT{1});
|
||||||
|
|
||||||
m_pConfig->addConfigValue("cursor:no_hardware_cursors", Hyprlang::INT{0});
|
m_pConfig->addConfigValue("cursor:no_hardware_cursors", Hyprlang::INT{2});
|
||||||
m_pConfig->addConfigValue("cursor:no_break_fs_vrr", Hyprlang::INT{2});
|
m_pConfig->addConfigValue("cursor:no_break_fs_vrr", Hyprlang::INT{2});
|
||||||
m_pConfig->addConfigValue("cursor:min_refresh_rate", Hyprlang::INT{24});
|
m_pConfig->addConfigValue("cursor:min_refresh_rate", Hyprlang::INT{24});
|
||||||
m_pConfig->addConfigValue("cursor:hotspot_padding", Hyprlang::INT{0});
|
m_pConfig->addConfigValue("cursor:hotspot_padding", Hyprlang::INT{0});
|
||||||
@@ -2798,12 +2798,13 @@ const std::vector<SConfigOptionDescription>& CConfigManager::getAllDescriptions(
|
|||||||
return CONFIG_OPTIONS;
|
return CONFIG_OPTIONS;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CConfigManager::shouldUseSoftwareCursors() {
|
bool CConfigManager::shouldUseSoftwareCursors(PHLMONITOR pMonitor) {
|
||||||
static auto PNOHW = CConfigValue<Hyprlang::INT>("cursor:no_hardware_cursors");
|
static auto PNOHW = CConfigValue<Hyprlang::INT>("cursor:no_hardware_cursors");
|
||||||
|
|
||||||
switch (*PNOHW) {
|
switch (*PNOHW) {
|
||||||
case 0: return false;
|
case 0: return false;
|
||||||
case 1: return true;
|
case 1: return true;
|
||||||
|
case 2: return pMonitor->tearingState.activelyTearing;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -189,7 +189,7 @@ class CConfigManager {
|
|||||||
void ensureMonitorStatus();
|
void ensureMonitorStatus();
|
||||||
void ensureVRR(PHLMONITOR pMonitor = nullptr);
|
void ensureVRR(PHLMONITOR pMonitor = nullptr);
|
||||||
|
|
||||||
bool shouldUseSoftwareCursors();
|
bool shouldUseSoftwareCursors(PHLMONITOR pMonitor);
|
||||||
void updateWatcher();
|
void updateWatcher();
|
||||||
|
|
||||||
std::string parseKeyword(const std::string&, const std::string&);
|
std::string parseKeyword(const std::string&, const std::string&);
|
||||||
|
@@ -274,7 +274,7 @@ void CPointerManager::updateCursorBackend() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state->softwareLocks > 0 || g_pConfigManager->shouldUseSoftwareCursors() || !attemptHardwareCursor(state)) {
|
if (state->softwareLocks > 0 || g_pConfigManager->shouldUseSoftwareCursors(m) || !attemptHardwareCursor(state)) {
|
||||||
Debug::log(TRACE, "Output {} rejected hardware cursors, falling back to sw", m->szName);
|
Debug::log(TRACE, "Output {} rejected hardware cursors, falling back to sw", m->szName);
|
||||||
state->box = getCursorBoxLogicalForMonitor(state->monitor.lock());
|
state->box = getCursorBoxLogicalForMonitor(state->monitor.lock());
|
||||||
state->hardwareFailed = true;
|
state->hardwareFailed = true;
|
||||||
@@ -737,7 +737,8 @@ void CPointerManager::damageIfSoftware() {
|
|||||||
if (mw->monitor.expired() || !mw->monitor->output)
|
if (mw->monitor.expired() || !mw->monitor->output)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((mw->softwareLocks > 0 || mw->hardwareFailed || g_pConfigManager->shouldUseSoftwareCursors()) && b.overlaps({mw->monitor->vecPosition, mw->monitor->vecSize})) {
|
if ((mw->softwareLocks > 0 || mw->hardwareFailed || g_pConfigManager->shouldUseSoftwareCursors(mw->monitor.lock())) &&
|
||||||
|
b.overlaps({mw->monitor->vecPosition, mw->monitor->vecSize})) {
|
||||||
g_pHyprRenderer->damageBox(b, mw->monitor->shouldSkipScheduleFrameOnMouseEvent());
|
g_pHyprRenderer->damageBox(b, mw->monitor->shouldSkipScheduleFrameOnMouseEvent());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user