From: Jean-Philippe André Date: Mon, 26 May 2008 22:43:20 +0000 (+0200) Subject: Bugfix: non disparition of the Qt Popup Menu with X11 or SDL outputs. X-Git-Tag: 0.9.0-test0~679 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=0448c670c32d9fc60889ce2c3e8f72330a389e44;p=vlc Bugfix: non disparition of the Qt Popup Menu with X11 or SDL outputs. Actually, we just need to do like Direct3D: catch left-click. --- diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp index 0917be034b..495b6762ba 100644 --- a/modules/gui/qt4/main_interface.cpp +++ b/modules/gui/qt4/main_interface.cpp @@ -1208,7 +1208,6 @@ static int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable, vlc_value_t old_val, vlc_value_t new_val, void *param ) { intf_thread_t *p_intf = (intf_thread_t *)param; - msg_Dbg( p_this, "Menu Requested" ); // DEBUG to track the non disparition of the menu... if( p_intf->pf_show_dialog ) { @@ -1226,7 +1225,6 @@ static int IntfShowCB( vlc_object_t *p_this, const char *psz_variable, vlc_value_t old_val, vlc_value_t new_val, void *param ) { intf_thread_t *p_intf = (intf_thread_t *)param; - msg_Dbg( p_this, "Intf Show Requested" ); // DEBUG to track the non disparition of the menu... p_intf->p_sys->p_mi->requestLayoutUpdate(); return VLC_SUCCESS; diff --git a/modules/video_output/sdl.c b/modules/video_output/sdl.c index 86a0da4e7b..27f2ea2c03 100644 --- a/modules/video_output/sdl.c +++ b/modules/video_output/sdl.c @@ -429,12 +429,27 @@ static int Manage( vout_thread_t *p_vout ) switch( event.button.button ) { case SDL_BUTTON_LEFT: - var_Get( p_vout, "mouse-button-down", &val ); - val.i_int &= ~1; - var_Set( p_vout, "mouse-button-down", val ); + { + playlist_t *p_playlist; + + var_Get( p_vout, "mouse-button-down", &val ); + val.i_int &= ~1; + var_Set( p_vout, "mouse-button-down", val ); + + val.b_bool = true; + var_Set( p_vout, "mouse-clicked", val ); + + p_playlist = vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST, + FIND_ANYWHERE ); - val.b_bool = true; - var_Set( p_vout, "mouse-clicked", val ); + if( p_playlist != NULL ) + { + vlc_value_t val; + val.b_bool = false; + var_Set( p_playlist, "intf-popupmenu", val ); + vlc_object_release( p_playlist ); + } + } break; case SDL_BUTTON_MIDDLE: diff --git a/modules/video_output/x11/xcommon.c b/modules/video_output/x11/xcommon.c index be72fc9bb0..d6d625ba8c 100644 --- a/modules/video_output/x11/xcommon.c +++ b/modules/video_output/x11/xcommon.c @@ -1290,12 +1290,26 @@ static int ManageVideo( vout_thread_t *p_vout ) switch( ((XButtonEvent *)&xevent)->button ) { case Button1: - var_Get( p_vout, "mouse-button-down", &val ); - val.i_int &= ~1; - var_Set( p_vout, "mouse-button-down", val ); + { + playlist_t *p_playlist; - val.b_bool = true; - var_Set( p_vout, "mouse-clicked", val ); + var_Get( p_vout, "mouse-button-down", &val ); + val.i_int &= ~1; + var_Set( p_vout, "mouse-button-down", val ); + + val.b_bool = true; + var_Set( p_vout, "mouse-clicked", val ); + + p_playlist = vlc_object_find( p_vout, + VLC_OBJECT_PLAYLIST, + FIND_ANYWHERE ); + if( p_playlist != NULL ) + { + vlc_value_t val; val.b_bool = false; + var_Set( p_playlist, "intf-popupmenu", val ); + vlc_object_release( p_playlist ); + } + } break; case Button2: