From b160e44dab1260136d244e29eeb76508fa20d2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Sat, 27 Feb 2021 11:37:24 +0100 Subject: [PATCH] keyboard: Stop offsetting the focus rectangle The focus rectangle of the OSK currently gets stored with an offset that removes the global coordinates and makes it window-local coordinates. This offsetting has been applied since the introduction of the FocusTracker with commit fc5ab4470445992b1ad4338290deb24e6b1c5ce2 and it seems there's no real reason for it. By removing this, we also emit position-changed when the window has moved but the window-local coordinates stayed the same. We really want to emit position-changed in that case because it might affect whether the window needs to be shifted up. Part-of: --- js/ui/keyboard.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 37b077d12..43b4e5d27 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -624,8 +624,6 @@ var FocusTracker = class { const rectInsideFrameRect = grapheneFrameRect.intersection(rect)[0]; if (!rectInsideFrameRect) return; - - rect.offset(-frameRect.x, -frameRect.y); } if (this._rect && this._rect.equal(rect)) @@ -643,12 +641,6 @@ var FocusTracker = class { height: this._rect.size.height, }; - if (this._currentWindow) { - let frameRect = this._currentWindow.get_frame_rect(); - rect.x += frameRect.x; - rect.y += frameRect.y; - } - return rect; } };