diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c index a072e3f23f..7749b5e2ce 100644 --- a/gdk/gdkdisplay.c +++ b/gdk/gdkdisplay.c @@ -81,8 +81,6 @@ enum { CLOSED, SEAT_ADDED, SEAT_REMOVED, - MONITOR_ADDED, - MONITOR_REMOVED, SETTING_CHANGED, LAST_SIGNAL }; @@ -264,38 +262,6 @@ gdk_display_class_init (GdkDisplayClass *class) NULL, G_TYPE_NONE, 1, GDK_TYPE_SEAT); - /** - * GdkDisplay::monitor-added: - * @display: the objedct on which the signal is emitted - * @monitor: the monitor that was just added - * - * The ::monitor-added signal is emitted whenever a monitor is - * added. - */ - signals[MONITOR_ADDED] = - g_signal_new (g_intern_static_string ("monitor-added"), - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - 0, NULL, NULL, - NULL, - G_TYPE_NONE, 1, GDK_TYPE_MONITOR); - - /** - * GdkDisplay::monitor-removed: - * @display: the object on which the signal is emitted - * @monitor: the monitor that was just removed - * - * The ::monitor-removed signal is emitted whenever a monitor is - * removed. - */ - signals[MONITOR_REMOVED] = - g_signal_new (g_intern_static_string ("monitor-removed"), - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - 0, NULL, NULL, - NULL, - G_TYPE_NONE, 1, GDK_TYPE_MONITOR); - /** * GdkDisplay::setting-changed: * @display: the object on which the signal is emitted @@ -1648,21 +1614,6 @@ gdk_display_get_monitor_at_surface (GdkDisplay *display, return best; } -void -gdk_display_monitor_added (GdkDisplay *display, - GdkMonitor *monitor) -{ - g_signal_emit (display, signals[MONITOR_ADDED], 0, monitor); -} - -void -gdk_display_monitor_removed (GdkDisplay *display, - GdkMonitor *monitor) -{ - g_signal_emit (display, signals[MONITOR_REMOVED], 0, monitor); - gdk_monitor_invalidate (monitor); -} - void gdk_display_emit_opened (GdkDisplay *display) { diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h index 25d1f697ff..eeba7a359d 100644 --- a/gdk/gdkdisplayprivate.h +++ b/gdk/gdkdisplayprivate.h @@ -241,10 +241,6 @@ void gdk_display_add_seat (GdkDisplay *display GdkSeat *seat); void gdk_display_remove_seat (GdkDisplay *display, GdkSeat *seat); -void gdk_display_monitor_added (GdkDisplay *display, - GdkMonitor *monitor); -void gdk_display_monitor_removed (GdkDisplay *display, - GdkMonitor *monitor); void gdk_display_emit_opened (GdkDisplay *display); void gdk_display_setting_changed (GdkDisplay *display, diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c index d2237ae0b4..163423203a 100644 --- a/gdk/wayland/gdkdisplay-wayland.c +++ b/gdk/wayland/gdkdisplay-wayland.c @@ -2521,7 +2521,6 @@ gdk_wayland_display_add_output (GdkWaylandDisplay *display_wayland, gdk_wayland_display_get_xdg_output (monitor); g_list_store_append (display_wayland->monitors, monitor); - gdk_display_monitor_added (GDK_DISPLAY (display_wayland), GDK_MONITOR (monitor)); g_object_unref (monitor); } @@ -2567,7 +2566,7 @@ gdk_wayland_display_remove_output (GdkWaylandDisplay *self, if (monitor->id == id) { g_list_store_remove (self->monitors, i); - gdk_display_monitor_removed (GDK_DISPLAY (self), GDK_MONITOR (monitor)); + gdk_monitor_invalidate (GDK_MONITOR (monitor)); update_scale (GDK_DISPLAY (self)); } diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c index f97114d190..c445540815 100644 --- a/gdk/win32/gdkdisplay-win32.c +++ b/gdk/win32/gdkdisplay-win32.c @@ -186,7 +186,6 @@ _gdk_win32_display_find_matching_monitor (GdkWin32Display *win32_display, void _gdk_win32_display_init_monitors (GdkWin32Display *win32_display) { - GdkDisplay *display = GDK_DISPLAY (win32_display); GPtrArray *new_monitors; gint i; GdkWin32Monitor *primary_to_move = NULL; @@ -286,23 +285,19 @@ _gdk_win32_display_init_monitors (GdkWin32Display *win32_display) if (!w32_ex_monitor->remove) continue; - gdk_display_monitor_removed (display, ex_monitor); g_list_store_remove (G_LIST_STORE (win32_display->monitors), i); + gdk_monitor_invalidate (ex_monitor); } for (i = 0; i < new_monitors->len; i++) { GdkWin32Monitor *w32_m; - GdkMonitor *m; w32_m = GDK_WIN32_MONITOR (g_ptr_array_index (new_monitors, i)); - m = GDK_MONITOR (w32_m); if (!w32_m->add) continue; - gdk_display_monitor_added (display, m); - if (i == 0) g_list_store_insert (G_LIST_STORE (win32_display->monitors), 0, w32_m); else diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index 61f255b3b6..6f1aa1f9c8 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -610,16 +610,13 @@ init_randr15 (GdkX11Screen *x11_screen) for (i = g_list_model_get_n_items (G_LIST_MODEL (x11_display->monitors)) - 1; i >= 0; i--) { GdkX11Monitor *monitor = g_list_model_get_item (G_LIST_MODEL (x11_display->monitors), i); + notify_surface_monitor_change (x11_display, GDK_MONITOR (monitor)); - if (monitor->add) - { - gdk_display_monitor_added (display, GDK_MONITOR (monitor)); - } - else if (monitor->remove) + if (monitor->remove) { g_object_ref (monitor); g_list_store_remove (x11_display->monitors, i); - gdk_display_monitor_removed (display, GDK_MONITOR (monitor)); + gdk_monitor_invalidate (GDK_MONITOR (monitor)); g_object_unref (monitor); } g_object_unref (monitor); @@ -765,16 +762,13 @@ init_randr13 (GdkX11Screen *x11_screen) for (i = g_list_model_get_n_items (G_LIST_MODEL (x11_display->monitors)) - 1; i >= 0; i--) { GdkX11Monitor *monitor = g_list_model_get_item (G_LIST_MODEL (x11_display->monitors), i); + notify_surface_monitor_change (x11_display, GDK_MONITOR (monitor)); - if (monitor->add) - { - gdk_display_monitor_added (display, GDK_MONITOR (monitor)); - } - else if (monitor->remove) + if (monitor->remove) { g_object_ref (monitor); g_list_store_remove (x11_display->monitors, i); - gdk_display_monitor_removed (display, GDK_MONITOR (monitor)); + gdk_monitor_invalidate (GDK_MONITOR (monitor)); g_object_unref (monitor); } } @@ -857,16 +851,13 @@ init_no_multihead (GdkX11Screen *x11_screen) for (i = g_list_model_get_n_items (G_LIST_MODEL (x11_display->monitors)) - 1; i >= 0; i--) { monitor = g_list_model_get_item (G_LIST_MODEL (x11_display->monitors), i); + notify_surface_monitor_change (x11_display, GDK_MONITOR (monitor)); - if (monitor->add) - { - gdk_display_monitor_added (GDK_DISPLAY (x11_display), GDK_MONITOR (monitor)); - } - else if (monitor->remove) + if (monitor->remove) { g_object_ref (monitor); g_list_store_remove (x11_display->monitors, i); - gdk_display_monitor_removed (GDK_DISPLAY (x11_display), GDK_MONITOR (monitor)); + gdk_monitor_invalidate (GDK_MONITOR (monitor)); g_object_unref (monitor); } g_object_unref (monitor);