[gnome-shell/gnome-3-16] windowMenu: Close when corresponding window goes away
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-16] windowMenu: Close when corresponding window goes away
- Date: Thu, 21 May 2015 16:21:55 +0000 (UTC)
commit 49856d4961a7512ffc26d0d9d69d0ae0c3d8fbb4
Author: Florian Müllner <fmuellner gnome org>
Date: Thu May 21 18:14:51 2015 +0200
windowMenu: Close when corresponding window goes away
The menu is clearly associated with a particular window, so keeping
it around when the window is gone doesn't make sense - in case of
the window menu, it is actually harmful as every action will act on
the invalidated window and result in a crash. So just dismiss the
menu when the menu is unmanaged.
https://bugzilla.gnome.org/show_bug.cgi?id=749529
js/ui/windowMenu.js | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/windowMenu.js b/js/ui/windowMenu.js
index 3d378fa..47df48b 100644
--- a/js/ui/windowMenu.js
+++ b/js/ui/windowMenu.js
@@ -167,6 +167,10 @@ const WindowMenuManager = new Lang.Class({
menu.connect('activate', function() {
window.check_alive(global.get_current_time());
});
+ let destroyId = window.connect('unmanaged',
+ function() {
+ menu.close();
+ });
this._sourceActor.set_size(rect.width, rect.height);
this._sourceActor.set_position(rect.x, rect.y);
@@ -180,6 +184,7 @@ const WindowMenuManager = new Lang.Class({
this._sourceActor.hide();
menu.destroy();
+ window.disconnect(destroyId);
}));
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]