backend/x11: Add API to get the X11 screen

Will be used to replace a similar ClutterX11 API.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
This commit is contained in:
Jonas Ådahl 2021-09-17 21:26:55 +02:00
parent 440359e85f
commit b1fb8cbf57
2 changed files with 12 additions and 0 deletions

View File

@ -61,6 +61,7 @@ struct _MetaBackendX11Private
{
/* The host X11 display */
Display *xdisplay;
Screen *xscreen;
xcb_connection_t *xcb;
GSource *source;
Window root_window;
@ -868,6 +869,7 @@ meta_backend_x11_initable_init (GInitable *initable,
}
priv->xdisplay = xdisplay;
priv->xscreen = DefaultScreenOfDisplay (xdisplay);
priv->xcb = XGetXCBConnection (priv->xdisplay);
priv->root_window = DefaultRootWindow (xdisplay);
@ -955,6 +957,14 @@ meta_backend_x11_get_xdisplay (MetaBackendX11 *x11)
return priv->xdisplay;
}
Screen *
meta_backend_x11_get_xscreen (MetaBackendX11 *x11)
{
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
return priv->xscreen;
}
Window
meta_backend_x11_get_root_xwindow (MetaBackendX11 *backend_x11)
{

View File

@ -49,6 +49,8 @@ struct _MetaBackendX11Class
Display * meta_backend_x11_get_xdisplay (MetaBackendX11 *backend);
Screen * meta_backend_x11_get_xscreen (MetaBackendX11 *backend);
Window meta_backend_x11_get_root_xwindow (MetaBackendX11 *backend_x11);
Window meta_backend_x11_get_xwindow (MetaBackendX11 *backend);