[comp.windows.x.motif] Keyboard Focus and Unmapping

nazgul@alphalpha.com (Kee Hinckley) (11/22/90)

I previously reported a bug (to motif-talk) which described a
situation where I was doing window cacheing.  I would use an
accelerator to close the window and then find (sometimes)
that accelerators and traversal no longer worked in the original
window.  Pulldown a menu would fix the problem.  Similarly
when I brought up the unmapped window with an accelerator
the keyboard stuff wouldn't always work in it either.

More recently I noticed that sometimes when I closed the
window with an accelerator I would just plain crash.  The
traceback is singularly unuseful:

Status         00040004: reference to illegal address (OS/MS
T manager)
In routine     "DispatchEvent" line 513
Called from    "DecideToDispatch" line 848
Called from    "XtDispatchEvent" line 899
Called from    "XtAppProcessEvent" line 799
Called from    "uaSelect" line 43
Called from    "main" line 86

As an experiment I decided to not use the accelerators to close
the window.  Lo and behold, both problems went away.

My guess is that somebody somewhere is trying to do some
input processing on a window which has been unmapped.  The
particular line in DispatchEvent is trying to dereference an event
table.  The particular dereference is when it's trying to make a copy
of the table since it's afraid that XtRemoveEventHandler might
make it go away.  My guess is that somebody has already called
XtRemoveEventHandler, but I really have no real idea.

Can anyone think of any work around that would force the focus
to be somewhere else or would possibly do *something* to make
this work?

On a totally different subject.  Why do some widgets request a
resize everytime they get redrawn?  If I obscure a window and
then let it display - everybody seems to think it would be fun
to try to resize to their optimal size.