[gnome-shell] BoxPointer: account for border width when requesting size



commit e426f8ac473d31792e64eb7d4f7f9343a787d898
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sun Oct 6 23:32:51 2013 +0200

    BoxPointer: account for border width when requesting size
    
    We must reduce the forWidth in the call to get_preferred_height()
    with the border width, otherwise we might request a smaller height
    that we actually need and overflow.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696564

 js/ui/boxpointer.js |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index 80dd11d..c8a15d3 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -185,7 +185,9 @@ const BoxPointer = new Lang.Class({
     },
 
     _getPreferredHeight: function(actor, forWidth, alloc) {
-        let [minSize, naturalSize] = this.bin.get_preferred_height(forWidth);
+        let themeNode = this.actor.get_theme_node();
+        let borderWidth = themeNode.get_length('-arrow-border-width');
+        let [minSize, naturalSize] = this.bin.get_preferred_height(forWidth - 2 * borderWidth);
         alloc.min_size = minSize;
         alloc.natural_size = naturalSize;
         this._adjustAllocationForArrow(false, alloc);


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