[mutter] backend/x11: Add API to get the root window



commit dfbe97a8e511148fe5c3dcf2633950942c5e9ce7
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri Sep 17 15:53:05 2021 +0200

    backend/x11: Add API to get the root window
    
    Will later be used from here instead of via the clutter backend.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>

 src/backends/x11/meta-backend-x11.c | 11 +++++++++++
 src/backends/x11/meta-backend-x11.h |  2 ++
 2 files changed, 13 insertions(+)
---
diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c
index f2a637822a..ccf6d92530 100644
--- a/src/backends/x11/meta-backend-x11.c
+++ b/src/backends/x11/meta-backend-x11.c
@@ -63,6 +63,7 @@ struct _MetaBackendX11Private
   Display *xdisplay;
   xcb_connection_t *xcb;
   GSource *source;
+  Window root_window;
 
   int xsync_event_base;
   int xsync_error_base;
@@ -868,6 +869,7 @@ meta_backend_x11_initable_init (GInitable    *initable,
 
   priv->xdisplay = xdisplay;
   priv->xcb = XGetXCBConnection (priv->xdisplay);
+  priv->root_window = DefaultRootWindow (xdisplay);
 
   init_xkb_state (x11);
 
@@ -953,6 +955,15 @@ meta_backend_x11_get_xdisplay (MetaBackendX11 *x11)
   return priv->xdisplay;
 }
 
+Window
+meta_backend_x11_get_root_xwindow (MetaBackendX11 *backend_x11)
+{
+  MetaBackendX11Private *priv =
+    meta_backend_x11_get_instance_private (backend_x11);
+
+  return priv->root_window;
+}
+
 Window
 meta_backend_x11_get_xwindow (MetaBackendX11 *x11)
 {
diff --git a/src/backends/x11/meta-backend-x11.h b/src/backends/x11/meta-backend-x11.h
index 2815015d15..eb15ba01c9 100644
--- a/src/backends/x11/meta-backend-x11.h
+++ b/src/backends/x11/meta-backend-x11.h
@@ -49,6 +49,8 @@ struct _MetaBackendX11Class
 
 Display * meta_backend_x11_get_xdisplay (MetaBackendX11 *backend);
 
+Window meta_backend_x11_get_root_xwindow (MetaBackendX11 *backend_x11);
+
 Window meta_backend_x11_get_xwindow (MetaBackendX11 *backend);
 
 void meta_backend_x11_handle_event (MetaBackendX11 *x11,


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