--- gnome-applets-1.4.0.5-orig/mixer/mixer.c	Sat Feb  2 23:12:57 2002
+++ gnome-applets-1.4.0.5/mixer/mixer.c	Mon May 27 14:47:02 2002
@@ -77,7 +77,6 @@
 #endif
 
 #include "lamp-small.xpm"
-#include "lamp-small-red.xpm"
 
 typedef void (*MixerUpdateFunc) (GtkWidget *, gint);
 
@@ -245,7 +244,6 @@
 	tvol = (vol << 8) + vol;
 /*g_message("Saving mixer value of %d",tvol);*/
 	ioctl(mixerfd, MIXER_WRITE(mixerchannel), &tvol);
-	ioctl(mixerfd, MIXER_WRITE(SOUND_MIXER_SPEAKER), &tvol);
 #endif
 #ifdef SUN_API
  	audio_info_t ainfo;
@@ -275,42 +273,16 @@
 }
 
 static void 
-mute_cb (GtkWidget *widget, gpointer   data)
+change_channel_cb (GtkWidget *widget, gpointer   data)
 {
-	static gint old_vol=-1;
-	MixerData *p = data;
-	MixerWidget *mx;
-
-	mx = gtk_object_get_user_data(GTK_OBJECT(widget));
-
-	if (GTK_TOGGLE_BUTTON (widget)->active ) {
-		if (p->mute ==0) {
-			/* turn off the timeout */
-			gtk_widget_set_sensitive(mx->hslider, FALSE);
-			gtk_widget_set_sensitive(mx->vslider, FALSE);
-			p->mute = 1;
-			old_vol = readMixer();
-			setMixer(0);
-			gnome_pixmap_load_xpm_d(GNOME_PIXMAP(mx->hlightwid),
-				       		lamp_small_red_xpm);
-			gnome_pixmap_load_xpm_d(GNOME_PIXMAP(mx->vlightwid),
-				       		lamp_small_red_xpm);
-		}
-	} else {
-		if (p->mute ==1) {
-			p->mute = 0;
-			if (old_vol >= 0)
-				setMixer(old_vol);
-			gtk_widget_set_sensitive(mx->hslider, TRUE);
-			gtk_widget_set_sensitive(mx->vslider, TRUE);
-			gnome_pixmap_load_xpm_d(GNOME_PIXMAP(mx->hlightwid),
-				       		lamp_small_xpm);
-			gnome_pixmap_load_xpm_d(GNOME_PIXMAP(mx->vlightwid),
-				       		lamp_small_xpm);
-		}
+	if(mixerchannel == SOUND_MIXER_VOLUME) {
+		mixerchannel = SOUND_MIXER_SPEAKER;
+		applet_widget_set_tooltip(APPLET_WIDGET(applet), _("Speaker Volume (click button to switch)"));
+	} else if (mixerchannel == SOUND_MIXER_SPEAKER) {
+		mixerchannel = SOUND_MIXER_VOLUME;
+		applet_widget_set_tooltip(APPLET_WIDGET(applet), _("Main Volume (click button to switch)"));
 	}
-/* printf("In mute_cb: mute button state is %d\n",p->mute); */
-/*	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(widget), p->mute); */
+		
 }
 
 static void
@@ -426,10 +398,6 @@
 
 	mx = gtk_object_get_user_data(GTK_OBJECT(mixer));
 
-	/* get out of mute mode if the volume is turned up by another program. */
-	if ((md->mute ==1) && (mvol !=0))
-	    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mx->hmutebutton),0);
-
 	/* change the sliders to reflect the new value. */
 	/*   ignore if we're in mute mode. */
 	if (!md->mute) {
@@ -467,8 +435,8 @@
 
 	base = gtk_vbox_new(FALSE, 0);	
 	
-	hbutton = gtk_toggle_button_new();
-	vbutton = gtk_toggle_button_new();
+	hbutton = gtk_button_new();
+	vbutton = gtk_button_new();
 	
 	vbox=gtk_vbox_new(FALSE,0);	
 	align=gtk_alignment_new(0.5,0.0, 1.0, 1.0);
@@ -491,10 +459,6 @@
 	gtk_range_set_update_policy (GTK_RANGE(vscale), GTK_UPDATE_CONTINUOUS);
        	gtk_range_set_update_policy (GTK_RANGE(hscale), GTK_UPDATE_CONTINUOUS);
 
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(hbutton), 0);
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(vbutton), 0);
-
-
 	/* cosmetic settings */
 	GTK_WIDGET_UNSET_FLAGS(vscale, GTK_CAN_DEFAULT);
 	GTK_WIDGET_UNSET_FLAGS(vscale, GTK_CAN_FOCUS);
@@ -544,19 +508,13 @@
         gtk_signal_connect(GTK_OBJECT(hadj), "value_changed",
 			   (GtkSignalFunc)adj_cb, (gpointer)hadj);
 
-	/* keep mute buttons in sync */	
-	gtk_signal_connect(GTK_OBJECT(vbutton), "toggled",
-		  (GtkSignalFunc)set_other_button_cb, (gpointer)hbutton);
-	gtk_signal_connect(GTK_OBJECT(hbutton), "toggled",
-		  (GtkSignalFunc)set_other_button_cb, (gpointer)vbutton);
-
 	/* apply mute button events */
-	gtk_signal_connect(GTK_OBJECT(vbutton), "toggled",
-		   (GtkSignalFunc)mute_cb, (gpointer)md);
-        gtk_signal_connect(GTK_OBJECT(hbutton), "toggled",
-		   (GtkSignalFunc)mute_cb, (gpointer)md);
+	gtk_signal_connect(GTK_OBJECT(vbutton), "clicked",
+		   (GtkSignalFunc)change_channel_cb, (gpointer)md);
+        gtk_signal_connect(GTK_OBJECT(hbutton), "clicked",
+		   (GtkSignalFunc)change_channel_cb, (gpointer)md);
 
-	applet_widget_set_tooltip(APPLET_WIDGET(applet), _("Main Volume and Mute"));
+	applet_widget_set_tooltip(APPLET_WIDGET(applet), _("Main Volume (click button to switch)"));
 
 	
 
