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 85d4e6c02f91bdd67d365ec27c7a840fc5d48d66 Author: Stephan Haller <[email protected]> Date: Tue Jun 26 07:45:54 2018 +0200 Implement new signal "closed" at window interface XfdashboardWindowTrackerWindow and implement a default signal handler at window manager interface XfdashboardWindowTracker also which emits the new windows' "closed" signal and will be inherited by all backend by default. --- libxfdashboard/window-tracker-window.c | 12 ++++++++++++ libxfdashboard/window-tracker-window.h | 1 + libxfdashboard/window-tracker.c | 16 ++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/libxfdashboard/window-tracker-window.c b/libxfdashboard/window-tracker-window.c index 4e8daea..0be0343 100644 --- a/libxfdashboard/window-tracker-window.c +++ b/libxfdashboard/window-tracker-window.c @@ -51,6 +51,7 @@ enum SIGNAL_WORKSPACE_CHANGED, SIGNAL_MONITOR_CHANGED, SIGNAL_GEOMETRY_CHANGED, + SIGNAL_CLOSED, SIGNAL_LAST }; @@ -284,6 +285,17 @@ static void xfdashboard_window_tracker_window_default_init(XfdashboardWindowTrac G_TYPE_NONE, 0); + XfdashboardWindowTrackerWindowSignals[SIGNAL_CLOSED]= + g_signal_new("closed", + G_TYPE_FROM_INTERFACE(iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(XfdashboardWindowTrackerWindowInterface, closed), + NULL, + NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + /* Set flag that base initialization was done for this interface */ initialized=TRUE; } diff --git a/libxfdashboard/window-tracker-window.h b/libxfdashboard/window-tracker-window.h index facb798..4d6d289 100644 --- a/libxfdashboard/window-tracker-window.h +++ b/libxfdashboard/window-tracker-window.h @@ -143,6 +143,7 @@ struct _XfdashboardWindowTrackerWindowInterface void (*monitor_changed)(XfdashboardWindowTrackerWindow *self, XfdashboardWindowTrackerMonitor *inOldMonitor); void (*geometry_changed)(XfdashboardWindowTrackerWindow *self); + void (*closed)(XfdashboardWindowTrackerWindow *self); }; /* Public API */ diff --git a/libxfdashboard/window-tracker.c b/libxfdashboard/window-tracker.c index 07757b3..29b8f44 100644 --- a/libxfdashboard/window-tracker.c +++ b/libxfdashboard/window-tracker.c @@ -84,6 +84,17 @@ static guint XfdashboardWindowTrackerSignals[SIGNAL_LAST]={ 0, }; G_OBJECT_TYPE_NAME(self), \ vfunc); +/* Default implementation of virtual signal handler function "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 */ + g_signal_emit_by_name(inWindow, "closed"); +} + /* IMPLEMENTATION: GObject */ @@ -95,6 +106,11 @@ void xfdashboard_window_tracker_default_init(XfdashboardWindowTrackerInterface * static gboolean initialized=FALSE; GParamSpec *property; + /* The following virtual functions should be overriden if default + * implementation does not fit. + */ + iface->window_closed=_xfdashboard_window_tracker_real_window_closed; + /* Define properties, signals and actions */ if(!initialized) { -- To stop receiving notification emails like this one, please contact the administrator of this repository. _______________________________________________ Xfce4-commits mailing list [email protected] https://mail.xfce.org/mailman/listinfo/xfce4-commits
