On Thu, 2003-07-31 at 09:29, Andreas Aardal Hanssen wrote:
> Hello, there.
> 
> I'm currently working on an implementation of XEmbed, and have run
> into a problem with XSetInputFocus. Please redirect me to the right
> forum if this was posted to the wrong place.
> 
> What I'm troubled with is Keyboard Focus, described here:
> 
> http://www.freedesktop.org/standards/xembed-spec/0.5-html/ar01s03.html

Note that [EMAIL PROTECTED] would likely be a better place for
this mail, since that's the normal place for discussing the
freedesktop.org specifications.

[...]

>  XSetInputFocus()."
> 
>  focusProxy-> *____________
>               |A           |
>               |    ______  |
>               |   |B     | |
>               |   |______| |
>               |            |
>               |____________|
> 
> So I have a window A with a focusproxy child window, measuring 1x1 at
> -1,-1, and I call XSetInputFocus on this focusproxy with
> RevertToParent.
> 
> -> To emphasize, B isn't a child window of A (in XEmbed, the
> "embedder").  B is a window created by a seperate application, which
> has called XReparentWindow to reparent B into A. So B is the XEmbed
> "client". B actually fully covers A, so the size difference in my art
> is just for clarity.

I assume you mean "B wasn't created as a child window of A". If it
has been successfully reparented into A, it will then be a child
window of A.

> The problem is that the focusproxy receives all keyboard events only
> if the mouse pointer is outside window A (the embedder window). On or
> outside the window decorations, doesn't matter as long as the mouse
> pointer is outside window A.
> 
> If the mouse pointer is inside window A, window B gets the keyboard
> events directly. If I move the mouse pointer out of the window A
> again, my focusproxy gets keyboard events again.

Are you sure that the focusproxy window is getting the events, not
window A? It sounds very much to me like you simply didn't manage
to get the focus set to the focusproxy window.

Note that the focus has to be set to the focusproxy window each
time that the toplevel gets focused; this requires participating
in the WM_TAKE_FOCUS protocol as described in the ICCCM.

> Installing an x11 event filter gives me the EnterNotify and
> LeaveNotify for A and B as I cross the border of window A. I also get
> a KeymapNotify, and I guess (having no clue really) that this is X11's
> way of telling me that A isn't getting keyboard events anymore.

No, keymap notifies shouldn't be related.

> So my question is this: Is the XEmbed protocol broken, is my X11
> server broken, or is my code broken, and in which way.

Definitely your code is broken; the setup in XEMBED works fine for
GTK+, for KDE, on a wide ranger of different X servers.

Regards,
                                        Owen


_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to