Screen positions reported by winfo rootx and winfo rooty are
sometimes incorrect in Aqua Tk 8.4.1. When I bring up a toplevel
Tix window, all other toplevel windows in the application after
being moved report that their rootx, rooty position equals that of
the Tix toplevel. This situation persists until the Tix toplevel is
unmapped or destroyed.
This problem occurs using a port of the Tix meta-widget package
to Mac Aqua that is not yet distributed so I cannot easily provide
test code to demonstrate the problem.
I have tracked the problem to Tk source code file
tk8.4.1/macosx/tkMacOSXMouseEvent.c
line 292 in function TkMacOSXProcessMouseEvent():
case inDrag:
DragWindow(medPtr->whichWin, where, NULL);
where2.h = where2.v = 0;
LocalToGlobal(&where2);
if (EqualPt(where, where2)) {
return false;
}
The LocalToGlobal() call in this code uses the current graphics
port, but the port is not set anywhere nearby above this call. In
the above incorrect rootx,rooty situation the wrong port is current.
Adding a SetPortWindowPort() before the LocalToGlobal() call
fixed the problem.
case inDrag:
DragWindow(medPtr->whichWin, where, NULL);
where2.h = where2.v = 0;
SetPortWindowPort(medPtr->whichWin); /* Added by Tom G to
fix wrong window position bug. */
LocalToGlobal(&where2);
if (EqualPt(where, where2)) {
return false;
}
I am not familiar enough with the code to know if this is the
correct solution.
Tom Goddard
goddard@cgl.ucsf.edu
Nobody/Anonymous ( nobody ) - 2003-02-11 01:59
5
Closed
Duplicate
Daniel A. Steffen
66. Aqua Window Operations
obsolete: 8.4.1
Public
|
Date: 2005-09-20 02:20 Logged In: YES |
|
Date: 2005-09-05 22:20 Logged In: YES |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Pending | 2005-09-20 02:20 | sf-robot |
| close_date | 2005-09-05 22:20 | 2005-09-20 02:20 | sf-robot |
| status_id | Open | 2005-09-05 22:20 | hobbs |
| resolution_id | None | 2005-09-05 22:20 | hobbs |
| close_date | - | 2005-09-05 22:20 | hobbs |
| summary | Incorrect screen positions reported, Aqua Tk 8.4.1 | 2003-10-03 15:12 | dgp |
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use