feat: always expire notifs if fullscreen

Also faster expire timeout when fullscreen
This commit is contained in:
2 * r + 2 * t 2026-04-26 15:13:28 +10:00
parent 9be727dbe1
commit 53dd959f5e
2 changed files with 14 additions and 2 deletions

View file

@ -13,6 +13,7 @@ class NotifsConfig : public ConfigObject {
CONFIG_GLOBAL_PROPERTY(bool, expire, true)
CONFIG_GLOBAL_PROPERTY(QString, fullscreen, QStringLiteral("on"))
CONFIG_GLOBAL_PROPERTY(int, defaultExpireTimeout, 5000)
CONFIG_GLOBAL_PROPERTY(int, fullscreenExpireTimeout, 2000)
CONFIG_PROPERTY(qreal, clearThreshold, 0.3)
CONFIG_PROPERTY(int, expandThreshold, 20)
CONFIG_GLOBAL_PROPERTY(bool, actionOnClick, false)

View file

@ -39,11 +39,22 @@ QtObject {
property bool hasActionIcons
property list<var> actions
readonly property bool hasFullscreen: {
const monitor = Hypr.focusedMonitor;
const specialName = monitor?.lastIpcObject.specialWorkspace?.name;
if (specialName) {
const specialWs = Hypr.workspaces.values.find(ws => ws.name === specialName);
return specialWs?.toplevels.values.some(t => t.lastIpcObject.fullscreen > 1) ?? false;
}
return monitor?.activeWorkspace?.toplevels.values.some(t => t.lastIpcObject.fullscreen > 1) ?? false;
}
readonly property Timer timer: Timer {
running: true
interval: notif.expireTimeout > 0 ? notif.expireTimeout : GlobalConfig.notifs.defaultExpireTimeout
interval: notif.expireTimeout > 0 ? notif.expireTimeout : notif.hasFullscreen ? GlobalConfig.notifs.fullscreenExpireTimeout : GlobalConfig.notifs.defaultExpireTimeout
onTriggered: {
if (GlobalConfig.notifs.expire)
// Always expire if the active workspace has a fullscreen window
if (GlobalConfig.notifs.expire || notif.hasFullscreen)
notif.popup = false;
}
}