summaryrefslogtreecommitdiffstats
path: root/video/out/gl_common.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-01-27 12:01:08 +0100
committerwm4 <wm4@nowhere>2013-01-27 13:32:27 +0100
commitdf80cd379ae2ea3fbbfd3f2a28e804b8882ea93a (patch)
tree4a29ae5b579a10baee13ee8065ad01beeefafe8f /video/out/gl_common.c
parent75164a0e0a409958d10f56b3dabea35914daeba3 (diff)
downloadmpv-df80cd379ae2ea3fbbfd3f2a28e804b8882ea93a.tar.bz2
mpv-df80cd379ae2ea3fbbfd3f2a28e804b8882ea93a.tar.xz
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".
Diffstat (limited to 'video/out/gl_common.c')
-rw-r--r--video/out/gl_common.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/video/out/gl_common.c b/video/out/gl_common.c
index 887195bf18..38bd89b21d 100644
--- a/video/out/gl_common.c
+++ b/video/out/gl_common.c
@@ -1089,11 +1089,8 @@ static bool create_glx_window(struct MPGLContext *ctx, uint32_t d_width,
if (glx_ctx->context) {
// GL context and window already exist.
// Only update window geometry etc.
- Colormap colormap = XCreateColormap(vo->x11->display, vo->x11->rootwin,
- glx_ctx->vinfo->visual, AllocNone);
vo_x11_create_vo_window(vo, glx_ctx->vinfo, vo->dx, vo->dy, d_width,
- d_height, flags, colormap, "gl");
- XFreeColormap(vo->x11->display, colormap);
+ d_height, flags, "gl");
return true;
}
@@ -1144,11 +1141,8 @@ static bool create_glx_window(struct MPGLContext *ctx, uint32_t d_width,
glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_GREEN_SIZE, &ctx->depth_g);
glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_BLUE_SIZE, &ctx->depth_b);
- Colormap colormap = XCreateColormap(vo->x11->display, vo->x11->rootwin,
- glx_ctx->vinfo->visual, AllocNone);
vo_x11_create_vo_window(vo, glx_ctx->vinfo, vo->dx, vo->dy, d_width,
- d_height, flags, colormap, "gl");
- XFreeColormap(vo->x11->display, colormap);
+ d_height, flags, "gl");
return true;
}