1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-04 21:02:06 -04:00

feature(notification): show notification only on current focused display (#1923)

This commit is contained in:
Augusto César Dias
2026-03-10 15:46:04 +01:00
committed by GitHub
parent e9404eb9b6
commit d58486193e
6 changed files with 29 additions and 2 deletions

View File

@@ -108,6 +108,13 @@ QtObject {
return p && p.status !== Component.Null && !p._isDestroying && p.hasValidData;
}
function _isFocusedScreen() {
if (!SettingsData.notificationFocusedMonitor)
return true;
const focused = CompositorService.getFocusedScreen();
return focused && manager.modelData && focused.name === manager.modelData.name;
}
function _sync(newWrappers) {
for (const p of popupWindows.slice()) {
if (!_isValidWindow(p) || p.exiting)
@@ -118,7 +125,7 @@ QtObject {
}
}
for (const w of newWrappers) {
if (w && !_hasWindowFor(w))
if (w && !_hasWindowFor(w) && _isFocusedScreen())
_insertAtTop(w);
}
}