[Xfce4-commits] [apps/xfdashboard] 01/01: Experimental new code to determine preferred size of XfdashboardLiveWindowSimple. The new code will not check the size of window content (XfdashboardWindowContent) anymore but ask the window directly for its size.

noreply at xfce.org noreply at xfce.org
Thu Mar 23 09:11:36 CET 2017


This is an automated email from the git hooks/post-receive script.

nomad pushed a commit to branch master
in repository apps/xfdashboard.

commit 6071b997e6ce4d8053c30a9489000e12abb9f76c
Author: Stephan Haller <nomad at froevel.de>
Date:   Thu Mar 23 09:10:20 2017 +0100

    Experimental new code to determine preferred size of XfdashboardLiveWindowSimple. The new code will not check the size of window content (XfdashboardWindowContent) anymore but ask the window directly for its size.
    
    Experimental new code for issue GH #141
---
 libxfdashboard/live-window-simple.c | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/libxfdashboard/live-window-simple.c b/libxfdashboard/live-window-simple.c
index 5cf557b..8797e52 100644
--- a/libxfdashboard/live-window-simple.c
+++ b/libxfdashboard/live-window-simple.c
@@ -22,6 +22,8 @@
  * 
  */
 
+#define SIZE_CALCULATION_NEW /* Use new code path to determine preferred size */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -268,8 +270,21 @@ static void _xfdashboard_live_window_simple_get_preferred_height(ClutterActor *s
 	minHeight=naturalHeight=0.0f;
 
 	/* Determine size of window if available and visible (should usually be the largest actor) */
+#ifdef SIZE_CALCULATION_NEW
+#warning "_xfdashboard_live_window_simple_get_preferred_height: new code path selected"
 	if(priv->actorWindow &&
-		clutter_actor_is_visible(priv->actorWindow))
+		clutter_actor_is_visible(priv->actorWindow) &&
+		priv->window)
+	{
+		gint							windowHeight;
+
+		xfdashboard_window_tracker_window_get_size(priv->window, NULL, &windowHeight);
+		if(windowHeight>minHeight) minHeight=windowHeight;
+		if(windowHeight>naturalHeight) naturalHeight=windowHeight;
+	}
+#else
+	if(priv->actorWindow &&
+		clutter_actor_is_visible(priv->actorWindow)
 	{
 		content=clutter_actor_get_content(priv->actorWindow);
 		if(content &&
@@ -280,6 +295,7 @@ static void _xfdashboard_live_window_simple_get_preferred_height(ClutterActor *s
 			if(childNaturalHeight>naturalHeight) naturalHeight=childNaturalHeight;
 		}
 	}
+#endif
 
 	/* Store sizes computed */
 	if(outMinHeight) *outMinHeight=minHeight;
@@ -299,6 +315,19 @@ static void _xfdashboard_live_window_simple_get_preferred_width(ClutterActor *se
 	minWidth=naturalWidth=0.0f;
 
 	/* Determine size of window if available and visible (should usually be the largest actor) */
+#ifdef SIZE_CALCULATION_NEW
+#warning "_xfdashboard_live_window_simple_get_preferred_width: new code path selected"
+	if(priv->actorWindow &&
+		clutter_actor_is_visible(priv->actorWindow) &&
+		priv->window)
+	{
+		gint							windowWidth;
+
+		xfdashboard_window_tracker_window_get_size(priv->window, &windowWidth, NULL);
+		if(windowWidth>minWidth) minWidth=windowWidth;
+		if(windowWidth>naturalWidth) naturalWidth=windowWidth;
+	}
+#else
 	if(priv->actorWindow &&
 		clutter_actor_is_visible(priv->actorWindow))
 	{
@@ -311,6 +340,7 @@ static void _xfdashboard_live_window_simple_get_preferred_width(ClutterActor *se
 			if(childNaturalWidth>naturalWidth) naturalWidth=childNaturalWidth;
 		}
 	}
+#endif
 
 	/* Store sizes computed */
 	if(outMinWidth) *outMinWidth=minWidth;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list