[Tkabber-dev] r1302 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Nov 8 11:48:11 MSK 2007


Author: sergei
Date: 2007-11-08 11:48:10 +0300 (Thu, 08 Nov 2007)
New Revision: 1302

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/chats.tcl
Log:
	* chats.tcl: Added workaround for underscrolled chatlog windows which
	  are opened at Tkabber startup and not mapped yet (so their height is
	  one pixel and adding any text to it likely switches off smart
	  scrolling).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-11-08 06:46:42 UTC (rev 1301)
+++ trunk/tkabber/ChangeLog	2007-11-08 08:48:10 UTC (rev 1302)
@@ -2,6 +2,11 @@
 
 	* msgs/pl.msg: Updated Polish translation (thanks to Irek Chmielowiec).
 
+	* chats.tcl: Added workaround for underscrolled chatlog windows which
+	  are opened at Tkabber startup and not mapped yet (so their height is
+	  one pixel and adding any text to it likely switches off smart
+	  scrolling).
+
 2007-11-02  Sergei Golovan  <sgolovan at nes.ru>
 
 	* msgs/de.msg: Updated German translation (thanks to Roger Sondermann).

Modified: trunk/tkabber/chats.tcl
===================================================================
--- trunk/tkabber/chats.tcl	2007-11-08 06:46:42 UTC (rev 1301)
+++ trunk/tkabber/chats.tcl	2007-11-08 08:48:10 UTC (rev 1302)
@@ -865,10 +865,14 @@
 	    $chatw insert end "\n"
 	}
 
+	# In the last condition we work around the underscrolling if the chat
+	# window wasn't maped yet. It's unlikely that mapped chat window will
+	# be exactly 1 pixel tall.
 	if {$body != "" && !$options(stop_scroll) && \
 		(!$options(smart_scroll) || \
 		     ($options(smart_scroll) && $scroll) || \
-		     [chat::is_our_jid $chatid $from])} {
+		     [chat::is_our_jid $chatid $from] || \
+		     [winfo height $chatw] == 1)} {
 	    after idle [list catch [list $chatw yview moveto 1]]
 	}
 



More information about the Tkabber-dev mailing list