[gnome-shell/gnome-3-28] keyboard: Handle case where keyboardMonitor is unset



commit e94af7143091a08cb8f9d833531e3c5e7581f85f
Author: Sam Spilsbury <sam endlessm com>
Date:   Wed Oct 11 10:59:19 2017 +0000

    keyboard: Handle case where keyboardMonitor is unset
    
    This may be the case where keyboardIndex is -1, which may be the
    case where either the keyboard monitor hasn't been set yet, or
    the keyboard is being unmanaged and meta_window_get_monitor
    returns -1
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788882
    
    
    (cherry picked from commit 19e864ed3b85278ed1a9527ce3c29646328c19ec)

 js/ui/keyboard.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 66653d602..441384634 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -924,9 +924,11 @@ var Keyboard = new Lang.Class({
     },
 
     _relayout() {
-        if (this.actor == null)
-            return;
         let monitor = Main.layoutManager.keyboardMonitor;
+
+        if (this.actor == null || monitor == null)
+            return;
+
         let maxHeight = monitor.height / 3;
         this.actor.width = monitor.width;
         this.actor.height = maxHeight;


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