11.7 Negotiating Preedit and Status Area Geometries

For the XIMPreeditArea and XIMStatusArea interaction styles, the input method needs an area of the application window in which it can create a sub-window and perform its necessary pre-editing and display status information. The application is responsible for providing these areas to the input method (with the XNArea sub-attribute) and the input method must accept whatever area it is given.

The simplest applications may simply force the input method to use some pre-defined area, but slightly more flexible applications will want to query the input method for its desired size. To allow this, a protocol for geometry negotiation between application and input method has been defined. The protocol uses the XNAreaNeeded sub-attribute of an input context in two distinct ways: when the application sets this attribute with a non-zero width and/or height, the input method interprets these as hints about the size that will eventually be assigned to it by the client. When the application queries the value of the XNAreaNeeded attribute, it is returned the input method’s preferred size which it may choose to honor when setting the size in the XNArea attribute.

An example best demonstrates the use of this protocol: Suppose an internationalized client wants to place the pre-edit area across the bottom of its application window. This means that the width of the area is constrained to be the width of the window, but the height of the area is not constrained. ...

Get XLIB Programming Manual, Rel. 5, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.