summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--generic/tkPanedWindow.c10
-rw-r--r--tests/panedwindow.test19
3 files changed, 34 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index aaeb10f..ccceb62 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-07-18 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/panedwindow.test (panedwindow-30.2):
+ * generic/tkPanedWindow.c (Tk_PanedWindowObjCmd): Ensure that we
+ can share GCs between a panedwindow and its sash proxy, even if
+ the panedwindow is in a toplevel with a different visual. [Bug 702230]
+
2003-07-17 Daniel Steffen <das@users.sourceforge.net>
* macosx/Makefile: Changes for new tcl buildsystem.
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index 9763487..c0385af 100644
--- a/generic/tkPanedWindow.c
+++ b/generic/tkPanedWindow.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkPanedWindow.c,v 1.13.2.2 2003/07/17 20:49:00 dkf Exp $
+ * RCS: @(#) $Id: tkPanedWindow.c,v 1.13.2.3 2003/07/18 09:53:16 dkf Exp $
*/
#include "tkPort.h"
@@ -424,6 +424,14 @@ Tk_PanedWindowObjCmd(clientData, interp, objc, objv)
}
pwPtr->proxywin = Tk_CreateAnonymousWindow(interp, parent, (char *) NULL);
+ /*
+ * The proxy window has to be able to share GCs with the main
+ * panedwindow despite being children of windows with potentially
+ * different characteristics, and it looks better that way too.
+ * [Bug 702230]
+ */
+ Tk_SetWindowVisual(pwPtr->proxywin,
+ Tk_Visual(tkwin), Tk_Depth(tkwin), Tk_Colormap(tkwin));
Tk_CreateEventHandler(pwPtr->proxywin, ExposureMask, ProxyWindowEventProc,
(ClientData) pwPtr);
diff --git a/tests/panedwindow.test b/tests/panedwindow.test
index 67a695d..f2af591 100644
--- a/tests/panedwindow.test
+++ b/tests/panedwindow.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: panedwindow.test,v 1.8.2.1 2003/07/17 00:37:03 hobbs Exp $
+# RCS: @(#) $Id: panedwindow.test,v 1.8.2.2 2003/07/18 09:53:16 dkf Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -2495,6 +2495,23 @@ test panedwindow-30.1 {display on depths other than the default one} {
-cleanup {destroy .t}
-result {}
}
+test panedwindow-30.2 {display on depths other than the default one} {
+ -constraints {pseudocolor8 haveTruecolor24}
+ -body {
+ toplevel .t -visual {pseudocolor 8}
+ pack [frame .t.f -visual {truecolor 24}]
+ pack [panedwindow .t.f.p]
+ .t.f.p add [frame .t.f.p.f1 -width 5] [frame .t.f.p.f2 -width 5]
+ update
+ .t.f.p proxy place 1 1
+ update
+ .t.f.p proxy forget
+ update
+ # If we got here, we didn't crash and that's good
+ }
+ -cleanup {destroy .t}
+ -result {}
+}
# cleanup
::tcltest::cleanupTests