|
From: Joe E. <jen...@fl...> - 2006-06-30 21:26:35
|
Vince Darley wrote:
> On 6/27/06, Joe English <jen...@fl...> wrote:
> > Here's what's probably happening:
> >
> > The Tile widgets have a built-in handler for ActivateNotify
> > and DeactivateNotify events that clears (resp. sets) the
> > TTK_STATE_BACKGROUND bit.
> >
> > When a window is activated/deactivated, macosx/tkMacOSXWm.c
> > calls TkGenerateActivateEvents(), which calls TkQueueEventForAllChildren(),
> > which in turn skips over children that aren't currently mapped.
>
> That sounds pretty sensible. Does that mean this is a bug in Tile, or
> that the above seemingly sensible behaviour of TkAqua is wrong? (in
> which case we should file a bug report against Tk).
I think it would be more useful if Tk delivered <Activate>/<Deactivate>
events to unmapped windows; otherwise it takes a lot more work
for widgets to keep track of whether or not their containing
toplevel is frontmost (which is what Tile is trying to do...)
The core [button] widget on OSX seems to have a similar problem
wrt. the "inactive" appearance getting out of sync. Try this
on OSX:
toplevel .t1 ; pack [button .t1.b -text T1]
toplevel .t2 ; pack [button .t2.b -text T2]
Focus on .t1, then on .t2; both buttons should appear in the
active state (black text). Then set the focus to another
application; .t2.b becomes inactive (gray text), but .t1.b
does not.
It looks like TkMacOSXDrawControl() decides whether to draw
in the inactive state based on whether the application as a whole
is frontmost. The button widget schedules a redisplay whenever
it receives an <Activate> or <Deactivate> event, but these
events aren't delivered to all windows when the app loses focus.
So when you switch from .t2 to another application, .t1 doesn't
redraw itself.
The Tile widgets (try to) base this decision on whether their
containing toplevel has the focus. I'm not sure which (if either)
is correct. Clues may be here:
<URL: http://developer.apple.com/documentation/Cocoa/Conceptual/WinPanel/
Concepts/ChangingMainKeyWindow.html >
--Joe English
jen...@fl...
|