From: Daniel Caujolle-B. <f1...@us...> - 2005-01-01 01:26:40
|
Update of /cvsroot/xine/xine-ui/src/xitk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13764 Modified Files: actions.c actions.h panel.c Log Message: wait 'til window is really displayed, fix runtime not updated when: panel is hidden, engine playing, then engine paused + panel shown. Index: actions.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/actions.c,v retrieving revision 1.254 retrieving revision 1.255 diff -u -r1.254 -r1.255 --- actions.c 16 Dec 2004 16:14:07 -0000 1.254 +++ actions.c 1 Jan 2005 01:26:21 -0000 1.255 @@ -76,6 +76,13 @@ } +void wait_for_window_visible(Display *display, Window window) { + int t = 0; + + while((!xitk_is_window_visible(display, window)) && (++t < 3)) + xine_usec_sleep(5000); +} + void raise_window(Window window, int visible, int running) { if(window) { if(visible && running) { @@ -87,6 +94,7 @@ void toggle_window(Window window, xitk_widget_list_t *widget_list, int *visible, int running) { if(window && (*visible) && running) { + XLockDisplay(gGui->display); if(gGui->use_root_window) { if(xitk_is_window_visible(gGui->display, window)) @@ -103,17 +111,21 @@ XUnmapWindow(gGui->display, window); } XUnlockDisplay(gGui->display); + } else { if(running) { *visible = 1; xitk_show_widgets(widget_list); + XLockDisplay(gGui->display); XRaiseWindow(gGui->display, window); XMapWindow(gGui->display, window); if(!gGui->use_root_window && gGui->video_display == gGui->display) XSetTransientForHint (gGui->display, window, gGui->video_window); XUnlockDisplay(gGui->display); + + wait_for_window_visible(gGui->display, window); layer_above_video(window); } } @@ -156,10 +168,8 @@ * */ void try_to_set_input_focus(Window window) { - int t = 0; - while((!xitk_is_window_visible(gGui->display, window)) && (++t < 3)) - xine_usec_sleep(5000); + wait_for_window_visible(gGui->display, window); if(xitk_is_window_visible(gGui->display, window)) { XLockDisplay (gGui->display); Index: actions.h =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/actions.h,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- actions.h 16 Dec 2004 16:14:08 -0000 1.60 +++ actions.h 1 Jan 2005 01:26:21 -0000 1.61 @@ -38,6 +38,7 @@ void toggle_window(Window window, xitk_widget_list_t *widget_list, int *visible, int running); int gui_xine_get_pos_length(xine_stream_t *stream, int *pos, int *time, int *length); +void wait_for_window_visible(Display *display, Window window); void try_to_set_input_focus(Window window); void gui_display_logo(void); int gui_xine_play(xine_stream_t *stream, int start_pos, int start_time, int update_mmk); Index: panel.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/panel.c,v retrieving revision 1.218 retrieving revision 1.219 diff -u -r1.218 -r1.219 --- panel.c 18 Dec 2004 08:51:59 -0000 1.218 +++ panel.c 1 Jan 2005 01:26:21 -0000 1.219 @@ -300,6 +300,7 @@ return; if(!gui_xine_get_pos_length(gGui->stream, &pos, &seconds, &length)) { + if((gGui->stream_length.pos || gGui->stream_length.time) && gGui->stream_length.length) { pos = gGui->stream_length.pos; seconds = gGui->stream_length.time; @@ -307,6 +308,7 @@ } else return; + } if(pos || seconds) { @@ -456,44 +458,45 @@ } } + } + + if(gGui->logo_mode == 0) { - if(gGui->logo_mode == 0) { + if(panel_is_visible()) { + + panel_update_runtime_display(); + + if(xitk_is_widget_enabled(panel->playback_widgets.slider_play)) { + if(pos >= 0) + xitk_slider_set_pos(panel->playback_widgets.slider_play, pos); + } - if(panel_is_visible()) { + if(!(i % 20)) { + int level = 0; - panel_update_runtime_display(); + panel_update_channel_display(); - if(xitk_is_widget_enabled(panel->playback_widgets.slider_play)) { - if(pos >= 0) - xitk_slider_set_pos(panel->playback_widgets.slider_play, pos); + if((gGui->mixer.method == SOUND_CARD_MIXER) && + (gGui->mixer.caps & MIXER_CAP_VOL)) { + level = gGui->mixer.volume_level = + xine_get_param(gGui->stream, XINE_PARAM_AUDIO_VOLUME); } - - if(!(i % 20)) { - int level = 0; - - panel_update_channel_display(); - - if((gGui->mixer.method == SOUND_CARD_MIXER) && - (gGui->mixer.caps & MIXER_CAP_VOL)) { - level = gGui->mixer.volume_level = - xine_get_param(gGui->stream, XINE_PARAM_AUDIO_VOLUME); - } - else if(gGui->mixer.method == SOFTWARE_MIXER) { - level = gGui->mixer.amp_level = - xine_get_param(gGui->stream, XINE_PARAM_AUDIO_AMP_LEVEL); - } - - xitk_slider_set_pos(panel->mixer.slider, level); - panel_check_mute(); - - i = 0; + else if(gGui->mixer.method == SOFTWARE_MIXER) { + level = gGui->mixer.amp_level = + xine_get_param(gGui->stream, XINE_PARAM_AUDIO_AMP_LEVEL); } + xitk_slider_set_pos(panel->mixer.slider, level); + panel_check_mute(); + + i = 0; } - if(stream_infos_is_visible() && gGui->stream_info_auto_update) - stream_infos_update_infos(); } + + if(stream_infos_is_visible() && gGui->stream_info_auto_update) + stream_infos_update_infos(); + } } } @@ -618,9 +621,10 @@ XRaiseWindow(gGui->display, gGui->panel_window); XMapWindow(gGui->display, gGui->panel_window); if(!gGui->use_root_window && gGui->video_display == gGui->display) - XSetTransientForHint (gGui->display, gGui->panel_window, gGui->video_window); + XSetTransientForHint (gGui->display, gGui->panel_window, gGui->video_window); XUnlockDisplay (gGui->display); + wait_for_window_visible(gGui->display, gGui->panel_window); layer_above_video(gGui->panel_window); if(gGui->cursor_grabbed) { @@ -674,6 +678,7 @@ xitk_slider_set_pos(panel->playback_widgets.slider_play, pos); panel_update_runtime_display(); } + panel_update_mrl_display(); } |