[Tkabber-dev] r208 - branches/plugins-0.11.1/urgent

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Apr 8 03:39:39 MSD 2009


Author: kostix
Date: 2009-04-08 03:39:39 +0400 (Wed, 08 Apr 2009)
New Revision: 208

Modified:
   branches/plugins-0.11.1/urgent/urgent.tcl
Log:
Improve per-chat state handling (fixes the 'focus before open_chat_post_hook' bug)

Modified: branches/plugins-0.11.1/urgent/urgent.tcl
===================================================================
--- branches/plugins-0.11.1/urgent/urgent.tcl	2009-04-07 23:07:11 UTC (rev 207)
+++ branches/plugins-0.11.1/urgent/urgent.tcl	2009-04-07 23:39:39 UTC (rev 208)
@@ -116,13 +116,17 @@
     xclientwinid $tkwin
 }
 
+proc urgent::initialize {chatid type} {
+    variable state
+    set state(active,$chatid) false
+}
+
 proc urgent::record_xwinid {chatid _type} {
     variable state
     set state(xwinid,$chatid) [xwinid $chatid]
-    set state(active,$chatid) false
 }
 
-proc urgent::forget_xwinid {chatid} {
+proc urgent::cleanup {chatid} {
     variable state
 
     unset state(xwinid,$chatid)
@@ -177,8 +181,9 @@
 	}
     }]
 
+    hook::add open_chat_pre_hook [namespace current]::initialize
     hook::add open_chat_post_hook [namespace current]::record_xwinid 40
-    hook::add close_chat_post_hook [namespace current]::forget_xwinid
+    hook::add close_chat_post_hook [namespace current]::cleanup
     hook::add draw_message_hook [namespace current]::chat_message_notify 19
     hook::add got_focus_hook [namespace current]::clear_urgency_hint
 }



More information about the Tkabber-dev mailing list