[gnome-shell/gnome-41] messageList: Only close messages via delete key if they can be closed



commit b37b5ca42899ce47b7ae953fec4009bb82d1fe3f
Author: PhilProg <philroh2008 gmail com>
Date:   Fri Jun 3 04:53:11 2022 +0000

    messageList: Only close messages via delete key if they can be closed
    
    If the delete key is pressed while a message/MPRIS indicator is focused
    GNOME now asks whether the message/MPRIS indicator is closable.
    If yes it will be closed but if not it won't be closed.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5536
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2323>
    (cherry picked from commit 795723fe8533cc66cf5741ad81bd90e22aa90c3c)

 js/ui/messageList.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/messageList.js b/js/ui/messageList.js
index eb65596d69..acdada6791 100644
--- a/js/ui/messageList.js
+++ b/js/ui/messageList.js
@@ -526,8 +526,10 @@ var Message = GObject.registerClass({
 
         if (keysym == Clutter.KEY_Delete ||
             keysym == Clutter.KEY_KP_Delete) {
-            this.close();
-            return Clutter.EVENT_STOP;
+            if (this.canClose()) {
+                this.close();
+                return Clutter.EVENT_STOP;
+            }
         }
         return super.vfunc_key_press_event(keyEvent);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]