[vlc-devel] commit: Bugfix: non disparition of the Qt Popup Menu with X11 or SDL outputs. ( Jean-Philippe André )

git version control git at videolan.org
Tue May 27 01:25:44 CEST 2008


vlc | branch: master | Jean-Philippe André <jpeg at via.ecp.fr> | Tue May 27 00:43:20 2008 +0200| [0448c670c32d9fc60889ce2c3e8f72330a389e44]

Bugfix: non disparition of the Qt Popup Menu with X11 or SDL outputs.

Actually, we just need to do like Direct3D: catch left-click.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0448c670c32d9fc60889ce2c3e8f72330a389e44
---

 modules/gui/qt4/main_interface.cpp |    2 --
 modules/video_output/sdl.c         |   25 ++++++++++++++++++++-----
 modules/video_output/x11/xcommon.c |   24 +++++++++++++++++++-----
 3 files changed, 39 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..27f2ea2 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 be72fc9..d6d625b 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:




More information about the vlc-devel mailing list