[ShellWindowTracker] Add a signal to notify when tracked windows change

This commit is contained in:
Colin Walters 2010-04-20 14:47:45 -04:00
parent df43352441
commit 26c8227df5

View File

@ -84,6 +84,7 @@ enum {
enum { enum {
APP_RUNNING_CHANGED, APP_RUNNING_CHANGED,
STARTUP_SEQUENCE_CHANGED, STARTUP_SEQUENCE_CHANGED,
TRACKED_WINDOWS_CHANGED,
LAST_SIGNAL LAST_SIGNAL
}; };
@ -149,6 +150,13 @@ shell_window_tracker_class_init (ShellWindowTrackerClass *klass)
NULL, NULL, NULL, NULL,
g_cclosure_marshal_VOID__BOXED, g_cclosure_marshal_VOID__BOXED,
G_TYPE_NONE, 1, SHELL_TYPE_STARTUP_SEQUENCE); G_TYPE_NONE, 1, SHELL_TYPE_STARTUP_SEQUENCE);
signals[TRACKED_WINDOWS_CHANGED] = g_signal_new ("tracked-windows-changed",
SHELL_TYPE_WINDOW_TRACKER,
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
} }
/** /**
@ -514,6 +522,8 @@ track_window (ShellWindowTracker *self,
app); app);
g_signal_emit (self, signals[APP_RUNNING_CHANGED], 0, app); g_signal_emit (self, signals[APP_RUNNING_CHANGED], 0, app);
} }
g_signal_emit (self, signals[TRACKED_WINDOWS_CHANGED], 0);
} }
static void static void
@ -549,6 +559,8 @@ disassociate_window (ShellWindowTracker *self,
g_signal_emit (self, signals[APP_RUNNING_CHANGED], 0, app); g_signal_emit (self, signals[APP_RUNNING_CHANGED], 0, app);
} }
g_signal_emit (self, signals[TRACKED_WINDOWS_CHANGED], 0);
g_object_unref (app); g_object_unref (app);
} }