[gtk/wip/otte/gleanup: 2/4] x11: Remove unused function




commit ed0d6e5daf004ca87acc495d4c528f5aa530e8ca
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jun 3 04:45:36 2021 +0200

    x11: Remove unused function
    
    Now that we can't create extra GdkX11Screens anymore, this also means
    that there is exactly 1 GdkX11Screen per GdkX11Display.

 gdk/x11/gdkdisplay-x11.c | 47 -----------------------------------------------
 gdk/x11/gdkdisplay-x11.h |  3 ---
 2 files changed, 50 deletions(-)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index ae112e1d72..fd1feb758c 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1932,7 +1932,6 @@ gdk_x11_display_finalize (GObject *object)
 
   /* Free all GdkX11Screens */
   g_object_unref (display_x11->screen);
-  g_list_free_full (display_x11->screens, g_object_unref);
 
   g_list_store_remove_all (display_x11->monitors);
   g_object_unref (display_x11->monitors);
@@ -1997,52 +1996,6 @@ gdk_x11_lookup_xdisplay (Display *xdisplay)
   return display;
 }
 
-/*
- * _gdk_x11_display_screen_for_xrootwin:
- * @display: a `GdkDisplay`
- * @xrootwin: window ID for one of the screen’s of the display.
- *
- * Given the root window ID of one of the screen’s of a `GdkDisplay`,
- * finds the screen.
- *
- * Returns: (transfer none): the `GdkX11Screen` corresponding to @xrootwin
- */
-GdkX11Screen *
-_gdk_x11_display_screen_for_xrootwin (GdkDisplay *display,
-                                     Window      xrootwin)
-{
-  GdkX11Screen *screen;
-  XWindowAttributes attrs;
-  gboolean result;
-  GdkX11Display *display_x11;
-  GList *l;
-
-  screen = GDK_X11_DISPLAY (display)->screen;
-
-  if (GDK_SCREEN_XROOTWIN (screen) == xrootwin)
-    return screen;
-
-  display_x11 = GDK_X11_DISPLAY (display);
-
-  for (l = display_x11->screens; l; l = l->next)
-    {
-      screen = l->data;
-      if (GDK_SCREEN_XROOTWIN (screen) == xrootwin)
-        return screen;
-    }
-
-  gdk_x11_display_error_trap_push (display);
-  result = XGetWindowAttributes (display_x11->xdisplay, xrootwin, &attrs);
-  if (gdk_x11_display_error_trap_pop (display) || !result)
-    return NULL;
-
-  screen = _gdk_x11_screen_new (display, XScreenNumberOfScreen (attrs.screen));
-
-  display_x11->screens = g_list_prepend (display_x11->screens, screen);
-
-  return screen;
-}
-
 /**
  * gdk_x11_display_get_xdisplay:
  * @display: (type GdkX11Display): a `GdkDisplay`
diff --git a/gdk/x11/gdkdisplay-x11.h b/gdk/x11/gdkdisplay-x11.h
index 5ffae57b74..db48411091 100644
--- a/gdk/x11/gdkdisplay-x11.h
+++ b/gdk/x11/gdkdisplay-x11.h
@@ -42,7 +42,6 @@ struct _GdkX11Display
   GdkDisplay parent_instance;
   Display *xdisplay;
   GdkX11Screen *screen;
-  GList *screens;
   GList *toplevels;
   GdkX11DeviceManagerXI2 *device_manager;
 
@@ -176,8 +175,6 @@ struct _GdkX11DisplayClass
                                                                  const XEvent           *event);
 };
 
-GdkX11Screen *  _gdk_x11_display_screen_for_xrootwin            (GdkDisplay             *display,
-                                                                 Window                  xrootwin);
 void            _gdk_x11_display_error_event                    (GdkDisplay             *display,
                                                                  XErrorEvent            *error);
 gsize           gdk_x11_display_get_max_request_size            (GdkDisplay             *display);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]