From: Hans-Dieter K. <fs...@us...> - 2006-10-29 03:39:32
|
Update of /cvsroot/xine/xine-ui/src/xitk/xine-toolkit In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12196 Modified Files: menu.c Log Message: Small optimization to get input focus. Index: menu.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/xine-toolkit/menu.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- menu.c 29 Oct 2006 01:23:11 -0000 1.28 +++ menu.c 29 Oct 2006 03:39:30 -0000 1.29 @@ -398,17 +398,21 @@ Window focused_win; do { - int placeholder; + int revert; XLOCK(menu_window->display); XSetInputFocus(menu_window->display, (xitk_window_get_window(menu_window->xwin)), RevertToParent, CurrentTime); - /* Retry until the WM was mercyful to give us the focus (but not indefinitely) */ XSync(menu_window->display, False); - xitk_usec_sleep(10000); - XGetInputFocus(menu_window->display, &focused_win, &placeholder); XUNLOCK(menu_window->display); - } while(focused_win != xitk_window_get_window(menu_window->xwin) && retry++ < 20); + + /* Retry until the WM was mercyful to give us the focus (but not indefinitely) */ + xitk_usec_sleep(5000); + XLOCK(menu_window->display); + XGetInputFocus(menu_window->display, &focused_win, &revert); + XUNLOCK(menu_window->display); + + } while((focused_win != xitk_window_get_window(menu_window->xwin)) && (retry++ < 30)); } } |