gnome-shell-extension-fullscreen-notifications icon indicating copy to clipboard operation
gnome-shell-extension-fullscreen-notifications copied to clipboard

Away from mouse, notifications pop-up never go away

Open Amathadius opened this issue 5 years ago • 2 comments

I don't think that is an issue with your extension, but it happens because your extension. When I play a game in fullscreen with a controller, notifications never goes away (because I don't touch de mouse). Same thing with video in fullscreen.

I know that is a behavior of gnome (hide notification only when there is activities -- mouse movements for instance) and I really hate that. In fact, I really hate how gnome manages notifications, but is an other subject.

I want notification in fullscreen AND don't be pissed off when I am away from my mouse.

Is there any trick to achieve that?

Amathadius avatar Jun 23 '19 14:06 Amathadius

I implemented this for myself today, so it's not very well tested, but seems to work as expected:

diff --git a/[email protected]/extension.js b/[email protected]/extension.js
index 0a0a6b9..3699a7c 100644
--- a/[email protected]/extension.js
+++ b/[email protected]/extension.js
@@ -74,7 +74,9 @@ function updateState() {
                     this._showNotification();
             }
         } else if (this._notificationState == State.SHOWN) {
-            let expired = (this._userActiveWhileNotificationShown &&
+            // Expire notifications shown over fullscreen apps by making existence of a fullscreen app equivalent to user activity
+            // let expired = (this._userActiveWhileNotificationShown &&
+            let expired = ((this._userActiveWhileNotificationShown || Main.layoutManager.primaryMonitor.inFullscreen) &&
                            this._notificationTimeoutId == 0 &&
                            this._notification.urgency != Urgency.CRITICAL &&
                            !this._banner.focused &&

P.S. @soal, I can make a PR if you're fine with making this the default behavior.

AdamantGarth avatar Mar 21 '21 13:03 AdamantGarth

@AdamantGarth It would be much appreciated.

soal avatar Oct 16 '21 09:10 soal