[Xfce4-commits] [apps/xfdashboard] 01/03: Adjust stage to make use of new signal "closed" for windows.
noreply at xfce.org
noreply at xfce.org
Tue Jun 26 19:11:18 CEST 2018
This is an automated email from the git hooks/post-receive script.
n o m a d p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfdashboard.
commit 1c22ad3fc0d763c55be9259bbcbe494bd684ea06
Author: Stephan Haller <nomad at froevel.de>
Date: Tue Jun 26 15:37:55 2018 +0200
Adjust stage to make use of new signal "closed" for windows.
---
libxfdashboard/stage.c | 21 +++++++++++++--------
libxfdashboard/window-tracker.c | 4 ++--
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/libxfdashboard/stage.c b/libxfdashboard/stage.c
index d39266a..50e0821 100644
--- a/libxfdashboard/stage.c
+++ b/libxfdashboard/stage.c
@@ -629,25 +629,26 @@ static void _xfdashboard_stage_on_view_activated(XfdashboardStage *self, Xfdashb
* signal handler to find new stage window.
*/
static void _xfdashboard_stage_on_window_closed(XfdashboardStage *self,
- XfdashboardWindowTrackerWindow *inWindow,
gpointer inUserData)
{
XfdashboardStagePrivate *priv;
+ XfdashboardWindowTrackerWindow *window;
g_return_if_fail(XFDASHBOARD_IS_STAGE(self));
- g_return_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(inWindow));
+ g_return_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(inUserData));
priv=self->priv;
+ window=XFDASHBOARD_WINDOW_TRACKER_WINDOW(inUserData);
/* Check if window closed is this stage window */
- if(priv->stageWindow!=inWindow) return;
-
- /* Forget stage window as it was closed */
- priv->stageWindow=NULL;
+ if(priv->stageWindow!=window) return;
/* Disconnect this signal handler as this stage window was closed*/
XFDASHBOARD_DEBUG(self, ACTOR, "Stage window was closed. Removing signal handler");
- g_signal_handlers_disconnect_by_func(priv->windowTracker, G_CALLBACK(_xfdashboard_stage_on_window_closed), self);
+ g_signal_handlers_disconnect_by_func(priv->stageWindow, G_CALLBACK(_xfdashboard_stage_on_window_closed), self);
+
+ /* Forget stage window as it was closed */
+ priv->stageWindow=NULL;
/* Instead reconnect signal handler to find new stage window */
XFDASHBOARD_DEBUG(self, ACTOR, "Reconnecting signal to find new stage window as this one as closed");
@@ -690,7 +691,10 @@ static void _xfdashboard_stage_on_window_opened(XfdashboardStage *self,
* handler again.
*/
XFDASHBOARD_DEBUG(self, ACTOR, "Connecting signal signal handler to get notified about destruction of stage window");
- g_signal_connect_swapped(priv->windowTracker, "window-closed", G_CALLBACK(_xfdashboard_stage_on_window_closed), self);
+ g_signal_connect_swapped(priv->stageWindow,
+ "closed",
+ G_CALLBACK(_xfdashboard_stage_on_window_closed),
+ self);
/* Set focus */
_xfdashboard_stage_set_focus(self);
@@ -1628,6 +1632,7 @@ static void _xfdashboard_stage_dispose(GObject *inObject)
/* Release allocated resources */
if(priv->stageWindow)
{
+ g_signal_handlers_disconnect_by_func(priv->stageWindow, G_CALLBACK(_xfdashboard_stage_on_window_closed), self);
xfdashboard_window_tracker_window_hide_stage(priv->stageWindow);
priv->stageWindow=NULL;
}
diff --git a/libxfdashboard/window-tracker.c b/libxfdashboard/window-tracker.c
index 29b8f44..21b0717 100644
--- a/libxfdashboard/window-tracker.c
+++ b/libxfdashboard/window-tracker.c
@@ -84,14 +84,14 @@ static guint XfdashboardWindowTrackerSignals[SIGNAL_LAST]={ 0, };
G_OBJECT_TYPE_NAME(self), \
vfunc);
-/* Default implementation of virtual signal handler function "window_closed" */
+/* Default signal handler for signal "window_closed" */
static void _xfdashboard_window_tracker_real_window_closed(XfdashboardWindowTracker *self,
XfdashboardWindowTrackerWindow *inWindow)
{
g_return_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER(self));
g_return_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(inWindow));
- /* By default (if not overidden) emit "close" signal at window */
+ /* By default (if not overidden) emit "closed" signal at window */
g_signal_emit_by_name(inWindow, "closed");
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list