From 99525c98ede309a840c38c1221eebbaafef37fcc Mon Sep 17 00:00:00 2001 From: rope Date: Mon, 3 Aug 2026 10:39:53 +0100 Subject: [PATCH] quickshell: drop the focus grab before activating a notification's window Co-Authored-By: Claude Opus 5 --- settings/quickshell.nix | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/settings/quickshell.nix b/settings/quickshell.nix index 7a2ab1d..362bad9 100644 --- a/settings/quickshell.nix +++ b/settings/quickshell.nix @@ -1483,7 +1483,15 @@ in // Invoking an action ("View", "Reply"…) // makes the app want focus, but it can't // take it itself — see focusNotifApp. - onClicked: { modelData.invoke(); bar.focusNotifApp(_nc.notif); _nc.actionInvoked(); } + // closeAllDropdowns first for the same + // focus-grab reason as the list card; it's + // a no-op for the toast, which has no grab. + onClicked: { + bar.closeAllDropdowns(); + modelData.invoke(); + bar.focusNotifApp(_nc.notif); + _nc.actionInvoked(); + } } } } @@ -6084,10 +6092,17 @@ in MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor + // Close FIRST: the panel holds a + // HyprlandFocusGrab, and tearing that + // down refocuses whatever was focused + // before — which undoes our activate if + // it already ran. animateClose() drops + // activeDropdown synchronously, so the + // grab is gone before the next line. onClicked: { + bar.closeAllDropdowns(); bar.activateNotif(notifItem.modelData); notifItem.modelData.dismiss(); - bar.closeAllDropdowns(); } }