[gnome-shell/gnome-3-36] boxpointer: Call set_allocation before allocating child
- From: verdre <jonasd src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-shell/gnome-3-36] boxpointer: Call set_allocation before allocating child
 
- Date: Tue, 28 Apr 2020 16:24:16 +0000 (UTC)
 
commit 802c2fe5326f23529a24f87d13185c96887a7669
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Tue Mar 10 10:05:13 2020 +0000
    boxpointer: Call set_allocation before allocating child
    
    It's important to update the allocation of the parent before allocating
    its children, it's an assumption we make in a lot of places.
    
    This broke resource scale calculation for boxpointers and their
    children when multiple monitors with different scales are used and the
    primary monitor is not positioned at x=0, y=0.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1615
    
    
    (cherry picked from commit 63a0e521fd37fe5f19ac29a540fa00b03db7036c)
 js/ui/boxpointer.js | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index 03cb4a567f..60540621d2 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -197,6 +197,11 @@ var BoxPointer = GObject.registerClass({
     }
 
     vfunc_allocate(box, flags) {
+        if (this._sourceActor && this._sourceActor.mapped) {
+            this._reposition(box);
+            this._updateFlip(box);
+        }
+
         this.set_allocation(box, flags);
 
         let themeNode = this.get_theme_node();
@@ -230,12 +235,6 @@ var BoxPointer = GObject.registerClass({
             break;
         }
         this.bin.allocate(childBox, flags);
-
-        if (this._sourceActor && this._sourceActor.mapped) {
-            this._reposition(box);
-            this._updateFlip(box);
-            this.set_allocation(box, flags);
-        }
     }
 
     _drawBorder(area) {
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]