[gnome-shell/gnome-40] boxpointer: Handle non-widget source actors



commit 1eb553532bb42ff1b8a419b480e11eca346c1355
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jun 29 20:13:00 2021 +0200

    boxpointer: Handle non-widget source actors
    
    There is no convincing reason why source actors must be widgets,
    so lift that restriction.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1903>
    (cherry picked from commit 16d371873584760694aa9dbd137d09a15bc0310a)

 js/ui/boxpointer.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index c664ae748b..82d28cd834 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -464,8 +464,10 @@ var BoxPointer = GObject.registerClass({
         this._workArea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex);
 
         // Position correctly relative to the sourceActor
-        let sourceNode = sourceActor.get_theme_node();
-        let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());
+        const sourceAllocation = sourceActor.get_allocation_box();
+        const sourceContentBox = sourceActor instanceof St.Widget
+            ? sourceActor.get_theme_node().get_content_box(sourceAllocation)
+            : 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;


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