]> www.infradead.org Git - pidgin-chime.git/commitdiff
xcb: gather all the screen data using xcb_screen_t
authorIgnacio Casal Quinteiro <qignacio@amazon.com>
Wed, 27 Nov 2019 10:17:42 +0000 (11:17 +0100)
committerIgnacio Casal Quinteiro <qignacio@amazon.com>
Wed, 27 Nov 2019 10:20:01 +0000 (11:20 +0100)
gst-xcbimagesrc/xcbimageutil.c
gst-xcbimagesrc/xcbimageutil.h

index 98fb5593c1fc3c7523caf70a8174cddabdec160f..c0969b0c3cd70d219be4faa078717c354ac31884 100644 (file)
@@ -210,18 +210,19 @@ xcbimageutil_xcontext_get (GstElement * parent, const gchar * display_name)
     return NULL;
   }
   xcontext->conn = get_xcb_connection (xcontext->disp);
-  xcontext->screen = DefaultScreenOfDisplay (xcontext->disp);
-  xcontext->visual = DefaultVisualOfScreen (xcontext->screen);
-  xcontext->root = RootWindowOfScreen (xcontext->screen);
-  xcontext->white = WhitePixelOfScreen (xcontext->screen);
-  xcontext->black = BlackPixelOfScreen (xcontext->screen);
-  xcontext->depth = DefaultDepthOfScreen (xcontext->screen);
-
-  xcontext->width = WidthOfScreen (xcontext->screen);
-  xcontext->height = HeightOfScreen (xcontext->screen);
-
-  xcontext->widthmm = WidthMMOfScreen (xcontext->screen);
-  xcontext->heightmm = HeightMMOfScreen (xcontext->screen);
+  xcontext->screen = xcb_setup_roots_iterator (xcb_get_setup (xcontext->conn)).data;
+  // TODO
+  xcontext->visual = DefaultVisualOfScreen (DefaultScreenOfDisplay (xcontext->disp));
+  xcontext->root = xcontext->screen->root;
+  xcontext->white = xcontext->screen->white_pixel;
+  xcontext->black = xcontext->screen->black_pixel;
+  xcontext->depth = xcontext->screen->root_depth;
+
+  xcontext->width = xcontext->screen->width_in_pixels;
+  xcontext->height = xcontext->screen->height_in_pixels;
+
+  xcontext->widthmm = xcontext->screen->width_in_millimeters;
+  xcontext->heightmm = xcontext->screen->height_in_millimeters;
 
   xcontext->caps = NULL;
 
index 00019085d842d3cc8fb2fbb2cc16e2e60ec6f9ca..ec1cfb2b37b15545a3f08cdaee1009b8f6b1964c 100644 (file)
@@ -79,11 +79,11 @@ struct _GstXContext {
   Display *disp;
   xcb_connection_t *conn;
 
-  Screen *screen;
+  xcb_screen_t *screen;
 
   Visual *visual;
 
-  Window root;
+  xcb_window_t root;
 
   gulong white, black;