+ /* Delete and recreate a popup if there is one */
+ if( p_intf->p_sys->p_popup_menu )
+ delete p_intf->p_sys->p_popup_menu;
+
+ QMenu *menu = new QMenu();
+ QMenu *submenu;
+ QAction *action;
+ bool b_isFullscreen = false;
+
+ POPUP_BOILERPLATE;
+
+ PopupMenuControlEntries( menu, p_intf, p_input );
+ menu->addSeparator();
+
+ if( p_input )
+ {
+ vlc_object_t *p_vout = (vlc_object_t *)
+ vlc_object_find( p_input, VLC_OBJECT_VOUT, FIND_CHILD );
+
+ /* Add a fullscreen switch button */
+ if( p_vout )
+ {
+ vlc_value_t val;
+ var_Get( p_vout, "fullscreen", &val );
+ b_isFullscreen = !( !val.b_bool );
+ if( b_isFullscreen )
+ CreateAndConnect( menu, "fullscreen",
+ qtr( "Leave Fullscreen" ),"" , ITEM_NORMAL,
+ VLC_OBJECT(p_vout), val, VLC_VAR_BOOL,
+ b_isFullscreen );
+ vlc_object_release( p_vout );
+ }
+
+ menu->addSeparator();
+
+ vlc_object_hold( p_input );
+ InputAutoMenuBuilder( VLC_OBJECT( p_input ), objects, varnames );
+ vlc_object_release( p_input );
+
+ submenu = new QMenu( menu );
+ action = menu->addMenu( AudioMenu( p_intf, submenu ) );
+ action->setText( qtr( "&Audio" ) );
+ if( action->menu()->isEmpty() )
+ action->setEnabled( false );
+
+ submenu = new QMenu( menu );
+ action = menu->addMenu( VideoMenu( p_intf, submenu ) );
+ action->setText( qtr( "&Video" ) );
+ if( action->menu()->isEmpty() )
+ action->setEnabled( false );
+
+ submenu = new QMenu( menu );
+ action = menu->addMenu( NavigMenu( p_intf, submenu ) );
+ action->setText( qtr( "&Playback" ) );
+ if( action->menu()->isEmpty() )
+ action->setEnabled( false );
+ }
+
+ menu->addSeparator();
+
+ /* Add some special entries for windowed mode: Interface Menu */
+ if( !b_isFullscreen )