]> git.sesse.net Git - vlc/commitdiff
Qt: no popup menu over the status bar and menu bar
authorJean-Philippe Andre <jpeg@via.ecp.fr>
Sat, 11 Apr 2009 03:51:46 +0000 (11:51 +0800)
committerJean-Philippe Andre <jpeg@via.ecp.fr>
Sat, 11 Apr 2009 03:51:46 +0000 (11:51 +0800)
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp

index 6a8947939208472c93ddb0a7b037d9a2003a48f9..edfa08b2a75d86afac1de297c92eb5d6aba810d9 100644 (file)
@@ -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()
index 48aed59e481819c3a408128f288cf1adc7e170ce..3fd00aecb27510e9ce3a600b808b05e607b1da5e 100644 (file)
@@ -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 );