[vlc-devel] commit: Qt: no popup menu over the status bar and menu bar ( Jean-Philippe Andre )

git version control git at videolan.org
Sat Apr 11 06:44:22 CEST 2009


vlc | branch: master | Jean-Philippe Andre <jpeg at via.ecp.fr> | Sat Apr 11 11:51:46 2009 +0800| [ee95f804cd45fc13ff3da0b754cd1b546b50e9ca] | committer: Jean-Philippe Andre 

Qt: no popup menu over the status bar and menu bar

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

 modules/gui/qt4/main_interface.cpp |   10 +++++++---
 modules/gui/qt4/main_interface.hpp |    2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 6a89479..edfa08b 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -246,7 +246,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     /* Enable the popup menu in the MI */
     setContextMenuPolicy( Qt::CustomContextMenu );
     CONNECT( this, customContextMenuRequested( const QPoint& ),
-             this, popupMenu() );
+             this, popupMenu( const QPoint& ) );
 
     /* Final sizing and showing */
     setMinimumWidth( __MAX( controls->sizeHint().width(),
@@ -633,9 +633,13 @@ void MainInterface::toggleFSC()
    QApplication::postEvent( fullscreenControls, eShow );
 }
 
-void MainInterface::popupMenu()
+void MainInterface::popupMenu( const QPoint &p )
 {
-    QVLCMenu::PopupMenu( p_intf, true );
+    /* Ow, that's ugly: don't show the popup menu if cursor over
+     * the main menu bar or the status bar */
+    if( !childAt( p ) || ( ( childAt( p ) != menuBar() )
+                        && ( childAt( p )->parentWidget() != statusBar() ) ) )
+        QVLCMenu::PopupMenu( p_intf, true );
 }
 
 void MainInterface::debug()
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index 48aed59..3fd00ae 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -158,7 +158,7 @@ public slots:
     void toggleAdvanced();
     void toggleFullScreen();
     void toggleFSC();
-    void popupMenu();
+    void popupMenu( const QPoint& );
 
     /* Manage the Video Functions from the vout threads */
     void releaseVideoSlot( void );




More information about the vlc-devel mailing list