[Xfce4-commits] [apps/xfdashboard] 10/31: Reimplement old hack to resize stage to screen size but this time also listen for screen size changes.
noreply at xfce.org
noreply at xfce.org
Thu Jun 11 19:57:05 CEST 2015
This is an automated email from the git hooks/post-receive script.
nomad pushed a commit to annotated tag 0.4.1
in repository apps/xfdashboard.
commit 08685e959ce253f61a7e37ad7d60fccf93b7c17e
Author: Stephan Haller <nomad at froevel.de>
Date: Tue May 26 18:37:00 2015 +0200
Reimplement old hack to resize stage to screen size but this time also listen for screen size changes.
Hopefully fixes problems reported at issue GH #95
---
xfdashboard/stage.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/xfdashboard/stage.c b/xfdashboard/stage.c
index 8ae95d6..fb339d6 100644
--- a/xfdashboard/stage.c
+++ b/xfdashboard/stage.c
@@ -1247,6 +1247,35 @@ static void _xfdashboard_stage_on_monitor_removed(XfdashboardStage *self,
}
}
+/* Screen size has changed */
+static void _xfdashboard_stage_on_screen_size_changed(XfdashboardStage *self,
+ gint inWidth,
+ gint inHeight,
+ gpointer inUserData)
+{
+ gfloat stageWidth, stageHeight;
+
+ g_return_if_fail(XFDASHBOARD_IS_STAGE(self));
+ g_return_if_fail(inWidth>0);
+ g_return_if_fail(inHeight>0);
+
+ /* Get current size of stage */
+ clutter_actor_get_size(CLUTTER_ACTOR(self), &stageWidth, &stageHeight);
+
+ /* If either stage's width or height does not match screen's width or height
+ * resize the stage.
+ */
+ if((gint)stageWidth!=inWidth ||
+ (gint)stageHeight!=inHeight)
+ {
+ g_debug("Screen resized to %dx%d but stage has size of %dx%d - resizing stage",
+ inWidth, inHeight,
+ (gint)stageWidth, (gint)stageHeight);
+
+ clutter_actor_set_size(CLUTTER_ACTOR(self), inWidth, inHeight);
+ }
+}
+
/* IMPLEMENTATION: ClutterActor */
/* The stage actor should be shown */
@@ -1533,6 +1562,7 @@ static void xfdashboard_stage_init(XfdashboardStage *self)
ClutterConstraint *widthConstraint;
ClutterConstraint *heightConstraint;
ClutterColor transparent;
+ gint screenWidth, screenHeight;
priv=self->priv=XFDASHBOARD_STAGE_GET_PRIVATE(self);
@@ -1595,6 +1625,10 @@ 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();
@@ -1612,6 +1646,11 @@ static void xfdashboard_stage_init(XfdashboardStage *self)
"theme-changed",
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);
}
/* 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