From: Ignacio Casal Quinteiro Date: Wed, 27 Nov 2019 10:17:42 +0000 (+0100) Subject: xcb: gather all the screen data using xcb_screen_t X-Git-Tag: v1.4~32 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ff8ee0f3460bcf6c476f4de700caeb9e3fa4b816;p=pidgin-chime.git xcb: gather all the screen data using xcb_screen_t --- diff --git a/gst-xcbimagesrc/xcbimageutil.c b/gst-xcbimagesrc/xcbimageutil.c index 98fb559..c0969b0 100644 --- a/gst-xcbimagesrc/xcbimageutil.c +++ b/gst-xcbimagesrc/xcbimageutil.c @@ -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; diff --git a/gst-xcbimagesrc/xcbimageutil.h b/gst-xcbimagesrc/xcbimageutil.h index 0001908..ec1cfb2 100644 --- a/gst-xcbimagesrc/xcbimageutil.h +++ b/gst-xcbimagesrc/xcbimageutil.h @@ -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;