[vlc-devel] [PATCH] Bugfix: non disparition of the Qt Popup Menu with X11 or SDL outputs.

Jean-Philippe André jpeg at via.ecp.fr
Tue May 27 00:43:20 CEST 2008


Actually, we just need to do like Direct3D: catch left-click.
---
 modules/gui/qt4/main_interface.cpp |    2 --
 modules/video_output/sdl.c         |   34 +++++++++++++++++++++++++++++-----
 modules/video_output/x11/xcommon.c |   33 ++++++++++++++++++++++++++++-----
 3 files changed, 57 insertions(+), 12 deletions(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 0917be0..495b676 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 86a0da4..80cf8cc 100644
--- a/modules/video_output/sdl.c
+++ b/modules/video_output/sdl.c
@@ -429,12 +429,36 @@ 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 );
+                {
+                    intf_thread_t *p_intf;
+                    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 );
 
-                val.b_bool = true;
-                var_Set( p_vout, "mouse-clicked", val );
+                    p_intf = vlc_object_find( p_vout, VLC_OBJECT_INTF,
+                                                      FIND_ANYWHERE );
+                    if( p_intf )
+                    {
+                        p_intf->b_menu_change = 1;
+                        vlc_object_release( p_intf );
+                    }
+
+                    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 SDL_BUTTON_MIDDLE:
diff --git a/modules/video_output/x11/xcommon.c b/modules/video_output/x11/xcommon.c
index 82d653a..cdceea4 100644
--- a/modules/video_output/x11/xcommon.c
+++ b/modules/video_output/x11/xcommon.c
@@ -1293,12 +1293,35 @@ 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 );
+                    {
+                        intf_thread_t *p_intf;
+                        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_intf = vlc_object_find( p_vout, VLC_OBJECT_INTF,
+                                                          FIND_ANYWHERE );
+                        if( p_intf )
+                        {
+                            p_intf->b_menu_change = 1;
+                            vlc_object_release( p_intf );
+                        }
 
-                    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:
-- 
1.5.5.1




More information about the vlc-devel mailing list