From ab1544b74d5d3f440dbcac801c3e3ebd676f9d7b Mon Sep 17 00:00:00 2001 From: iive Date: Sun, 29 May 2011 23:05:57 +0000 Subject: [PATCH] cleanup: x11_common: remove pointless GC operations Remove useless XSetBackground() call right before freeing the graphic context. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33524 b3059339-0415-0410-9bf9-f77b7e298cf2 Create empty vo_gc graphic context instead of one with undefined foreground color. The code that uses vo_gc already employs XSetForeground()/XSetBackground() to change the context accordingly. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33525 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/x11_common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 12fc661dee..c576839ddb 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -732,7 +732,6 @@ void vo_x11_uninit(struct vo *vo) { if (x11->vo_gc != None) { - XSetBackground(vo->x11->display, x11->vo_gc, 0); XFreeGC(vo->x11->display, x11->vo_gc); x11->vo_gc = None; } @@ -1050,7 +1049,6 @@ void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y, struct MPOpts *opts = vo->opts; struct vo_x11_state *x11 = vo->x11; Display *mDisplay = vo->x11->display; - XGCValues xgcv; if (WinID >= 0) { vo_fs = flags & VOFLAG_FULLSCREEN; x11->window = WinID ? (Window)WinID : x11->rootwin; @@ -1122,7 +1120,8 @@ void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y, final: if (x11->vo_gc != None) XFreeGC(mDisplay, x11->vo_gc); - x11->vo_gc = XCreateGC(mDisplay, x11->window, GCForeground, &xgcv); + x11->vo_gc = XCreateGC(mDisplay, x11->window, 0, NULL); + XSync(mDisplay, False); x11->vo_mouse_autohide = 1; vo->event_fd = ConnectionNumber(x11->display);