[Xcb] Focus

Jamey Sharp jamey at minilop.net
Sun Aug 23 19:47:32 PDT 2009


On Mon, Aug 24, 2009 at 12:10:13PM +1000, Matthew Allen wrote:
> So I would have to make my top level windows remember which child
> control had the focus when something takes it's own focus and then
> make that control the focus again when it's receives focus again?
> 
> I _can_ do that, but the question is _should_ I do that?

Focus handling in X seems to be right up there with clipboard
management: everybody wants it but few have any idea how it works. I
sure don't. :-) It turns out that writing an implementation of the X
protocol doesn't qualify me to understand X semantics...

You probably want to start by reading what ICCCM has to say about input
focus. Section 4.1.7 is the first mention I see:

http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7

ICCCM is updated by the spec known either as NetWM or EWMH, so you might
check whether that has more to say on the subject.

If you want to write an abstraction layer for X clients, you probably
need to understand both of these specifications completely before
calling it "done".

Out of curiosity: I take it that you're using a separate X window for
each widget? X is designed to support that very well, but for reasons I
don't entirely understand, I gather Gtk+ and Qt have moved away from
that model. Why did you choose to use a window per widget, and have you
looked at what existing toolkits do?

Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20090823/33ca838c/attachment.pgp 


More information about the Xcb mailing list