[Xfce4-commits] [apps/xfdashboard] 02/07: Decide at run-time not at compile-time if we need to track screen size changes to adjust stage size.

noreply at xfce.org noreply at xfce.org
Thu Jun 11 19:57:29 CEST 2015


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

nomad pushed a commit to annotated tag 0.4.2
in repository apps/xfdashboard.

commit 3c0951bd304f5f912ab04bbdbc86385b39e71611
Author: Stephan Haller <nomad at froevel.de>
Date:   Sat May 30 11:24:42 2015 +0200

    Decide at run-time not at compile-time if we need to track screen size changes to adjust stage size.
    
    I hope this fixes GH #95 finally.
---
 xfdashboard/stage.c |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/xfdashboard/stage.c b/xfdashboard/stage.c
index b2b838b..563fa92 100644
--- a/xfdashboard/stage.c
+++ b/xfdashboard/stage.c
@@ -1265,7 +1265,6 @@ static void _xfdashboard_stage_on_monitor_removed(XfdashboardStage *self,
 	}
 }
 
-#if !CLUTTER_CHECK_VERSION(0, 17, 2)
 /* Screen size has changed */
 static void _xfdashboard_stage_on_screen_size_changed(XfdashboardStage *self,
 														gint inWidth,
@@ -1294,7 +1293,6 @@ static void _xfdashboard_stage_on_screen_size_changed(XfdashboardStage *self,
 		clutter_actor_set_size(CLUTTER_ACTOR(self), inWidth, inHeight);
 	}
 }
-#endif
 
 /* IMPLEMENTATION: ClutterActor */
 
@@ -1662,15 +1660,17 @@ static void xfdashboard_stage_init(XfdashboardStage *self)
 								G_CALLBACK(_xfdashboard_stage_on_application_theme_changed),
 								self);
 
-#if !CLUTTER_CHECK_VERSION(0, 17, 2)
+	/* Resize stage to match screen size and listen for futher screen size changes
+	 * to resize stage again.
+	 * This should only be needed when compiled against Clutter prior to 0.17.2
+	 * because this version or newer ones seem to handle window resizes correctly.
+	 */
+	if(clutter_major_version<1 ||
+		(clutter_major_version==1 && clutter_minor_version<17) ||
+		(clutter_major_version==1 && clutter_minor_version==17 && clutter_micro_version<2))
 	{
 		gint					screenWidth, screenHeight;
 
-		/* Resize stage to match screen size and listen for futher screen size changes
-		 * to resize stage again.
-		 * This should only be needed when compiled against Clutter prior to 0.17.2
-		 * because this version or newer ones seem to handle window resizes correctly.
-		 */
 		screenWidth=xfdashboard_window_tracker_get_screen_width(priv->windowTracker);
 		screenHeight=xfdashboard_window_tracker_get_screen_height(priv->windowTracker);
 		_xfdashboard_stage_on_screen_size_changed(self, screenWidth, screenHeight, priv->windowTracker);
@@ -1679,8 +1679,9 @@ static void xfdashboard_stage_init(XfdashboardStage *self)
 									"screen-size-changed",
 									G_CALLBACK(_xfdashboard_stage_on_screen_size_changed),
 									self);
+
+		g_message("Tracking screen resizes to resize stage");
 	}
-#endif
 }
 
 /* IMPLEMENTATION: Public API */

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


More information about the Xfce4-commits mailing list