From 265d2c93fd1fba320b0c4459ba2af4fce82226dd Mon Sep 17 00:00:00 2001
From: Sardem FF7 <sardemff7.pub@gmail.com>
Date: Wed, 2 Feb 2011 23:38:55 +0100
Subject: [PATCH 2/2] Use the right source center for the arrow pointing

Change the reference center position using the child of the source to
avoid problems of when using different padding
---
 js/ui/boxpointer.js    |    5 ++++-
 src/st/st-theme-node.c |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
index ecdfeb5..206221b 100644
--- a/js/ui/boxpointer.js
+++ b/js/ui/boxpointer.js
@@ -309,9 +309,12 @@ BoxPointer.prototype = {
         this.actor.show();
 
         // Position correctly relative to the sourceActor
+        let sourceNode = sourceActor.get_theme_node();
+        let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());
         let [sourceX, sourceY] = sourceActor.get_transformed_position();
         let [sourceWidth, sourceHeight] = sourceActor.get_transformed_size();
-        let [sourceCenterX, sourceCenterY] = [sourceX + (sourceWidth / 2), sourceY + (sourceHeight / 2)];
+        let sourceCenterX = sourceX + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) / 2;
+        let sourceCenterY = sourceY + sourceContentBox.y1 + (sourceContentBox.y2 - sourceContentBox.y1) / 2;
         let [minWidth, minHeight, natWidth, natHeight] = this.actor.get_preferred_size();
 
         // We also want to keep it onscreen, and separated from the
diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c
index 6fb579f..140d5d1 100644
--- a/src/st/st-theme-node.c
+++ b/src/st/st-theme-node.c
@@ -3184,7 +3184,7 @@ st_theme_node_adjust_preferred_height (StThemeNode  *node,
  * st_theme_node_get_content_box:
  * @node: a #StThemeNode
  * @allocation: the box allocated to a #ClutterAlctor
- * @content_box: computed box occupied by the actor's content
+ * @content_box: (out): computed box occupied by the actor's content
  *
  * Gets the box within an actor's allocation that contents the content
  * of an actor (excluding borders and padding). This is a convenience function
-- 
1.7.4

