changeset 6854:ded48a755830

gtk dialog bug fix
author pontscho
date Tue, 30 Jul 2002 23:09:24 +0000
parents c52dc92ebf4b
children fb56a6c15dca
files Gui/mplayer/gtk/about.c Gui/mplayer/gtk/eq.c Gui/mplayer/gtk/fs.c Gui/mplayer/gtk/mb.c Gui/mplayer/gtk/opts.c Gui/mplayer/gtk/pl.c Gui/mplayer/gtk/sb.c Gui/mplayer/gtk/url.c Gui/mplayer/widgets.c Gui/mplayer/widgets.h
diffstat 10 files changed, 26 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/gtk/about.c	Tue Jul 30 19:19:16 2002 +0000
+++ b/Gui/mplayer/gtk/about.c	Tue Jul 30 23:09:24 2002 +0000
@@ -15,7 +15,7 @@
  if ( gtkVAboutBox ) gtkActive( AboutBox );
    else AboutBox=create_About();
  gtk_widget_show( AboutBox );
- gtkVisible++;
+ gtkIncVisible();
 }
 
 void ab_AboutBox_show( GtkButton * button,gpointer user_data )
@@ -25,7 +25,7 @@
 {
  gtkVAboutBox=(int)user_data; 
  gtk_widget_destroy( AboutBox );
- gtkVisible--;
+ gtkDecVisible();
 }
 
 GtkWidget * create_About( void )
--- a/Gui/mplayer/gtk/eq.c	Tue Jul 30 19:19:16 2002 +0000
+++ b/Gui/mplayer/gtk/eq.c	Tue Jul 30 23:09:24 2002 +0000
@@ -142,13 +142,13 @@
 
  if ( gtk_notebook_get_current_page( GTK_NOTEBOOK( Notebook ) ) == 0 ) gtk_widget_show( Config );
  gtk_widget_show( Equalizer );
- gtkVisible++;
+ gtkIncVisible();
 }
 
 void HideEqualizer( void )
 {
  if ( !gtkVEqualizer ) return;
- gtkVEqualizer=0; gtkVisible--;
+ gtkVEqualizer=0; gtkDecVisible();
  gtk_widget_hide( Equalizer );
  gtk_widget_destroy( Equalizer );
  if ( gtkVEquConfig ) HideEquConfig();
--- a/Gui/mplayer/gtk/fs.c	Tue Jul 30 19:19:16 2002 +0000
+++ b/Gui/mplayer/gtk/fs.c	Tue Jul 30 23:09:24 2002 +0000
@@ -286,7 +286,7 @@
   
  gtk_window_set_modal( GTK_WINDOW( fsFileSelect ),modal );
 
- gtk_widget_show( fsFileSelect ); gtkVisible++;
+ gtk_widget_show( fsFileSelect ); gtkIncVisible();
 }
 
 void HideFileSelect( void )
@@ -294,7 +294,7 @@
  if ( !gtkVFileSelect ) return;
  gtk_widget_hide( fsFileSelect );
  gtk_widget_destroy( fsFileSelect );
- gtkVFileSelect=0; gtkVisible--;
+ gtkVFileSelect=0; gtkDecVisible();
 }
 
 void fs_fsFileSelect_destroy( GtkObject * object,gpointer user_data )
--- a/Gui/mplayer/gtk/mb.c	Tue Jul 30 19:19:16 2002 +0000
+++ b/Gui/mplayer/gtk/mb.c	Tue Jul 30 23:09:24 2002 +0000
@@ -20,11 +20,11 @@
    else MessageBox=create_MessageBox( 0 );
  gtkSetLayer( MessageBox );
  if ( strlen( msg ) < 20 ) gtk_widget_set_usize( MessageBox,196,-1 );
- gtkVisible++;
+ gtkIncVisible();
 }
 
 static void on_Ok_released( GtkButton * button,gpointer user_data  )
-{ gtkVMessageBox=0; gtk_widget_hide( MessageBox ); gtk_widget_destroy( MessageBox ); gtkVisible--; }
+{ gtkVMessageBox=0; gtk_widget_hide( MessageBox ); gtk_widget_destroy( MessageBox ); gtkDecVisible(); }
 
 static void on_MessageBox_show( GtkButton * button,gpointer user_data  )
 { gtkVMessageBox=(int)user_data; }
--- a/Gui/mplayer/gtk/opts.c	Tue Jul 30 19:19:16 2002 +0000
+++ b/Gui/mplayer/gtk/opts.c	Tue Jul 30 23:09:24 2002 +0000
@@ -228,7 +228,7 @@
  gtk_signal_connect( GTK_OBJECT( CLADrivers ),"select_row",GTK_SIGNAL_FUNC( prCListRow ),(void*)0 );
  gtk_signal_connect( GTK_OBJECT( CLVDrivers ),"select_row",GTK_SIGNAL_FUNC( prCListRow ),(void*)1 );
 
- gtkVPreferences=1; gtkVisible++;
+ gtkVPreferences=1; gtkIncVisible();
  gtk_widget_show( Preferences );
  gtkSetLayer( Preferences );
  gtkMessageBox( GTK_MB_WARNING,MSGTR_PREFERENCES_Message );
@@ -237,7 +237,7 @@
 void HidePreferences( void )
 {
  if ( !gtkVPreferences ) return;
- gtkVPreferences=0; gtkVisible--;
+ gtkVPreferences=0; gtkDecVisible();
  gtk_widget_hide( Preferences ); gtk_widget_destroy( Preferences );
  HideOSSConfig();
 }
