mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
display: Emit signals when opening and closing X11 display
This is needed so that other parts can initialize and deinitialize X11 dependent functionality. https://bugzilla.gnome.org/show_bug.cgi?id=759538
This commit is contained in:
parent
3d2b9a3a69
commit
522f9b4c38
@ -118,6 +118,8 @@ G_DEFINE_TYPE(MetaDisplay, meta_display, G_TYPE_OBJECT);
|
||||
/* Signals */
|
||||
enum
|
||||
{
|
||||
X11_DISPLAY_OPENED,
|
||||
X11_DISPLAY_CLOSING,
|
||||
OVERLAY_KEY,
|
||||
ACCELERATOR_ACTIVATED,
|
||||
MODIFIERS_ACCELERATOR_ACTIVATED,
|
||||
@ -206,6 +208,22 @@ meta_display_class_init (MetaDisplayClass *klass)
|
||||
object_class->get_property = meta_display_get_property;
|
||||
object_class->set_property = meta_display_set_property;
|
||||
|
||||
display_signals[X11_DISPLAY_OPENED] =
|
||||
g_signal_new ("x11-display-opened",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
display_signals[X11_DISPLAY_CLOSING] =
|
||||
g_signal_new ("x11-display-closing",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
display_signals[OVERLAY_KEY] =
|
||||
g_signal_new ("overlay-key",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
@ -673,6 +691,7 @@ meta_display_open (void)
|
||||
x11_display = meta_x11_display_new (display, &error);
|
||||
g_assert (x11_display != NULL); /* Required, for now */
|
||||
display->x11_display = x11_display;
|
||||
g_signal_emit (display, display_signals[X11_DISPLAY_OPENED], 0);
|
||||
|
||||
/* here we use XDisplayName which is what the user
|
||||
* probably put in, vs. DisplayString(display) which is
|
||||
@ -1170,6 +1189,7 @@ meta_display_close (MetaDisplay *display,
|
||||
|
||||
if (display->x11_display)
|
||||
{
|
||||
g_signal_emit (display, display_signals[X11_DISPLAY_CLOSING], 0);
|
||||
g_object_run_dispose (G_OBJECT (display->x11_display));
|
||||
g_clear_object (&display->x11_display);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user