diff options
author | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-18 21:24:42 +0000 |
---|---|---|
committer | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-18 21:24:42 +0000 |
commit | 4839b7a2bcff636b49f74e7e3f12d3e7e7a6fd6f (patch) | |
tree | 44427168c467018637502e9741b167bdeee86f49 /Gui/mplayer/gtk | |
parent | 8081bf7ded09d718f68f282917424af58bf26ee1 (diff) |
fix skin loading bug
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5691 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui/mplayer/gtk')
-rw-r--r-- | Gui/mplayer/gtk/sb.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Gui/mplayer/gtk/sb.c b/Gui/mplayer/gtk/sb.c index ac991eff44..6de1cf76b2 100644 --- a/Gui/mplayer/gtk/sb.c +++ b/Gui/mplayer/gtk/sb.c @@ -20,6 +20,7 @@ char * sbMPlayerDirInHome=NULL; char * sbMPlayerPrefixDir=NULL; char * gtkOldSkin; +static char * prev; int gtkFillSkinList( gchar * mdir ) { @@ -30,6 +31,7 @@ int gtkFillSkinList( gchar * mdir ) struct stat fs; gtkOldSkin=strdup( skinName ); + prev=gtkOldSkin; if ( ( str[0]=(char *)calloc( 1,7 ) ) == NULL ) { gtkMessageBox( GTK_MB_FATAL,MSGTR_SKINBROWSER_NotEnoughMemory ); @@ -64,7 +66,7 @@ void on_SkinBrowser_destroy( GtkObject * object,gpointer user_data ) void on_SkinBrowser_Cancel( GtkObject * object,gpointer user_data ) { - ChangeSkin( skinName ); + if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) ChangeSkin( gtkOldSkin ); gtk_widget_hide( SkinBrowser ); } @@ -79,9 +81,18 @@ void on_SkinBrowser_Ok( GtkObject * object,gpointer user_data ) void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data ) { gtk_clist_get_text( clist,row,0,&sbSelectedSkin ); - ChangeSkin( sbSelectedSkin ); + if ( strcmp( prev,sbSelectedSkin ) ) + { + prev=sbSelectedSkin; + ChangeSkin( sbSelectedSkin ); + } if( !bevent ) return; - if( bevent->type == GDK_2BUTTON_PRESS ) gtk_widget_hide( SkinBrowser ); + if( bevent->type == GDK_2BUTTON_PRESS ) + { + if ( skinName ) free( skinName ); + skinName=strdup( sbSelectedSkin ); + gtk_widget_hide( SkinBrowser ); + } } GtkWidget * create_SkinBrowser( void ) |