summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2013-04-27 23:26:26 +0200
committerBerke Viktor <bviktor@hexchat.org>2013-04-27 23:26:26 +0200
commitc6513ea7a2dcb76194d63643f76b376e04a26f7f (patch)
tree08cab5790c5bc04d43d2fc3fb6c0a066244907c5
parent6001ceff9f9383c4c3f04e056cd09b118d11b044 (diff)
Use "Instant Message Notification" system sound on Windows, use gdk_beep() on Unix
Note: gdk_beep() is expected to be replaced with libcanberra stuff.
-rw-r--r--src/fe-gtk/fe-gtk.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c
index e11eeaf6..e26fb6d0 100644
--- a/src/fe-gtk/fe-gtk.c
+++ b/src/fe-gtk/fe-gtk.c
@@ -662,7 +662,17 @@ fe_beep (session *sess)
 {
 	if (!prefs.hex_gui_focus_omitalerts || !fe_gui_info (sess, 0) == 1)
 	{
+#ifdef WIN32
+		if (!PlaySound ("Notification.IM", NULL, SND_ALIAS|SND_ASYNC))
+		{
+			/* This is really just a fallback attempt, may or may not work on new Windows releases, especially on x64.
+			 * You should set up the "Instant Message Notification" system sound instead, supported on Vista and up.
+			 */
+			Beep (1000, 50);
+		}
+#else
 		gdk_beep ();
+#endif
 	}
 }