[Xfce4-commits] [apps/xfdashboard] 01/01: Instead of window functions which just turn a window into stage window, it should handle it completely from setting it up to showing it. In addition the function to "unmake" a stage window should also hide the window directly. Because of this change in functionality the function were renamed.

noreply at xfce.org noreply at xfce.org
Wed May 10 16:13:10 CEST 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 c57eee718d15d6ef13a807f10bba784be4ea17f7
Author: Stephan Haller <nomad at froevel.de>
Date:   Wed May 10 16:09:40 2017 +0200

    Instead of window functions which just turn a window into stage window, it should handle it completely from setting it up to showing it. In addition the function to "unmake" a stage window should also hide the window directly. Because of this change in functionality the function were renamed.
---
 libxfdashboard/stage.c                         | 10 ++++------
 libxfdashboard/window-tracker-window.c         | 20 ++++++++++----------
 libxfdashboard/window-tracker-window.h         |  9 ++++-----
 libxfdashboard/x11/window-tracker-window-x11.c | 18 ++++++++++++------
 4 files changed, 30 insertions(+), 27 deletions(-)

diff --git a/libxfdashboard/stage.c b/libxfdashboard/stage.c
index 7e2365a..da24dba 100644
--- a/libxfdashboard/stage.c
+++ b/libxfdashboard/stage.c
@@ -639,7 +639,7 @@ static void _xfdashboard_stage_on_window_opened(XfdashboardStage *self,
 
 	/* Set up window for use as stage window */
 	priv->stageWindow=inWindow;
-	xfdashboard_window_tracker_window_make_stage_window(priv->stageWindow);
+	xfdashboard_window_tracker_window_show_stage(priv->stageWindow);
 
 	/* Disconnect signal handler as this is a one-time setup of stage window */
 	XFDASHBOARD_DEBUG(self, ACTOR, "Stage window was opened and set up. Removing signal handler");
@@ -699,8 +699,7 @@ static void _xfdashboard_stage_on_application_suspend(XfdashboardStage *self, gp
 	 */
 	if(priv->stageWindow)
 	{
-		xfdashboard_window_tracker_window_unmake_stage_window(priv->stageWindow);
-		xfdashboard_window_tracker_window_hide(priv->stageWindow);
+		xfdashboard_window_tracker_window_hide_stage(priv->stageWindow);
 	}
 
 	/* Hide tooltip */
@@ -808,8 +807,7 @@ static void _xfdashboard_stage_on_application_resume(XfdashboardStage *self, gpo
 		}
 
 		/* Set up stage and show it */
-		xfdashboard_window_tracker_window_make_stage_window(priv->stageWindow);
-		xfdashboard_window_tracker_window_show(priv->stageWindow);
+		xfdashboard_window_tracker_window_show_stage(priv->stageWindow);
 	}
 		/* ... otherwise set it up by calling clutter_actor_show() etc. */
 		else
@@ -1582,7 +1580,7 @@ static void _xfdashboard_stage_dispose(GObject *inObject)
 	/* Release allocated resources */
 	if(priv->stageWindow)
 	{
-		xfdashboard_window_tracker_window_unmake_stage_window(priv->stageWindow);
+		xfdashboard_window_tracker_window_hide_stage(priv->stageWindow);
 		priv->stageWindow=NULL;
 	}
 
diff --git a/libxfdashboard/window-tracker-window.c b/libxfdashboard/window-tracker-window.c
index 68c6751..80c1ed6 100644
--- a/libxfdashboard/window-tracker-window.c
+++ b/libxfdashboard/window-tracker-window.c
@@ -762,8 +762,8 @@ ClutterStage* xfdashboard_window_tracker_window_get_stage(XfdashboardWindowTrack
 	return(NULL);
 }
 
-/* Set up window for use as stage window */
-void xfdashboard_window_tracker_window_make_stage_window(XfdashboardWindowTrackerWindow *self)
+/* Set up and show window for use as stage window */
+void xfdashboard_window_tracker_window_show_stage(XfdashboardWindowTrackerWindow *self)
 {
 	XfdashboardWindowTrackerWindowInterface		*iface;
 
@@ -772,18 +772,18 @@ void xfdashboard_window_tracker_window_make_stage_window(XfdashboardWindowTracke
 	iface=XFDASHBOARD_WINDOW_TRACKER_WINDOW_GET_IFACE(self);
 
 	/* Call virtual function */
-	if(iface->make_stage_window)
+	if(iface->show_stage)
 	{
-		iface->make_stage_window(self);
+		iface->show_stage(self);
 		return;
 	}
 
 	/* If we get here the virtual function was not overridden */
-	XFDASHBOARD_WINDOWS_TRACKER_WINDOW_WARN_NOT_IMPLEMENTED(self, "make_stage_window");
+	XFDASHBOARD_WINDOWS_TRACKER_WINDOW_WARN_NOT_IMPLEMENTED(self, "show_stage");
 }
 
-/* Unset up stage window (only remove connected signals) */
-void xfdashboard_window_tracker_window_unmake_stage_window(XfdashboardWindowTrackerWindow *self)
+/* Unset up and hide stage window */
+void xfdashboard_window_tracker_window_hide_stage(XfdashboardWindowTrackerWindow *self)
 {
 	XfdashboardWindowTrackerWindowInterface		*iface;
 
@@ -792,14 +792,14 @@ void xfdashboard_window_tracker_window_unmake_stage_window(XfdashboardWindowTrac
 	iface=XFDASHBOARD_WINDOW_TRACKER_WINDOW_GET_IFACE(self);
 
 	/* Call virtual function */
-	if(iface->unmake_stage_window)
+	if(iface->hide_stage)
 	{
-		iface->unmake_stage_window(self);
+		iface->hide_stage(self);
 		return;
 	}
 
 	/* If we get here the virtual function was not overridden */
-	XFDASHBOARD_WINDOWS_TRACKER_WINDOW_WARN_NOT_IMPLEMENTED(self, "unmake_stage_window");
+	XFDASHBOARD_WINDOWS_TRACKER_WINDOW_WARN_NOT_IMPLEMENTED(self, "hide_stage");
 }
 
 /* Get process ID owning the requested window */
diff --git a/libxfdashboard/window-tracker-window.h b/libxfdashboard/window-tracker-window.h
index b03ee8b..f57f956 100644
--- a/libxfdashboard/window-tracker-window.h
+++ b/libxfdashboard/window-tracker-window.h
@@ -130,8 +130,8 @@ struct _XfdashboardWindowTrackerWindowInterface
 	ClutterContent* (*get_content)(XfdashboardWindowTrackerWindow *self);
 
 	ClutterStage* (*get_stage)(XfdashboardWindowTrackerWindow *self);
-	void (*make_stage_window)(XfdashboardWindowTrackerWindow *self);
-	void (*unmake_stage_window)(XfdashboardWindowTrackerWindow *self);
+	void (*show_stage)(XfdashboardWindowTrackerWindow *self);
+	void (*hide_stage)(XfdashboardWindowTrackerWindow *self);
 
 	/* Signals */
 	void (*name_changed)(XfdashboardWindowTrackerWindow *self);
@@ -205,9 +205,8 @@ void xfdashboard_window_tracker_window_close(XfdashboardWindowTrackerWindow *sel
 
 gboolean xfdashboard_window_tracker_window_is_stage(XfdashboardWindowTrackerWindow *self);
 ClutterStage* xfdashboard_window_tracker_window_get_stage(XfdashboardWindowTrackerWindow *self);
-
-void xfdashboard_window_tracker_window_make_stage_window(XfdashboardWindowTrackerWindow *self);
-void xfdashboard_window_tracker_window_unmake_stage_window(XfdashboardWindowTrackerWindow *self);
+void xfdashboard_window_tracker_window_show_stage(XfdashboardWindowTrackerWindow *self);
+void xfdashboard_window_tracker_window_hide_stage(XfdashboardWindowTrackerWindow *self);
 
 gint xfdashboard_window_tracker_window_get_pid(XfdashboardWindowTrackerWindow *self);
 gchar** xfdashboard_window_tracker_window_get_instance_names(XfdashboardWindowTrackerWindow *self);
diff --git a/libxfdashboard/x11/window-tracker-window-x11.c b/libxfdashboard/x11/window-tracker-window-x11.c
index 50787fc..7cf632c 100644
--- a/libxfdashboard/x11/window-tracker-window-x11.c
+++ b/libxfdashboard/x11/window-tracker-window-x11.c
@@ -1451,8 +1451,8 @@ static ClutterStage* _xfdashboard_window_tracker_window_x11_window_tracker_windo
 	return(foundStage);
 }
 
-/* Set up window for use as stage window */
-static void _xfdashboard_window_tracker_window_x11_window_tracker_window_make_stage_window(XfdashboardWindowTrackerWindow *inWindow)
+/* Set up and show window for use as stage */
+static void _xfdashboard_window_tracker_window_x11_window_tracker_window_show_stage(XfdashboardWindowTrackerWindow *inWindow)
 {
 	XfdashboardWindowTrackerWindowX11			*self;
 	XfdashboardWindowTrackerWindowX11Private	*priv;
@@ -1553,10 +1553,13 @@ static void _xfdashboard_window_tracker_window_x11_window_tracker_window_make_st
 																	height,
 																	self);
 	g_object_unref(windowTracker);
+
+	/* Now the window is set up and we can show it */
+	xfdashboard_window_tracker_window_show(XFDASHBOARD_WINDOW_TRACKER_WINDOW(self));
 }
 
-/* Unset up stage window (only remove connected signals) */
-static void _xfdashboard_window_tracker_window_x11_window_tracker_window_unmake_stage_window(XfdashboardWindowTrackerWindow *inWindow)
+/* Unset up and hide stage window */
+static void _xfdashboard_window_tracker_window_x11_window_tracker_window_hide_stage(XfdashboardWindowTrackerWindow *inWindow)
 {
 	XfdashboardWindowTrackerWindowX11			*self;
 	XfdashboardWindowTrackerWindowX11Private	*priv;
@@ -1577,6 +1580,9 @@ static void _xfdashboard_window_tracker_window_x11_window_tracker_window_unmake_
 		return;
 	}
 
+	/* First hide window before removing signals etc. */
+	xfdashboard_window_tracker_window_hide(XFDASHBOARD_WINDOW_TRACKER_WINDOW(self));
+
 	/* Get screen of window */
 	screen=wnck_window_get_screen(WNCK_WINDOW(priv->window));
 
@@ -1675,8 +1681,8 @@ static void _xfdashboard_window_tracker_window_x11_window_tracker_window_iface_i
 	iface->get_content=_xfdashboard_window_tracker_window_x11_window_tracker_window_get_content;
 
 	iface->get_stage=_xfdashboard_window_tracker_window_x11_window_tracker_window_get_stage;
-	iface->make_stage_window=_xfdashboard_window_tracker_window_x11_window_tracker_window_make_stage_window;
-	iface->unmake_stage_window=_xfdashboard_window_tracker_window_x11_window_tracker_window_unmake_stage_window;
+	iface->show_stage=_xfdashboard_window_tracker_window_x11_window_tracker_window_show_stage;
+	iface->hide_stage=_xfdashboard_window_tracker_window_x11_window_tracker_window_hide_stage;
 }
 
 

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


More information about the Xfce4-commits mailing list