changeset 2980:c4b6dc8bb554

fix middle menu hideing bug
author pontscho
date Sun, 18 Nov 2001 19:22:55 +0000
parents 6d341644ee28
children 4db0210755eb
files Gui/mplayer/gtk/menu.c Gui/mplayer/psignal.c Gui/mplayer/sw.h Gui/mplayer/widgets.c Gui/mplayer/widgets.h
diffstat 5 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/gtk/menu.c	Sun Nov 18 19:19:57 2001 +0000
+++ b/Gui/mplayer/gtk/menu.c	Sun Nov 18 19:22:55 2001 +0000
@@ -10,6 +10,7 @@
 {
 // fprintf( stderr,"[menu] item: %d\n",Item );
  gtkShMem->popupmenu=Item;
+ gtkShMem->visiblepopupmenu=0; 
  gtkSendMessage( evShowPopUpMenu );
 }
 
@@ -52,6 +53,7 @@
 }
 
 GtkWidget * DVDSubMenu;
+GtkWidget * DVDTitleMenu;
 GtkWidget * DVDAudioLanguageMenu;
 GtkWidget * DVDSubtitleLanguageMenu;
 
@@ -68,7 +70,7 @@
    SubMenu=AddSubMenu( Menu,"Open ..." );
     AddMenuItem( SubMenu,"Play file ...""    ", evLoadPlay );
     AddMenuItem( SubMenu,"Play VCD ...", evNone );
-    AddMenuItem( SubMenu,"Play DVD ...", evNone );
+    AddMenuItem( SubMenu,"Play DVD ...", evPlayDVD );
     AddMenuItem( SubMenu,"Play URL ...", evNone );
     AddMenuItem( SubMenu,"Load subtitle ...   ", evLoadSubtitle );
    SubMenu=AddSubMenu( Menu,"Playing" );
@@ -89,9 +91,10 @@
     AddMenuItem( SubMenu,"Double size", evDoubleSize );
     AddMenuItem( SubMenu,"Fullscreen", evFullScreen );
    DVDSubMenu=AddSubMenu( Menu,"DVD" );
-    AddMenuItem( DVDSubMenu,"Play disc ...""    ", evNone );
+    AddMenuItem( DVDSubMenu,"Play disc ...""    ", evPlayDVD );
     AddMenuItem( DVDSubMenu,"Show DVD Menu", evNone );
     AddSeparator( DVDSubMenu );
+    DVDTitleMenu=AddSubMenu( DVDSubMenu,"Titles" );
     DVDAudioLanguageMenu=AddSubMenu( DVDSubMenu,"Audio language" );
     DVDSubtitleLanguageMenu=AddSubMenu( DVDSubMenu,"Subtitle language" );
   AddSeparator( Menu );
--- a/Gui/mplayer/psignal.c	Sun Nov 18 19:19:57 2001 +0000
+++ b/Gui/mplayer/psignal.c	Sun Nov 18 19:22:55 2001 +0000
@@ -128,7 +128,14 @@
         break;
    case evShowPopUpMenu:
         gtkShMem->popupmenu=evNone;
+	if ( gtkShMem->visiblepopupmenu ) gtk_widget_hide_on_delete( PopUpMenu );
+        PopUpMenu=create_PopUpMenu();
         gtk_menu_popup( GTK_MENU( PopUpMenu ),NULL,NULL,NULL,NULL,0,0 );
+	gtkShMem->visiblepopupmenu=1;
+	break;
+   case evHidePopUpMenu:
+        if ( gtkShMem->visiblepopupmenu ) gtk_widget_hide_on_delete( PopUpMenu );
+	gtkShMem->visiblepopupmenu=0;
 	break;
   }
  gtkShMem->message=0;
--- a/Gui/mplayer/sw.h	Sun Nov 18 19:19:57 2001 +0000
+++ b/Gui/mplayer/sw.h	Sun Nov 18 19:22:55 2001 +0000
@@ -32,13 +32,15 @@
 
  mplMouseTimer=mplMouseTimerConst;
  wsVisibleMouse( &appMPlayer.subWindow,wsShowMouseCursor );
+ 
 
  switch( Button )
   {
    case wsPMMouseButton:
-        gtkSendMessage( evShowPopUpMenu );
-	break;
+          gtkSendMessage( evShowPopUpMenu );
+          break;
    case wsPRMouseButton:
+	  if ( gtkShMem->visiblepopupmenu ) gtkSendMessage( evHidePopUpMenu );
           mplShowMenu( RX,RY );
           msButton=wsPRMouseButton;
           break;
@@ -48,6 +50,7 @@
           break;
 // ---
    case wsPLMouseButton:
+	  if ( gtkShMem->visiblepopupmenu ) gtkSendMessage( evHidePopUpMenu );
           sx=X; sy=Y;
           msButton=wsPLMouseButton;
           mplSubMoved=0;
--- a/Gui/mplayer/widgets.c	Sun Nov 18 19:19:57 2001 +0000
+++ b/Gui/mplayer/widgets.c	Sun Nov 18 19:22:55 2001 +0000
@@ -59,7 +59,7 @@
  FileSelect=create_FileSelect();
  MessageBox=create_MessageBox(0);
  Options=create_Options();
- PopUpMenu=create_PopUpMenu();
+// PopUpMenu=create_PopUpMenu();
 }
 
 // --- forked function
--- a/Gui/mplayer/widgets.h	Sun Nov 18 19:19:57 2001 +0000
+++ b/Gui/mplayer/widgets.h	Sun Nov 18 19:22:55 2001 +0000
@@ -52,7 +52,9 @@
  gtkSkinStruct         sb;
  gtkVisibleStruct      vs;
  gtkOptionsStruct      op;
+ 
  int		       popupmenu;
+ int		       visiblepopupmenu;
 } gtkCommStruct;
 
 extern gtkCommStruct * gtkShMem;