x11: Remove unused function

Now that we can't create extra GdkX11Screens anymore, this also means
that there is exactly 1 GdkX11Screen per GdkX11Display.
This commit is contained in:
Benjamin Otte 2021-06-03 04:45:36 +02:00
parent 1347573139
commit 74e01ddec5
2 changed files with 0 additions and 50 deletions

View File

@ -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 screens of the display.
*
* Given the root window ID of one of the screens 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`

View File

@ -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);