From 795723fe8533cc66cf5741ad81bd90e22aa90c3c Mon Sep 17 00:00:00 2001 From: PhilProg Date: Fri, 3 Jun 2022 04:53:11 +0000 Subject: [PATCH] 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: --- 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 f4e43f7ae..29e76752b 100644 --- a/js/ui/messageList.js +++ b/js/ui/messageList.js @@ -535,8 +535,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); }