From df80cd379ae2ea3fbbfd3f2a28e804b8882ea93a Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 27 Jan 2013 12:01:08 +0100 Subject: x11: simplify handling of X Visuals and Colormaps in VOs Don't force VOs to pick an arbitrary default Visual and Colormap. They still can override them if needed. This simplifies the X11 VO interface. Always create a Colormap for simplicity. Using CopyFromParent fails if the selected visual is not the same of that of the parent window, which happens for me with vo_opengl. vo_vdpau and vo_xv explicitly set CWBorderPixel, do that in x11_common instead (it was already done for native windows, but not for slave mode windows). What gl_common did was incorrect in theory: freeing a colormap while a window uses it will change the colormap of the window to "None", and the color mapping for such windows is "undefined". --- video/out/vo_vdpau.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'video/out/vo_vdpau.c') diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index 00477716b7..85bf635b11 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -843,11 +843,6 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, uint32_t format) { struct vdpctx *vc = vo->priv; - struct vo_x11_state *x11 = vo->x11; - XVisualInfo vinfo; - XSetWindowAttributes xswa; - XWindowAttributes attribs; - unsigned long xswamask; if (handle_preemption(vo) < 0) return -1; @@ -861,20 +856,8 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, if (IMGFMT_IS_VDPAU(vc->image_format) && !create_vdp_decoder(vo, 2)) return -1; - XGetWindowAttributes(x11->display, DefaultRootWindow(x11->display), - &attribs); - XMatchVisualInfo(x11->display, x11->screen, attribs.depth, TrueColor, - &vinfo); - - xswa.background_pixel = 0; - xswa.border_pixel = 0; - /* Do not use CWBackPixel: It leads to VDPAU errors after - * aspect ratio changes. */ - xswamask = CWBorderPixel; - - vo_x11_create_vo_window(vo, &vinfo, vo->dx, vo->dy, d_width, d_height, - flags, CopyFromParent, "vdpau"); - XChangeWindowAttributes(x11->display, x11->window, xswamask, &xswa); + vo_x11_create_vo_window(vo, NULL, vo->dx, vo->dy, d_width, d_height, + flags, "vdpau"); if (initialize_vdpau_objects(vo) < 0) return -1; -- cgit v1.2.3