From 471d23ba4351d5bc5fbd7bdee730011b83786279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 8 Sep 2022 00:06:44 +0200 Subject: [PATCH] Remove meta_get_display() Part-of: --- src/core/display-private.h | 3 --- src/core/display.c | 29 +---------------------------- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/src/core/display-private.h b/src/core/display-private.h index f82fb8ba2..9ac6d21a1 100644 --- a/src/core/display-private.h +++ b/src/core/display-private.h @@ -298,9 +298,6 @@ META_EXPORT_TEST GSList* meta_display_list_windows (MetaDisplay *display, MetaListWindowsFlags flags); -META_EXPORT_TEST -MetaDisplay* meta_get_display (void); - void meta_display_reload_cursor (MetaDisplay *display); void meta_display_update_cursor (MetaDisplay *display); diff --git a/src/core/display.c b/src/core/display.c index 03e258a3a..6c320d0f4 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -188,14 +188,6 @@ static guint display_signals [LAST_SIGNAL] = { 0 }; #define META_GRAB_OP_GET_BASE_TYPE(op) (op & 0x00FF) -/* - * The display we're managing. This is a singleton object. (Historically, - * this was a list of displays, but there was never any way to add more - * than one element to it.) The goofy name is because we don't want it - * to shadow the parameter in its object methods. - */ -static MetaDisplay *the_display = NULL; - static void on_monitors_changed_internal (MetaMonitorManager *monitor_manager, MetaDisplay *display); @@ -864,8 +856,7 @@ meta_display_new (MetaContext *context, MetaMonitorManager *monitor_manager; MetaSettings *settings; - g_assert (the_display == NULL); - display = the_display = g_object_new (META_TYPE_DISPLAY, NULL); + display = g_object_new (META_TYPE_DISPLAY, NULL); priv = meta_display_get_instance_private (display); priv->context = context; @@ -1152,8 +1143,6 @@ meta_display_close (MetaDisplay *display, return; } - g_assert (display == the_display); - display->closing += 1; g_signal_emit (display, display_signals[CLOSING], 0); @@ -1204,22 +1193,6 @@ meta_display_close (MetaDisplay *display, meta_clipboard_manager_shutdown (display); g_clear_object (&display->selection); g_clear_object (&display->pad_action_mapper); - - the_display = NULL; -} - -/** - * meta_get_display: - * - * Accessor for the singleton MetaDisplay. - * - * Returns: The only #MetaDisplay there is. This can be %NULL, but only - * during startup. - */ -MetaDisplay* -meta_get_display (void) -{ - return the_display; } static inline gboolean