summaryrefslogtreecommitdiffstats
path: root/media-sound/xmms/files/xmms-ds-gentoofix.patch
blob: 7a1ee3577bbf174df03aacc4a0cd7cccb971be29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
diff -dPNur xmms-1.2.10-gentoo/xmms/main.c xmms-1.2.10-new/xmms/main.c
--- xmms-1.2.10-gentoo/xmms/main.c	2005-12-29 02:48:54.000000000 +0000
+++ xmms-1.2.10-new/xmms/main.c	2005-12-29 02:51:06.000000000 +0000
@@ -3017,6 +3017,8 @@
 	
 }
 
+static sig_atomic_t exit_flag = 0;
+
 gint idle_func(gpointer data)
 {
 	gint time, t, length;
@@ -3026,6 +3028,8 @@
 
 	static GTimer *pause_timer = NULL;
 
+	if (exit_flag) mainwin_quit_cb();
+
 	if (get_input_playing())
 	{
 		GDK_THREADS_ENTER();
@@ -3393,13 +3397,7 @@
 /* Try to exit nicely when receiving a nice exit signal */
 void sigterm_handler(int sig)
 {
-	/* Original author of patch said that you should not use mainwin_quit_cb(),
-	 * but his way deadlock xmms, and it anyhow just calls ctrlsocket stuff with
-	 * with CMD_QUIT, which anyhow calls mainwin_quit_cb() in turn.  This is not
-	 * entirely clean, but works.
-	 * <azarah@gentoo.org> (19 Jan 2003)
-	xmms_remote_quit(ctrlsocket_get_session_id()); */
-	mainwin_quit_cb();
+	exit_flag = 1;
 }
 
 static gboolean pposition_configure(GtkWidget *w, GdkEventConfigure *event, gpointer data)