@@ -1465,7 +1465,7 @@
 
  gtk_widget_show( OSSConfig );
  gtkSetLayer( OSSConfig );
- gtkVOSSConfig=1; gtkVisible++;
+ gtkVOSSConfig=1; gtkIncVisible();
 }
 
 void HideOSSConfig( void )
@@ -1473,7 +1473,7 @@
  if ( !gtkVOSSConfig ) return;
  gtk_widget_hide( OSSConfig );
  gtk_widget_destroy( OSSConfig ); 
- gtkVOSSConfig=0; gtkVisible--;
+ gtkVOSSConfig=0; gtkDecVisible();
 }
 
 static void ossDestroy( GtkObject * object,gpointer user_data )
--- a/Gui/mplayer/gtk/pl.c	Tue Jul 30 19:19:16 2002 +0000
+++ b/Gui/mplayer/gtk/pl.c	Tue Jul 30 23:09:24 2002 +0000
@@ -169,7 +169,7 @@
   }
  gtk_clist_thaw( GTK_CLIST( CLSelected ) );
 
- gtk_widget_show( PlayList ); gtkVisible++;
+ gtk_widget_show( PlayList ); gtkIncVisible();
 }
 
 void HidePlayList( void )
@@ -180,7 +180,7 @@
  if ( CLFileSelected ) free( CLFileSelected ); CLFileSelected=NULL;
  if ( old_path ) free( old_path ); old_path=strdup( current_path );
  gtk_widget_hide( PlayList );
- gtk_widget_destroy( PlayList ); gtkVisible--;
+ gtk_widget_destroy( PlayList ); gtkDecVisible();
 }
 
 static void plDestroy( GtkObject * object,gpointer user_data )
--- a/Gui/mplayer/gtk/sb.c	Tue Jul 30 19:19:16 2002 +0000
+++ b/Gui/mplayer/gtk/sb.c	Tue Jul 30 23:09:24 2002 +0000
@@ -29,13 +29,13 @@
 {
  if ( gtkVSkinBrowser ) gtkActive( SkinBrowser );
    else SkinBrowser=create_SkinBrowser();
- gtkVisible++;
+ gtkIncVisible();
 }
 
 void HideSkinBrowser( void )
 {
  if ( !gtkVSkinBrowser ) return;
- gtkVSkinBrowser=0; gtkVisible--;
+ gtkVSkinBrowser=0; gtkDecVisible();
  gtk_widget_destroy( SkinBrowser );
 }
 
--- a/Gui/mplayer/gtk/url.c	Tue Jul 30 19:19:16 2002 +0000
+++ b/Gui/mplayer/gtk/url.c	Tue Jul 30 23:09:24 2002 +0000
@@ -34,7 +34,7 @@
   }
  
  gtk_widget_show( URL );
- gtkVURLDialogBox=1; gtkVisible++;
+ gtkVURLDialogBox=1; gtkIncVisible();
 }
 
 void HideURLDialogBox( void )
@@ -42,7 +42,7 @@
  if ( !gtkVURLDialogBox ) return;
  gtk_widget_hide( URL );
  gtk_widget_destroy( URL );
- gtkVURLDialogBox=0; gtkVisible--;
+ gtkVURLDialogBox=0; gtkDecVisible();
 }
 
 static gboolean on_URL_destroy_event( GtkWidget * widget,GdkEvent * event,gpointer user_data )
--- a/Gui/mplayer/widgets.c	Tue Jul 30 19:19:16 2002 +0000
+++ b/Gui/mplayer/widgets.c	Tue Jul 30 23:09:24 2002 +0000
@@ -184,7 +184,7 @@
          } 
 	 else 
 	  {
-	   gtk_widget_destroy( SkinBrowser ); gtkVisible--;
+	   gtk_widget_destroy( SkinBrowser ); gtkDecVisible();
 	   gtkMessageBox( GTK_MB_ERROR,"Skin dirs not found ... Please install skins." );
 	  }
         break;
@@ -218,10 +218,10 @@
    case evShowPopUpMenu:
         gtkPopupMenu=evNone;
         gtkPopupMenuParam=0;
-        if ( PopUpMenu ) { gtk_widget_hide_on_delete( PopUpMenu ); gtkVisible--; }
+        if ( PopUpMenu ) { gtk_widget_hide_on_delete( PopUpMenu ); gtkDecVisible(); }
         PopUpMenu=create_PopUpMenu();
         gtk_menu_popup( GTK_MENU( PopUpMenu ),NULL,NULL,NULL,NULL,0,0 );
-	gtkVisible++;
+	gtkIncVisible();
         break;
    case evHidePopUpMenu:
         if ( PopUpMenu ) { gtk_widget_hide_on_delete( PopUpMenu ); /*gtkVisible--;*/ PopUpMenu=NULL; }
@@ -233,4 +233,6 @@
   }
 }
 
+void gtkIncVisible( void ) { gtkVisible++; }
+void gtkDecVisible( void ) { if ( gtkVisible > 0 ) gtkVisible--; }
 
--- a/Gui/mplayer/widgets.h	Tue Jul 30 19:19:16 2002 +0000
+++ b/Gui/mplayer/widgets.h	Tue Jul 30 23:09:24 2002 +0000
@@ -61,4 +61,7 @@
 extern void gtkSetLayer( GtkWidget * wdg );
 extern void gtkActive( GtkWidget * wdg );
 
+extern void gtkIncVisible( void );
+extern void gtkDecVisible( void );
+
 #endif