diff options
author | phintuka <phintuka> | 2008-04-10 10:43:18 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2008-04-10 10:43:18 +0000 |
commit | f0bfc3c4213beea8f87e14ad61a7acc1f6908752 (patch) | |
tree | 70162ec8badb858242c402759afc427c16e1f993 | |
parent | ffe930eabdb3b04e88ed47ea479f15925ae5d009 (diff) | |
download | xineliboutput-f0bfc3c4213beea8f87e14ad61a7acc1f6908752.tar.gz xineliboutput-f0bfc3c4213beea8f87e14ad61a7acc1f6908752.tar.bz2 |
Add locking to ConfigureNotify and Focus event handling
(Patch from Antti Seppälä)
-rw-r--r-- | xine_sxfe_frontend.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c index 2a17178f..473064ef 100644 --- a/xine_sxfe_frontend.c +++ b/xine_sxfe_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_sxfe_frontend.c,v 1.38 2008-03-31 23:08:26 phintuka Exp $ + * $Id: xine_sxfe_frontend.c,v 1.39 2008-04-10 10:43:18 phintuka Exp $ * */ @@ -1190,16 +1190,20 @@ static int sxfe_run(frontend_t *this_gen) if(this->hud) { if(cev->window == this->window[0]) { int hud_x, hud_y; + XLockDisplay(cev->display); XTranslateCoordinates(this->display, this->window[0], DefaultRootWindow(this->display), 0, 0, &hud_x, &hud_y, &tmp_win); XResizeWindow(this->display, this->hud_window, cev->width, cev->height); XMoveWindow(this->display, this->hud_window, hud_x, hud_y); set_cursor(this->display, this->hud_window, 1); + XUnlockDisplay(cev->display); } else if(cev->window == this->window[1]) { + XLockDisplay(cev->display); XResizeWindow(this->display, this->hud_window, cev->width, cev->height); XMoveWindow(this->display, this->hud_window, 0, 0); set_cursor(this->display, this->hud_window, 0); + XUnlockDisplay(cev->display); } } @@ -1236,7 +1240,9 @@ static int sxfe_run(frontend_t *this_gen) XFocusChangeEvent *fev = (XFocusChangeEvent *) &event; /* Show HUD again if sxfe window receives focus */ if(fev->window == this->window[0] || fev->window == this->window[1]) { + XLockDisplay(fev->display); XMapWindow(this->display, this->hud_window); + XUnlockDisplay(fev->display); } } break; @@ -1247,7 +1253,9 @@ static int sxfe_run(frontend_t *this_gen) XFocusChangeEvent *fev = (XFocusChangeEvent *) &event; /* Dismiss HUD window if focusing away from frontend window */ if(fev->window == this->window[0] || fev->window == this->window[1]) { + XLockDisplay(fev->display); XUnmapWindow(this->display, this->hud_window); + XUnlockDisplay(fev->display); } } break; |