[Xfce4-commits] [apps/xfdashboard] 01/01: Only resize stage to screen size and listen for further screen size changes to resize stage if compiled against Clutter prior to version 0.17.2 because from this version on Clutter seems to handle resizes of stage window in X11 correctly by itself.
noreply at xfce.org
noreply at xfce.org
Thu May 28 08:16:28 CEST 2015
This is an automated email from the git hooks/post-receive script.
nomad pushed a commit to branch master
in repository apps/xfdashboard.
commit e3777b86cf1165fbd2c5f0c2495519986036c2e2
Author: Stephan Haller <nomad at froevel.de>
Date: Thu May 28 08:15:07 2015 +0200
Only resize stage to screen size and listen for further screen size changes to resize stage if compiled against Clutter prior to version 0.17.2 because from this version on Clutter seems to handle resizes of stage window in X11 correctly by itself.
---
xfdashboard/stage.c | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/xfdashboard/stage.c b/xfdashboard/stage.c
index 4ebbf16..3c56c42 100644
--- a/xfdashboard/stage.c
+++ b/xfdashboard/stage.c
@@ -1265,6 +1265,7 @@ 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,
@@ -1293,6 +1294,7 @@ static void _xfdashboard_stage_on_screen_size_changed(XfdashboardStage *self,
clutter_actor_set_size(CLUTTER_ACTOR(self), inWidth, inHeight);
}
}
+#endif
/* IMPLEMENTATION: ClutterActor */
@@ -1580,7 +1582,6 @@ static void xfdashboard_stage_init(XfdashboardStage *self)
ClutterConstraint *widthConstraint;
ClutterConstraint *heightConstraint;
ClutterColor transparent;
- gint screenWidth, screenHeight;
priv=self->priv=XFDASHBOARD_STAGE_GET_PRIVATE(self);
@@ -1643,10 +1644,6 @@ static void xfdashboard_stage_init(XfdashboardStage *self)
"primary-monitor-changed",
G_CALLBACK(_xfdashboard_stage_on_primary_monitor_changed),
self);
- g_signal_connect_swapped(priv->windowTracker,
- "screen-size-changed",
- G_CALLBACK(_xfdashboard_stage_on_screen_size_changed),
- self);
/* Connect signal to application */
application=xfdashboard_application_get_default();
@@ -1665,10 +1662,25 @@ static void xfdashboard_stage_init(XfdashboardStage *self)
G_CALLBACK(_xfdashboard_stage_on_application_theme_changed),
self);
- /* Resize stage to match screen size */
- 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);
+#if !CLUTTER_CHECK_VERSION(0, 17, 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);
+
+ g_signal_connect_swapped(priv->windowTracker,
+ "screen-size-changed",
+ G_CALLBACK(_xfdashboard_stage_on_screen_size_changed),
+ self);
+ }
+#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