[Tkabber-dev] r2017 - in trunk/tkabber: . plugins/general

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Jul 26 16:21:58 MSK 2013


Author: sergei
Date: 2013-07-26 16:21:58 +0400 (Fri, 26 Jul 2013)
New Revision: 2017

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/general/sound.tcl
Log:
	* plugins/general/sound.tcl: Use the sound package instead of snack to
	  prevent unnecessary Tk loading in case of using a separate thread
	  for playing sound.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2013-07-06 12:29:13 UTC (rev 2016)
+++ trunk/tkabber/ChangeLog	2013-07-26 12:21:58 UTC (rev 2017)
@@ -1,3 +1,9 @@
+2013-07-26  Sergei Golovan  <sgolovan at nes.ru>
+
+	* plugins/general/sound.tcl: Use the sound package instead of snack to
+	  prevent unnecessary Tk loading in case of using a separate thread
+	  for playing sound.
+
 2013-07-06  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/search/search.tcl: Generate <<ListboxSelect>> event on found

Modified: trunk/tkabber/plugins/general/sound.tcl
===================================================================
--- trunk/tkabber/plugins/general/sound.tcl	2013-07-06 12:29:13 UTC (rev 2016)
+++ trunk/tkabber/plugins/general/sound.tcl	2013-07-26 12:21:58 UTC (rev 2017)
@@ -8,11 +8,7 @@
 
     if {![catch {package require Thread 2.0}]} {
 	variable SoundThread [thread::create]
-	if {![catch {thread::send $SoundThread {package require snack 2.0}}]} {
-	    # Some distributions of Snack unconditionally require Tk, which
-	    # creates unneeded toplevel window . in a new thread, so
-	    # withdrawing it.
-	    thread::send $SoundThread {catch {wm withdraw .}}
+	if {![catch {thread::send $SoundThread {package require sound 2.0}}]} {
 	    set snack 2
 	} else {
 	    set snack 0
@@ -20,7 +16,7 @@
 	    unset SoundThread
 	}
     } else {
-	if {![catch {package require snack 2.0}]} {
+	if {![catch {package require sound 2.0}]} {
 	    set snack 1
 	} else {
 	    set snack 0



More information about the Tkabber-dev mailing list