On Sun, Sep 04, 2005, Johan Vromans wrote about "[ctwm] Re: Problem with OOo
beta 2":
> 'wrong' and 'broken' are harsh terms. As I try to see it, I suspect
> there's a specific way of mapping (some) windows that causes these
> problems with a specific window manager. Had they (OOo? GTK? Xorg?)
> chosen a different way to handle these windows it would not impose
> problems, given the manyfold of applications that behave right.
I think I have made some progress in understanding this bug, and even found
a workaround for people who want to use OpenOffice in ctwm without switching
to a different window manager.
While I do have some experience in low-level X-Windows programming, it's
been a while since I dabbled in Xlib and ICCCM, and my debugging skills are
especially rusty, so I can't really shed more light on what's going on
with OpenOffice on ctwm. Also, I am not familiar with ctwm's code so I did
not try debugging it directly.
Instead, what I tried was to list (with "xev") the events happening on
the root window while the context menu flashes and does not appear.
This is what I see, with my commentary after ****'s
CreateNotify event, serial 13, synthetic NO, window 0x48,
parent 0x48, window 0x22064ba, (0,0), width 200, height 200
border_width 0, override YES
**** This is the pop-up window being created. The id (0x22065ba) is
**** different every time, so OpenOffice is not reusing popup windows.
**** so far, so good.
ConfigureNotify event, serial 13, synthetic NO, window 0x48,
event 0x48, window 0x22064ba, (995,581), width 114, height 48,
border_width 0, above 0xa0014b, override YES
**** The popup window is moved and resized to 114x48+995+581
MapNotify event, serial 13, synthetic NO, window 0x48,
event 0x48, window 0x22064ba, override YES
**** ~the popup window is finally mapped. Great.
*** Ctwm uses a focus-follows-pointer, so the focus moves from the old
*** window to whatever is now below the pointer (the popup window).
*** The next three events - FocusOut, FocusIn and KeymapNotify, are all
*** related to this focus change.
*** (If you want the full unbelievably complicated story, check out
*** http://tronche.com/gui/x/xlib/events/input-focus/normal-and-grabbed.html)
FocusOut event, serial 13, synthetic NO, window 0x48,
mode NotifyNormal, detail NotifyNonlinearVirtual
FocusIn event, serial 13, synthetic NO, window 0x48,
mode NotifyNormal, detail NotifyPointerRoot
KeymapNotify event, serial 13, synthetic NO, window 0x0,
keys: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
*** Now comes the bad part. After recieving keyboard focus, Openoffice
*** suddenly decides to unmap the new window, and finally destroy it
UnmapNotify event, serial 13, synthetic NO, window 0x48,
event 0x48, window 0x22064ba, from_configure NO
*** And again, with a synthetic event! (I can't explain why this would
*** happen - a synthethic event unmapping an already unmapped window???
UnmapNotify event, serial 13, synthetic YES, window 0x48,
event 0x48, window 0x22064ba, from_configure NO
DestroyNotify event, serial 13, synthetic NO, window 0x48,
event 0x48, window 0x22064ba
*** And the focus returns to the window below
FocusOut event, serial 13, synthetic NO, window 0x48,
mode NotifyNormal, detail NotifyPointer
FocusOut event, serial 13, synthetic NO, window 0x48,
mode NotifyNormal, detail NotifyPointerRoot
FocusIn event, serial 13, synthetic NO, window 0x48,
mode NotifyNormal, detail NotifyNonlinearVirtual
KeymapNotify event, serial 13, synthetic NO, window 0x0,
keys: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
In short, I guesed that something bad happens in OpenOffice following the
focus change. I suspected that maybe the difference between ctwm and those
other window managers people tried is that those other window managers use
a "click to type scheme" (consistant with the fad to emulate MS-Windows...),
unlike ctwm's default behavior.
So, I tried using ctwm but f.focus()ing the Openoffice window in which I was
trying to elicit those context-menus, and lo and behold - the context menu
DOES WORK NOW!
So my current guess is that ctwm is not doing anything bad, but rather that
something in OpenOffice or Gtk or whatever is not dealing properly with
focus-follows-pointer window managers.
I will continue to explore this guess, and come back to the list with my
findings, if any.
>
> Have you tried to put the mouse on the File menu, click once (so it
> appears) and then move the mouse to Edit. On my configuration, the
> Edit menu appears only to disappear (mapped behind the window?) almost
> immedeately. Moving to View makes the View menu appear (which stays
> visible), then Insert appears/disappers, and so on. I get the same
> behaviour with Firefox menus.
Strangely, I cannot replicate this behavior, but another ctwm user I know
did. Maybe it has something to do with my using an antique ctwm version
(3.5.2b, from 1999, believe it or not...)? Hmm... Maybe this bug really
has something to do with how ctwm behaves?
--
Nadav Har'El | Sunday, Sep 4 2005, 1 Elul 5765
[EMAIL PROTECTED] |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |He who has more is not happier than he
http://nadav.harel.org.il |who wants less.