From e4e0eaac9d36a93c394fb7eeac9d627b070d513a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 17 Sep 2021 21:37:41 +0200 Subject: [PATCH] clutter/backend/x11: Stop keeping track of the screen and root window They are now only ever accessed via the actual X11 backend. Part-of: --- src/backends/x11/meta-clutter-backend-x11.c | 74 --------------------- src/backends/x11/meta-clutter-backend-x11.h | 6 -- 2 files changed, 80 deletions(-) diff --git a/src/backends/x11/meta-clutter-backend-x11.c b/src/backends/x11/meta-clutter-backend-x11.c index 4a023a1d4..77eeed4e9 100644 --- a/src/backends/x11/meta-clutter-backend-x11.c +++ b/src/backends/x11/meta-clutter-backend-x11.c @@ -121,7 +121,6 @@ meta_clutter_backend_x11_finish_init (ClutterBackend *clutter_backend, meta_clutter_backend_x11_get_instance_private (clutter_backend_x11); MetaBackendX11 *backend_x11 = META_BACKEND_X11 (priv->backend); Atom atoms[N_ATOM_NAMES]; - Screen *xscreen; clutter_backend_x11->xdisplay = meta_backend_x11_get_xdisplay (backend_x11); @@ -130,12 +129,6 @@ meta_clutter_backend_x11_finish_init (ClutterBackend *clutter_backend, cogl_xlib_filter, clutter_backend); - xscreen = DefaultScreenOfDisplay (clutter_backend_x11->xdisplay); - clutter_backend_x11->xscreen_num = XScreenNumberOfScreen (xscreen); - - clutter_backend_x11->xwin_root = RootWindow (clutter_backend_x11->xdisplay, - clutter_backend_x11->xscreen_num); - if (clutter_synchronise) XSynchronize (clutter_backend_x11->xdisplay, True); @@ -154,13 +147,6 @@ meta_clutter_backend_x11_finish_init (ClutterBackend *clutter_backend, clutter_backend_x11->atom_NET_WM_NAME = atoms[8]; clutter_backend_x11->atom_UTF8_STRING = atoms[9]; - g_debug ("X Display '%s'[%p] opened (screen:%d, root:%u, dpi:%f)", - g_getenv ("DISPLAY"), - clutter_backend_x11->xdisplay, - clutter_backend_x11->xscreen_num, - (unsigned int) clutter_backend_x11->xwin_root, - clutter_backend_get_resolution (clutter_backend)); - return TRUE; } @@ -479,66 +465,6 @@ meta_clutter_x11_untrap_x_errors (void) return TrappedErrorCode; } -Display * -meta_clutter_x11_get_default_display (void) -{ - ClutterBackend *clutter_backend = clutter_get_default_backend (); - - if (clutter_backend == NULL) - { - g_critical ("The Clutter backend has not been initialised"); - return NULL; - } - - if (!META_IS_CLUTTER_BACKEND_X11 (clutter_backend)) - { - g_critical ("The Clutter backend is not a X11 backend"); - return NULL; - } - - return META_CLUTTER_BACKEND_X11 (clutter_backend)->xdisplay; -} - -int -meta_clutter_x11_get_default_screen (void) -{ - ClutterBackend *clutter_backend = clutter_get_default_backend (); - - if (clutter_backend == NULL) - { - g_critical ("The Clutter backend has not been initialised"); - return 0; - } - - if (!META_IS_CLUTTER_BACKEND_X11 (clutter_backend)) - { - g_critical ("The Clutter backend is not a X11 backend"); - return 0; - } - - return META_CLUTTER_BACKEND_X11 (clutter_backend)->xscreen_num; -} - -Window -meta_clutter_x11_get_root_window (void) -{ - ClutterBackend *clutter_backend = clutter_get_default_backend (); - - if (clutter_backend == NULL) - { - g_critical ("The Clutter backend has not been initialised"); - return None; - } - - if (!META_IS_CLUTTER_BACKEND_X11 (clutter_backend)) - { - g_critical ("The Clutter backend is not a X11 backend"); - return None; - } - - return META_CLUTTER_BACKEND_X11 (clutter_backend)->xwin_root; -} - void meta_clutter_backend_x11_add_filter (MetaClutterBackendX11 *clutter_backend_x11, MetaX11FilterFunc func, diff --git a/src/backends/x11/meta-clutter-backend-x11.h b/src/backends/x11/meta-clutter-backend-x11.h index 9e1cfca13..187db4b9a 100644 --- a/src/backends/x11/meta-clutter-backend-x11.h +++ b/src/backends/x11/meta-clutter-backend-x11.h @@ -36,10 +36,6 @@ struct _MetaClutterBackendX11 Display *xdisplay; - int xscreen_num; - - Window xwin_root; - /* event source */ GSList *event_filters; @@ -79,8 +75,6 @@ MetaClutterBackendX11 * meta_clutter_backend_x11_new (MetaBackend *backend); void meta_clutter_x11_trap_x_errors (void); gint meta_clutter_x11_untrap_x_errors (void); -Display *meta_clutter_x11_get_default_display (void); -int meta_clutter_x11_get_default_screen (void); Window meta_clutter_x11_get_root_window (void); void meta_clutter_backend_x11_add_filter (MetaClutterBackendX11 *clutter_backend_x11,