Add "window-created" signal to MetaDisplay, "unmanaged" signal for MetaWindow

For some consumers it's significantly more convenient to be able
to directly connect to a signal on the Window to know when
Mutter is done with it, rather than having to connect to each
Workspace object (and handle workspace additions, etc.).

Similarly, add window-created which acts globally.

https://bugzilla.gnome.org/show_bug.cgi?id=598289
This commit is contained in:
Colin Walters
2009-10-13 10:34:34 -04:00
parent 3c76478510
commit 9311addca3
4 changed files with 36 additions and 0 deletions

View File

@@ -129,6 +129,7 @@ enum
{
OVERLAY_KEY,
FOCUS_WINDOW,
WINDOW_CREATED,
LAST_SIGNAL
};
@@ -226,6 +227,16 @@ meta_display_class_init (MetaDisplayClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
display_signals[WINDOW_CREATED] =
g_signal_new ("window-created",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1, META_TYPE_WINDOW);
g_object_class_install_property (object_class,
PROP_FOCUS_WINDOW,
g_param_spec_object ("focus-window",
@@ -3210,6 +3221,13 @@ meta_display_unregister_x_window (MetaDisplay *display,
remove_pending_pings_for_window (display, xwindow);
}
void
meta_display_notify_window_created (MetaDisplay *display,
MetaWindow *window)
{
g_signal_emit (display, display_signals[WINDOW_CREATED], 0, window);
}
/**
* meta_display_xwindow_is_a_no_focus_window:
* @display: A #MetaDisplay