This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: [RFA] managedwin patch for kde
- To: Fernando Nasser <fnasser at redhat dot com>
- Subject: Re: [RFA] managedwin patch for kde
- From: "Martin M. Hunt" <hunt at redhat dot com>
- Date: Mon, 9 Apr 2001 10:36:34 -0700 (PDT)
- cc: <insight at sources dot redhat dot com>
On Mon, 9 Apr 2001, Fernando Nasser wrote:
> "Martin M. Hunt" wrote:
> >
> > I finally set up Windows and installed Cygwin. It works fine without this
> > patch. How about I change this patch to only do the raise if tcl_platform
> > is unix?
> >
>
> Sounds like a good idea. Just add the test and check it in.
>
OK. Checked in now. Final patch is below.
2001-04-09 Martin M. Hunt <hunt@redhat.com>
* library/managedwin.itb (ManagedWin::reveal): After
deiconifying window for the first time, set its geometry
again, if the platform is unix. This fixes a problem with kde.
(ManagedWin::_create): Set a variable with the initial
geometry.
Index: gdbtk/library/managedwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/managedwin.itb,v
retrieving revision 1.11
diff -u -p -r1.11 managedwin.itb
--- managedwin.itb 2001/03/01 20:00:12 1.11
+++ managedwin.itb 2001/04/09 17:27:15
@@ -1,4 +1,4 @@
-# Managed window for GDBtk.
+# Managed window for Insight.
# Copyright 1998, 1999, 2000, 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
@@ -67,8 +67,18 @@ body ManagedWin::reveal {} {
update idletasks
set top [winfo toplevel [namespace tail $this]]
+ set g [wm geometry $top]
+ #debug "$top geometry=$g state=[wm state $top]"
raise $top
wm deiconify $top
+ if {[info exists ::$top._init_geometry]} {
+ upvar ::$top._init_geometry gm
+ if {$::tcl_platform(platform) == "unix"} {
+ wm geometry $top $gm
+ }
+ unset ::$top._init_geometry
+ }
+ #debug "$top geometry=[wm geometry $top] state=[wm state $top]"
# There used to be a `focus -force' here, but using -force is
# unfriendly, so it was removed. It was then replaced with a simple
@@ -292,8 +302,9 @@ body ManagedWin::_create { class args }
set g "${w}x${h}+${x}+${y}"
}
if {[expr $x+50] < $_screenwidth && [expr $y+20] < $_screenheight} {
- wm geometry $top $g
wm positionfrom $top user
+ wm geometry $top $g
+ set ::$top._init_geometry $g
}
}
}
@@ -322,7 +333,6 @@ body ManagedWin::find { win } {
# PUBLIC PROC: init
# ------------------------------------------------------------
body ManagedWin::init {} {
- debug
wm withdraw .
set _screenheight [winfo screenheight .]
set _screenwidth [winfo screenwidth .]