x11_common: minor simplification

This commit is contained in:
wm4 2013-04-15 21:18:46 +02:00
parent 1bae5641ab
commit 465ccd2c93
1 changed files with 6 additions and 13 deletions

View File

@ -924,16 +924,6 @@ static void vo_x11_update_window_title(struct vo *vo)
vo_x11_set_property_utf8(vo, x11->XA_NET_WM_ICON_NAME, title); vo_x11_set_property_utf8(vo, x11->XA_NET_WM_ICON_NAME, title);
} }
static void setup_window_params(struct vo_x11_state *x11, XVisualInfo *vis,
unsigned long *mask, XSetWindowAttributes *att)
{
vo_x11_create_colormap(x11, vis);
*mask = CWBorderPixel | CWColormap;
att->border_pixel = 0;
att->colormap = x11->colormap;
}
static void find_default_visual(struct vo_x11_state *x11, XVisualInfo *vis) static void find_default_visual(struct vo_x11_state *x11, XVisualInfo *vis)
{ {
Display *display = x11->display; Display *display = x11->display;
@ -956,9 +946,12 @@ static void vo_x11_create_window(struct vo *vo, XVisualInfo *vis, int x, int y,
find_default_visual(x11, vis); find_default_visual(x11, vis);
} }
unsigned long xswamask; vo_x11_create_colormap(x11, vis);
XSetWindowAttributes xswa; unsigned long xswamask = CWBorderPixel | CWColormap;
setup_window_params(x11, vis, &xswamask, &xswa); XSetWindowAttributes xswa = {
.border_pixel = 0,
.colormap = x11->colormap,
};
Window parent = vo->opts->WinID >= 0 ? vo->opts->WinID : x11->rootwin; Window parent = vo->opts->WinID >= 0 ? vo->opts->WinID : x11->rootwin;