[gtk/wip/otte/gleanup: 19/69] x11: Remove unused function




commit 74e01ddec50fdf315c47accbd439ca3668ebf18d
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 0d1f61d1df..e181ddd413 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1910,7 +1910,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);
@@ -1975,52 +1974,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 8eada4a8db..29e46f8e26 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;
 
@@ -174,8 +173,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]