[gnome-shell] network: Close Wifi selection dialog when appropriate



commit f97a3522e5267b891a57c0091725949efe5cab5c
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Mar 14 20:32:50 2017 +0100

    network: Close Wifi selection dialog when appropriate
    
    Currently when the wifi selection dialog is open when the screen lock is
    activated, the dialog remains visible above the shield. This is clearly
    broken, so close the dialog automatically on session mode changes if the
    mode doesn't allow settings (as changing the access point is arguably a
    user setting).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780054

 js/ui/status/network.js |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index bedfc5e..4f23fd3 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -769,6 +769,14 @@ const NMWirelessDialog = new Lang.Class({
         this._scanTimeoutId = Mainloop.timeout_add_seconds(15, Lang.bind(this, this._onScanTimeout));
         GLib.Source.set_name_by_id(this._scanTimeoutId, '[gnome-shell] this._onScanTimeout');
         this._onScanTimeout();
+
+        let id = Main.sessionMode.connect('updated', () => {
+            if (Main.sessionMode.allowSettings)
+                return;
+
+            Main.sessionMode.disconnect(id);
+            this.close();
+        });
     },
 
     destroy: function() {


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