diff options
author | kostix <kostix@cc602e41-bd33-0410-9637-a208f32f1443> | 2009-04-07 23:39:39 +0000 |
---|---|---|
committer | kostix <kostix@cc602e41-bd33-0410-9637-a208f32f1443> | 2009-04-07 23:39:39 +0000 |
commit | db193a0c06cd836de923866d3725f93777f59c35 (patch) | |
tree | 66c5be54447461b19220577a57b5c4d9d21cc88a | |
parent | b31b54cda2b5cf4bbe2a844e259d93fb7a77a369 (diff) | |
download | urgent-db193a0c06cd836de923866d3725f93777f59c35.tar.gz urgent-db193a0c06cd836de923866d3725f93777f59c35.tar.xz urgent-db193a0c06cd836de923866d3725f93777f59c35.zip |
Improve per-chat state handling (fixes the 'focus before open_chat_post_hook' bug)
git-svn-id: http://svn.xmpp.ru/repos/tkabber-3rd-party/branches/plugins-0.11.1/urgent@208 cc602e41-bd33-0410-9637-a208f32f1443
-rw-r--r-- | urgent.tcl | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -116,13 +116,17 @@ proc urgent::chat_xwinid {chatid} { 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 @@ namespace eval urgent { } }] + 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 } |