Blame SOURCES/0001-keyboard-Handle-no-window-case-in-FocusTracker.patch

cd52c0
From 6a796675bd7815087881b799ff5fc79e9ce2b0bf Mon Sep 17 00:00:00 2001
cd52c0
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
cd52c0
Date: Mon, 16 Jul 2018 23:36:38 +0000
cd52c0
Subject: [PATCH] keyboard: Handle no-window case in FocusTracker
cd52c0
cd52c0
For windows, the cursor location needs to be adjusted by the frame
cd52c0
offsets. However we cannot assume that there is a window, as the
cd52c0
shell itself can have the key focus.
cd52c0
cd52c0
https://gitlab.gnome.org/GNOME/gnome-shell/issues/414
cd52c0
cd52c0
cd52c0
(cherry picked from commit 0dee82fb9fa974ebdb4dd77fd85535a6edf207fd)
cd52c0
---
cd52c0
 js/ui/keyboard.js | 18 +++++++++++++-----
cd52c0
 1 file changed, 13 insertions(+), 5 deletions(-)
cd52c0
cd52c0
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
cd52c0
index 5fcdf988a7..66653d6027 100644
cd52c0
--- a/js/ui/keyboard.js
cd52c0
+++ b/js/ui/keyboard.js
cd52c0
@@ -533,17 +533,25 @@ var FocusTracker = new Lang.Class({
cd52c0
     },
cd52c0
 
cd52c0
     _setCurrentRect(rect) {
cd52c0
-        let frameRect = this._currentWindow.get_frame_rect();
cd52c0
-        rect.x -= frameRect.x;
cd52c0
-        rect.y -= frameRect.y;
cd52c0
+        if (this._currentWindow) {
cd52c0
+            let frameRect = this._currentWindow.get_frame_rect();
cd52c0
+            rect.x -= frameRect.x;
cd52c0
+            rect.y -= frameRect.y;
cd52c0
+        }
cd52c0
 
cd52c0
         this._rect = rect;
cd52c0
         this.emit('position-changed');
cd52c0
     },
cd52c0
 
cd52c0
     getCurrentRect() {
cd52c0
-        let frameRect = this._currentWindow.get_frame_rect();
cd52c0
-        let rect = { x: this._rect.x + frameRect.x, y: this._rect.y + frameRect.y, width: this._rect.width, height: this._rect.height };
cd52c0
+        let rect = { x: this._rect.x, y: this._rect.y,
cd52c0
+                     width: this._rect.width, height: this._rect.height };
cd52c0
+
cd52c0
+        if (this._currentWindow) {
cd52c0
+            let frameRect = this._currentWindow.get_frame_rect();
cd52c0
+            rect.x += frameRect.x;
cd52c0
+            rect.y += frameRect.y;
cd52c0
+        }
cd52c0
 
cd52c0
         return rect;
cd52c0
     }
cd52c0
-- 
cd52c0
2.17.1
cd52c0