From ac156b34dafc325049c475fcccac75a9d35533bc Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 21 Feb 2003 11:48:53 +0000 Subject: Use the panedwindow's depth, not the screen's default depth. [Bug #671122] --- ChangeLog | 6 ++++++ generic/tkPanedWindow.c | 8 +++----- tests/constraints.tcl | 1 + tests/panedwindow.test | 15 ++++++++++++++- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6a2a2ab..0b33e59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-02-21 Donal K. Fellows + + * tests/panedwindow.test (panedwindow-30.1): + * generic/tkPanedWindow.c (DisplayPanedWindow, DisplayProxyWindow): + Use the window's depth, not the screen's default depth. [Bug #671122] + 2003-02-20 Daniel Steffen * library/console.tcl: (aqua & macintosh) added missing diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 3a1fa98..a096c75 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.12 2003/02/21 01:57:51 hobbs Exp $ + * RCS: @(#) $Id: tkPanedWindow.c,v 1.13 2003/02/21 11:48:54 dkf Exp $ */ #include "tkPort.h" @@ -1364,8 +1364,7 @@ DisplayPanedWindow(clientData) */ pixmap = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin), - Tk_Width(tkwin), Tk_Height(tkwin), - DefaultDepthOfScreen(Tk_Screen(tkwin))); + Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin)); /* * Redraw the widget's background and border. @@ -2434,8 +2433,7 @@ DisplayProxyWindow(clientData) */ pixmap = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin), - Tk_Width(tkwin), Tk_Height(tkwin), - DefaultDepthOfScreen(Tk_Screen(tkwin))); + Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin)); /* * Redraw the widget's background and border. diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 01ed60d..3006cca 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -159,6 +159,7 @@ testConstraint pseudocolor8 [expr {([catch { toplevel .t -visual {pseudocolor 8} -colormap new }] == 0) && ([winfo depth .t] == 8)}] destroy .t +testConstraint haveTruecolor24 [expr {[lsearch [winfo visualsavailable .] {truecolor 24}] != -1}] setupbg set app [dobg {tk appname}] testConstraint secureserver 0 diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 99a75c7..e073d4a 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.7 2003/02/21 01:57:51 hobbs Exp $ +# RCS: @(#) $Id: panedwindow.test,v 1.8 2003/02/21 11:48:56 dkf Exp $ package require tcltest 2.1 namespace import -force tcltest::configure @@ -2462,6 +2462,19 @@ test panedwindow-29.2 {resizing height} { -result {100 110} } +test panedwindow-30.1 {display on depths other than the default one} { + -constraints {pseudocolor8 haveTruecolor24} + -body { + toplevel .t -visual {truecolor 24} + pack [panedwindow .t.p] + .t.p add [frame .t.p.f1] [frame .t.p.f2] + update + # If we got here, we didn't crash and that's good + } + -cleanup {destroy .t} + -result {} +} + # cleanup ::tcltest::cleanupTests return -- cgit v0.12