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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Nov 13 19:32:50 MSK 2007


Author: sergei
Date: 2007-11-13 19:32:49 +0300 (Tue, 13 Nov 2007)
New Revision: 1311

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/ifacetk/bwidget_workarounds.tcl
Log:
	* ifacetk/bwidget_workarounds.tcl: Make dialogs non-transient to their
	parents if parents aren't viewable. Transient window in this case
	become unmapped too and grab to it leads to complete application hang.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-11-12 05:29:48 UTC (rev 1310)
+++ trunk/tkabber/ChangeLog	2007-11-13 16:32:49 UTC (rev 1311)
@@ -1,3 +1,9 @@
+2007-11-13  Sergei Golovan  <sgolovan at nes.ru>
+
+	* ifacetk/bwidget_workarounds.tcl: Make dialogs non-transient to their
+	parents if parents aren't viewable. Transient window in this case
+	become unmapped too and grab to it leads to complete application hang.
+
 2007-11-12  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/chat/logger.tcl: Replace trailing dot by its hexadecimal

Modified: trunk/tkabber/ifacetk/bwidget_workarounds.tcl
===================================================================
--- trunk/tkabber/ifacetk/bwidget_workarounds.tcl	2007-11-12 05:29:48 UTC (rev 1310)
+++ trunk/tkabber/ifacetk/bwidget_workarounds.tcl	2007-11-13 16:32:49 UTC (rev 1311)
@@ -319,4 +319,31 @@
 proc BWidget::bindMouseWheel {widget} {}
 
 ##########################################################################
+auto_load Dialog
 
+rename Dialog::create Dialog::create:old
+
+proc Dialog::create {path args} {
+    toplevel $path
+    wm withdraw $path
+    set parent [winfo parent $path]
+    destroy $path
+    set transient 1
+    set newargs {}
+    foreach {key val} $args {
+	switch -- $key {
+	    -parent { set parent $val ; lappend newargs -parent $val }
+	    -transient { set transient $val }
+	    default { lappend newargs $key $val }
+	}
+    }
+    # Do not make a dialog window transient if its parent isn't vewable.
+    # Otherwise it leads to hang of a whole application.
+    if {![winfo viewable [winfo toplevel $parent]] } {
+	set transient 0
+    }
+    eval {Dialog::create:old $path -transient $transient} $newargs
+}
+
+##########################################################################
+



More information about the Tkabber-dev mailing list