I am writing an Onscreen Keyboard in python, with clutter. I've gotten the ClutterStage's XWindow object, but I can't find any properties which prevent the window from stealing focus. Basically, it needs to accept mouse events (click, motion, etc), while not stealing keyboard focus from the window it is trying to type in. Any ideas? :)
2 Answers
You want to set the input hint in your WM_HINTS property to false and not add the WM_TAKE_FOCUS property. This will ensure the window manager never transfers keyboard focus to your window but does not block other events. See section 4.1.7 of the ICCCM.

- 785
- 7
- 9
-
1except it doesn't work (tested on Ubuntu 10), the window still gets the focus. – Aug 01 '15 at 02:17
by the way input delivery works on X11, this cannot happen: an X11 window has to have focus in order to receive input events - in other words: events are delivered only to the focused window.
the input method and accessibility support in GTK+, for instance, relies on the toolkit sending and receiving data to and from another process, through a specific API (IM and ATK, respectively). all virtual keyboard in GNOME use either methods to handle input events.
on pure X11 you could use the XTest extension API to send events from the virtual keyboard to the application that invoked it.

- 8,648
- 27
- 29