[MPlayer-cvslog] r38620 - trunk/gui/dialog/equalizer.c

ib subversion at mplayerhq.hu
Tue Jun 25 15:14:27 EEST 2024


Author: ib
Date: Tue Jun 25 15:14:26 2024
New Revision: 38620

Log:
Treat closing the equalizer window as canceling the dialog.

Modified:
   trunk/gui/dialog/equalizer.c

Modified: trunk/gui/dialog/equalizer.c
==============================================================================
--- trunk/gui/dialog/equalizer.c	Mon Jun 24 21:19:47 2024	(r38619)
+++ trunk/gui/dialog/equalizer.c	Tue Jun 25 15:14:26 2024	(r38620)
@@ -176,7 +176,7 @@ static void eqButtonReleased( GtkButton
 
  switch( GPOINTER_TO_INT(user_data) )
   {
-   case 0:
+   case 0: // must only destroy! (see eqDelete)
         gtk_widget_destroy( Equalizer );
         if ( EquConfig ) gtk_widget_destroy( EquConfig );
         break;
@@ -252,6 +252,17 @@ static void eqNotebook( GtkNotebook * no
   }
 }
 
+static gboolean eqDelete (GtkWidget *widget, GdkEvent *event, gpointer user_data)
+{
+  (void) widget;
+  (void) event;
+  (void) user_data;
+
+  eqButtonReleased(NULL, GINT_TO_POINTER(0)); // press ok to destroy windows
+
+  return TRUE;
+}
+
 static GtkWidget * CreateEqualizer( void )
 {
   GtkWidget * vbox1;
@@ -439,6 +450,7 @@ static GtkWidget * CreateEqualizer( void
   gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_KEY_Escape,0,GTK_ACCEL_VISIBLE );
   gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_KEY_Return,0,GTK_ACCEL_VISIBLE );
 
+  g_signal_connect( G_OBJECT( Equalizer ),"delete-event",G_CALLBACK( eqDelete ),NULL );
   g_signal_connect( G_OBJECT( Equalizer ),"destroy",G_CALLBACK( gtk_widget_destroyed ),&Equalizer );
   g_signal_connect( G_OBJECT( Equalizer ),"focus-in-event",G_CALLBACK( eqFocus ),GINT_TO_POINTER(2) );
 


More information about the MPlayer-cvslog mailing list