malposition of boxponters with non-widget source actors
Affected version
Arch / Gnome Shell 41.beta
Bug summary
The IBus candidate box is shifted twice the expected distance to the left.
Steps to reproduce
- Install an input method like
ibus-libpinyin
oribus-rime
; - Run
ibus-daemon -rdx
in a terminal, then add the method fromSettings > Keyboard > Input Sources
; - Press Super+Space to enable the method, then type anything anywhere;
What happened
The candidate box appears at an unexpected place.
What did you expect to happen
The related MR should be !1903 (merged). And I got a temporary patch:
diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index c7a8f92d0..987417646 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -470,8 +470,8 @@ var BoxPointer = GObject.registerClass({
: sourceAllocation;
let sourceTopLeft = this._sourceExtents.get_top_left();
let sourceBottomRight = this._sourceExtents.get_bottom_right();
- let sourceCenterX = sourceTopLeft.x + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) * this._sourceAlignment;
- let sourceCenterY = sourceTopLeft.y + sourceContentBox.y1 + (sourceContentBox.y2 - sourceContentBox.y1) * this._sourceAlignment;
+ let sourceCenterX = sourceTopLeft.x + (sourceContentBox.x2 - sourceContentBox.x1) * this._sourceAlignment;
+ let sourceCenterY = sourceTopLeft.y + (sourceContentBox.y2 - sourceContentBox.y1) * this._sourceAlignment;
let [, , natWidth, natHeight] = this.get_preferred_size();
// We also want to keep it onscreen, and separated from the
sourceTopLeft.x
(y) and sourceContextBox.x1
(y) are the same in Clutter.Actor
but sourceContextBox.x1
(y) is always 0 in St.Widget
with logged. So I simply removed sourceContextBox.x1
(y).
Not sure if it's the right way to fix this problem, but it did fix that for me.
Anyway, hopefully this issue will be fixed quickly before the code freeze to reduce the impact on input method users. Thanks!
Relevant logs, screenshots, screencasts etc.
Edited by tuberry