diff --git a/src/core/screen-private.h b/src/core/screen-private.h index 8a2dea725..1d98a1810 100644 --- a/src/core/screen-private.h +++ b/src/core/screen-private.h @@ -141,6 +141,7 @@ struct _MetaScreenClass void (*restacked) (MetaScreen *); void (*workareas_changed) (MetaScreen *); + void (*monitors_changed) (MetaScreen *); }; MetaScreen* meta_screen_new (MetaDisplay *display, diff --git a/src/core/screen.c b/src/core/screen.c index 2f42ac2b8..b6abbe3b9 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -86,6 +86,7 @@ enum WORKSPACE_SWITCHED, STARTUP_SEQUENCE_CHANGED, WORKAREAS_CHANGED, + MONITORS_CHANGED, LAST_SIGNAL }; @@ -227,6 +228,15 @@ meta_screen_class_init (MetaScreenClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + screen_signals[MONITORS_CHANGED] = + g_signal_new ("monitors-changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (MetaScreenClass, monitors_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + g_object_class_install_property (object_class, PROP_N_WORKSPACES, pspec); @@ -2791,6 +2801,8 @@ meta_screen_resize (MetaScreen *screen, /* Queue a resize on all the windows */ meta_screen_foreach_window (screen, meta_screen_resize_func, 0); + + g_signal_emit (screen, screen_signals[MONITORS_CHANGED], 0, index); } void