diff -uNrp xine-ui-0.99.6.src_deb/src/xitk/event.c xine-ui-0.99.6.src/src/xitk/event.c --- xine-ui-0.99.6.src_deb/src/xitk/event.c 2011-06-28 21:19:16.923629973 -0500 +++ xine-ui-0.99.6.src/src/xitk/event.c 2011-06-28 21:17:14.574569953 -0500 @@ -39,6 +39,7 @@ #include #include #include +#include /* input_pvr functionality needs this */ #define XINE_ENABLE_EXPERIMENTAL_FEATURES @@ -108,6 +109,10 @@ static const char *const shortcut_style[ NULL }; +static volatile int reject_events = 1; + +pthread_mutex_t event_mutex = PTHREAD_MUTEX_INITIALIZER; + int hidden_file_cb(int action, int value) { xine_cfg_entry_t cfg_entry; int retval = 0; @@ -362,6 +367,16 @@ static char *pts2str(int64_t pts) { void gui_execute_action_id(action_id_t action) { xine_event_t xine_event; + if(reject_events) + return; + + pthread_mutex_lock(&event_mutex); + + if (reject_events) { + pthread_mutex_unlock(&event_mutex); + return; + } + if(action & ACTID_IS_INPUT_EVENT) { /* Note: In the following overflow checks, we must test against INT_MAX */ @@ -405,9 +420,11 @@ void gui_execute_action_id(action_id_t a } /* check if osd menu like this event */ - if( oxine_action_event(action & ~ACTID_IS_INPUT_EVENT) ) + if( oxine_action_event(action & ~ACTID_IS_INPUT_EVENT) ) { + pthread_mutex_unlock(&event_mutex); return; - + } + /* events for advanced input plugins. */ xine_event.type = action & ~ACTID_IS_INPUT_EVENT; xine_event.data_length = 0; @@ -416,6 +433,7 @@ void gui_execute_action_id(action_id_t a gettimeofday(&xine_event.tv, NULL); xine_event_send(gGui->stream, &xine_event); + pthread_mutex_unlock(&event_mutex); return; } @@ -1210,6 +1228,7 @@ void gui_execute_action_id(action_id_t a gGui->numeric.arg = 0; gGui->alphanum.set = 0; gGui->alphanum.arg = ""; + pthread_mutex_unlock(&event_mutex); } /* @@ -1473,6 +1492,7 @@ static void gui_find_visual (Visual **vi } void gui_deinit(void) { + reject_events = 1; xitk_unregister_event_handler(&gGui->widget_key); } @@ -1826,6 +1846,7 @@ void gui_init (int nfiles, char *filenam gui_set_current_mmk(mediamark_get_current_mmk()); panel_init(); + reject_events = 0; } void gui_init_imlib (Visual *vis) { diff -uNrp xine-ui-0.99.6.src_deb/src/xitk/lirc.c xine-ui-0.99.6.src/src/xitk/lirc.c --- xine-ui-0.99.6.src_deb/src/xitk/lirc.c 2010-01-26 12:31:55.000000000 -0600 +++ xine-ui-0.99.6.src/src/xitk/lirc.c 2011-06-28 21:17:38.874383280 -0500 @@ -105,9 +105,7 @@ static void *xine_lirc_loop(void *dummy) k = kbindings_lookup_action(gGui->kbindings, c); if(k) { - XLockDisplay(gGui->display); gui_execute_action_id((kbindings_get_action_id(k))); - XUnlockDisplay(gGui->display); } else { char from[256];