[gnome-shell/gnome-40] boxpointer: Fix positioning with non-widget sources
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-40] boxpointer: Fix positioning with non-widget sources
- Date: Tue, 21 Sep 2021 18:08:47 +0000 (UTC)
commit 2809b5899da286666fe063abcb28c6db7f0ef82c
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Sep 1 20:37:13 2021 +0200
boxpointer: Fix positioning with non-widget sources
Commit 16d371873 lifted the requirement for source actors to be
widgets, then got it wrong :rolling_eyes:
The content box is expected to be in actor coordinates, so the
allocation must be translated to (0, 0).
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4593
(cherry picked from commit 0fd205ce54ccae0129cb2f3a4f8f92d842fe0d51)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1982>
js/ui/boxpointer.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index c7a8f92d01..be9c57ce03 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -467,7 +467,10 @@ var BoxPointer = GObject.registerClass({
const sourceAllocation = sourceActor.get_allocation_box();
const sourceContentBox = sourceActor instanceof St.Widget
? sourceActor.get_theme_node().get_content_box(sourceAllocation)
- : sourceAllocation;
+ : new Clutter.ActorBox({
+ x2: sourceAllocation.get_width(),
+ y2: sourceAllocation.get_height(),
+ });
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]