1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 15:22:09 +00:00

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
This commit is contained in:
iive 2011-05-29 23:05:57 +00:00 committed by Uoti Urpala
parent 15513a77fb
commit ab1544b74d

View File

@ -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);