[Tkabber-dev] r1911 - in trunk/tkabber: . ifacetk

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Feb 2 00:07:43 MSK 2010


Author: sergei
Date: 2010-02-02 00:07:43 +0300 (Tue, 02 Feb 2010)
New Revision: 1911

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/ifacetk/iface.tcl
Log:
	* ifacetk/iface.tcl: Don't change windows title too frequently because
	  it hurts some windows managers.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2010-02-01 18:45:24 UTC (rev 1910)
+++ trunk/tkabber/ChangeLog	2010-02-01 21:07:43 UTC (rev 1911)
@@ -8,6 +8,9 @@
 
 	* msgs/de.msg: Updated German translation (thanks to Roger Sondermann).
 
+	* ifacetk/iface.tcl: Don't change windows title too frequently because
+	  it hurts some windows managers.
+
 2010-01-31  Sergei Golovan  <sgolovan at nes.ru>
 
 	* chats.tcl, muc.tcl, plugins/chat/muc_ignore.tcl: Changed arguments

Modified: trunk/tkabber/ifacetk/iface.tcl
===================================================================
--- trunk/tkabber/ifacetk/iface.tcl	2010-02-01 18:45:24 UTC (rev 1910)
+++ trunk/tkabber/ifacetk/iface.tcl	2010-02-01 21:07:43 UTC (rev 1911)
@@ -1140,8 +1140,7 @@
 	    set title $chat::chats(titlename,$chatid)
 	}
 
-	wm title $cw $title
-	wm iconname $cw $title
+	set_window_title_after_idle $cw $title
     }
 }
 
@@ -1186,10 +1185,31 @@
     } else {
 	set title $main_window_title
     }
-    wm title . $title
-    wm iconname . $title
+    set_window_title_after_idle . $title
 }
 
+proc ifacetk::set_window_title_after_idle {w title} {
+    variable title_after_id
+    variable title_after_value
+
+    set title_after_value($w) $title
+
+    if {![info exists title_after_id($w)]} {
+	set title_after_id($w) \
+	    [after idle [namespace code [list set_window_title $w]]]
+    }
+}
+
+proc ifacetk::set_window_title {w} {
+    variable title_after_id
+    variable title_after_value
+
+    wm title $w $title_after_value($w)
+    wm iconname $w $title_after_value($w)
+    unset title_after_id($w)
+    unset title_after_value($w)
+}
+
 proc ifacetk::chat_window_is_active {chatid} {
     global usetabbar
 
@@ -1252,8 +1272,7 @@
     variable main_window_title
 
     set main_window_title "[connection_jid $xlib] - Tkabber"
-    wm title . $main_window_title
-    wm iconname . $main_window_title
+    set_window_title_after_idle . $main_window_title
 }
 
 proc ifacetk::set_main_window_title_on_disconnect {xlib} {
@@ -1265,8 +1284,7 @@
 	set main_window_title \
 	    "[connection_jid [lindex [connections] end]] - Tkabber"
     }
-    wm title . $main_window_title
-    wm iconname . $main_window_title
+    set_window_title_after_idle . $main_window_title
 }
 
 hook::add connected_hook \



More information about the Tkabber-dev mailing list