10 X applications have often needed to work around various shortcomings in the
11 core X window system. This extension is designed to provide the minimal
12 server-side support necessary to eliminate problems caused by these
17 This extension is a direct result of requests made by application
18 developers, in particular,
20 + Owen Taylor for describing the issues raised with the XEMBED
21 mechanisms and SaveSet processing and his initial extension
22 to handle this issue, and for pointer barriers
24 + Bill Haneman for the design for cursor image tracking.
28 + Fredrik Höglund for cursor names
30 + Deron Johnson for cursor visibility
34 Requests in this extension may seem to wander all over the map of X server
35 capabilities, but they are tied by a simple rule -- resolving issues raised
36 by application interaction with core protocol mechanisms that cannot be
37 adequately worked around on the client side of the wire.
39 4. Extension initialization
41 The client must negotiate the version of the extension before executing
42 extension requests. Behavior of the server is undefined otherwise.
46 client-major-version: CARD32
47 client-minor-version: CARD32
54 The client sends the highest supported version to the server and
55 the server sends the highest version it supports, but no higher than
56 the requested version. Major versions changes can introduce
57 new requests, minor version changes introduce only adjustments to
58 existing requests or backward compatible changes. It is
59 the clients responsibility to ensure that the server supports
60 a version which is compatible with its expectations.
62 ************* XFIXES VERSION 1 OR BETTER ***********
64 5. Save Set processing changes
66 Embedding one application within another provides a way of unifying
67 disparate documents and views within a single framework. From the X
68 protocol perspective, this appears similar to nested window managers; the
69 embedding application "manages" the embedded windows much as a window
70 manager does for top-level windows. To protect the embedded application
71 from embedding application failure, it is reasonable to use the core SaveSet
72 mechanism so that embedding application failure causes embedded windows to
73 be preserved instead of destroyed.
75 The core save set mechanism defines the target for each save set member
76 window as the nearest enclosing window not owned by the terminating client.
77 For embedding applications, this nearest window is usually the window
78 manager frame. The problem here is that the window manager will not
79 generally expect to receive and correctly manage new windows appearing within
80 that window by the save set mechanism, and will instead destroy the frame
81 window in response to the client window destruction. This causes the
82 embedded window to be destroyed.
84 An easy fix for this problem is to change the target of the save set member
85 to a window which won't be affected by the underlying window destruction.
86 XFIXES chooses the root window as the target.
88 Having embedded windows suddenly appear at the top level can confuse users,
89 so XFIXES also lets the client select whether the window should end up
90 unmapped after the save set processing instead of unconditionally making
98 mode: { Insert, Delete }
99 target: { Nearest, Root }
102 ChangeSaveSet is an extension of the core protocol ChangeSaveSet
103 request. As in that request, mode specifies whether the indicated
104 window is inserted or deleted from the save-set. Target specifies
105 whether the window is reparented to the nearest non-client window as
106 in the core protocol, or reparented to the root window. Map
107 specifies whether the window is mapped as in the core protocol or
110 6. Selection Tracking
112 Applications wishing to monitor the contents of current selections must
113 poll for selection changes. XFIXES improves this by providing an event
114 delivered whenever the selection ownership changes.
118 SELECTIONEVENT { SetSelectionOwner,
119 SelectionWindowDestroy,
120 SelectionClientClose }
126 subtype: SELECTIONEVENT
131 selection-timestamp: Timestamp
139 event-mask: SETofSELECTIONEVENT
141 Selects for events to be delivered to window when various causes of
142 ownership of selection occur. Subtype indicates the cause of the
143 selection ownership change. Owner is set to the current selection
144 owner, or None. Timestamp indicates the time the event was
145 generated while selection-timestamp indicates the timestamp used to
148 7. Cursor Image Monitoring
150 Mirroring the screen contents is easily done with the core protocol or VNC
151 addons, except for the current cursor image. There is no way using the core
152 protocol to discover which cursor image is currently displayed. The
153 cursor image often contains significant semantic content about the user
154 interface. XFIXES provides a simple mechanism to discover when the cursor
155 image changes and to fetch the current cursor image.
157 As the current cursor may or may not have any XID associated with it, there
158 is no stable name available. Instead, XFIXES returns only the image of the
159 current cursor and provides a way to identify cursor images to avoid
160 refetching the image each time it changes to a previously seen cursor.
163 CURSOREVENT { DisplayCursor }
171 cursor-serial: CARD32
173 name: Atom (Version 2 only)
180 event-mask: SETofCURSOREVENT
182 This request directs cursor change events to the named window.
183 Events will be delivered irrespective of the screen on which they
184 occur. Subtype indicates the cause of the cursor image change
185 (there is only one subtype at present). Cursor-serial is a number
186 assigned to the cursor image which identifies the image. Cursors
187 with different serial numbers may have different images. Timestamp
188 is the time of the cursor change.
190 Servers supporting the X Input Extension Version 2.0 or higher only
191 notify the clients of cursor change events for the ClientPointer, not
192 of any other master pointer (see Section 4.4. in the XI2 protocol
205 cursor-serial: CARD32
206 cursor-image: LISTofCARD32
208 GetCursorImage returns the image of the current cursor. X and y are
209 the current cursor position. Width and height are the size of the
210 cursor image. X-hot and y-hot mark the hotspot within the cursor
211 image. Cursor-serial provides the number assigned to this cursor
212 image, this same serial number will be reported in a CursorNotify
213 event if this cursor image is redisplayed in the future.
215 The cursor image itself is returned as a single image at 32 bits per
216 pixel with 8 bits of alpha in the most significant 8 bits of the
217 pixel followed by 8 bits each of red, green and finally 8 bits of
218 blue in the least significant 8 bits. The color components are
219 pre-multiplied with the alpha component.
221 ************* XFIXES VERSION 2 OR BETTER ***********
225 The core protocol doesn't expose regions as a primitive object and this
226 makes many operations more complicated than they really need to be. Adding
227 region objects simplifies expose handling, the Shape extension and other
228 operations. These operations are also designed to support a separate
229 extension, the X Damage Extension.
234 WINDOW_REGION_KIND: { Bounding, Clip }
238 Region The specified region is invalid
245 rects: LISTofRECTANGLE
247 Creates a region initialized to the specified list of rectangles.
248 The rectangles may be specified in any order, their union becomes
249 the region. The core protocol allows applications to specify an
250 order for the rectangles, but it turns out to be just as hard to
251 verify the rectangles are actually in that order as it is to simply
252 ignore the ordering information and union them together. Hence,
253 this request dispenses with the ordering information.
257 CreateRegionFromBitmap
262 Creates a region initialized to the set of 'one' pixels in bitmap
263 (which must be depth 1, else Match error).
265 Errors: Pixmap, IDChoice, Match
267 CreateRegionFromWindow
270 kind: WINDOW_REGION_KIND
273 Creates a region initialized to the specified window region. See the
274 Shape extension for the definition of Bounding and Clip regions.
276 Errors: Window, IDChoice, Value
283 Creates a region initialized from the clip list of the specified
286 Errors: GContext, IDChoice
288 CreateRegionFromPicture
294 Creates a region initialized from the clip list of the specified
297 Errors: Picture, IDChoice
303 Destroys the specified region.
310 rects: LISTofRECTANGLE
312 This replaces the current contents of region with the region formed
313 by the union of rects.
319 This replaces the contents of destination with the contents of
330 Combines source1 and source2, placing the result in destination.
331 Destination may be the same as either source1 or source2.
333 Errors: Region, Value
341 The source region is subtracted from the region specified by
342 bounds. The result is placed in destination, replacing its contents.
351 The region is translated by dx, dy in place.
360 The extents of the source region are placed in the destination
367 rectangles: LISTofRECTANGLE
369 The region is returned as a list of rectangles in YX-banded order.
376 clip-x-origin, clip-y-origin: INT16
377 region: Region or None
379 This request changes clip-mask in gc to the specified region and
380 sets the clip origin. Output will be clipped to remain contained
381 within the region. The clip origin is interpreted relative to the
382 origin of whatever destination drawable is specified in a graphics
383 request. The region is interpreted relative to the clip origin.
384 Future changes to region have no effect on the gc clip-mask.
386 Errors: GContext, Region
393 region: Region or None
395 This request sets the specified (by destKind) Shape extension region
396 of the window to region, offset by xOff and yOff. Future changes to
397 region have no effect on the window shape.
399 Errors: Window, Value, Region
404 clip-x-origin, clip-y-origin: INT16
405 region: Region or None
407 This request changes clip-mask in picture to the specified region
408 and sets the clip origin. Input and output will be clipped to
409 remain contained within the region. The clip origin is interpreted
410 relative to the origin of the drawable associated with picture. The
411 region is interpreted relative to the clip origin. Future changes
412 to region have no effect on the picture clip-mask.
414 Errors: Picture, Region
418 Attaching names to cursors permits some abstract semantic content to be
419 associated with specific cursor images. Reflecting those names back to
420 applications allows that semantic content to be related to the user through
429 cursor-serial: CARD32
433 In Version 2 of the XFIXES protocol, this event adds the atom
434 of any name associated with the current cursor (else None).
443 This request interns name as an atom and sets that atom as the name
455 This request returns the name and atom of cursor. If no name is
456 set, atom is None and name is empty.
460 GetCursorImageAndName
470 cursor-serial: CARD32
472 cursor-name: LISTofCARD8
473 cursor-image: LISTofCARD32
475 This is similar to GetCursorImage except for including both
476 the atom and name of the current cursor.
480 source, destination: CURSOR
482 This request replaces all references to the destination with a
483 reference to source. Any existing uses of the destination cursor
484 object will now show the source cursor image.
491 This request replaces the contents of all cursors with the specified
492 name with the src cursor.
494 ************* XFIXES VERSION 3 OR BETTER ***********
498 This update provides another operation on the region objects defined in
499 Section 8 of this document.
506 left, right, top, bottom: CARD16
508 Creates destination region containing the area specified by
509 expanding each rectangle in the source region by the specified
510 number of pixels to the left, right, top and bottom.
512 ************* XFIXES VERSION 4 OR BETTER ***********
514 11. Cursor Visibility
516 Composite managers may want to render the cursor themselves instead of
517 relying on the X server sprite drawing, this provides a way for them to
518 do so without getting a double cursor image.
526 A client sends this request to indicate that it wants the
527 cursor image to be hidden (i.e. to not be displayed) when
528 the sprite is inside the specified window, or one of its
529 subwindows. If the sprite is inside a window for which one
530 or more active clients have requested cursor hiding then the
531 cursor image will not be displayed.
533 Note that even though cursor hiding causes the cursor image
534 to be invisible, CursorNotify events will still be sent
535 normally, as if the cursor image were visible.
537 If, during a grab, one or more active clients have requested
538 cursor hiding for grab window, or one of its ancestors, the
539 cursor image of the grab cursor will not be displayed during
540 the lifetime of that grab.
542 When a client with outstanding cursor hiding requests
543 terminates its connection these requests will be deleted.
545 Servers supporting the X Input Extension Version 2.0 or higher hide
546 all visible cursors in response to a HideCursor request. If a master
547 pointer is created while the cursors are hidden, this master pointer's
548 cursor will be hidden as well.
554 A client sends this request to indicate that it wants the
555 cursor image to be displayed when the sprite is inside the
556 specified window, or one of its subwindows. If the sprite
557 is inside a window for which no active clients have requested
558 cursor hiding then the cursor image for that window will be
559 displayed. In other words, if a client calls HideCursor for
560 a specified window, or window subtree, this request reverses
561 the effects of the HideCursor request.
563 If the client has made no outstanding HideCursor requests
564 a BadMatch error is generated.
566 Servers supporting the X Input Extension Version 2.0 or higher show
567 all visible cursors in response to a ShowCursor request.
569 ************* XFIXES VERSION 5 OR BETTER ***********
573 Compositing managers and desktop environments may have UI elements in
574 particular screen locations such that for a single-headed display they
575 correspond to easy targets according to Fitt's Law, for example, the top
576 left corner. For a multi-headed environment these corners should still be
577 semi-impermeable. Pointer barriers allow the application to define
578 additional constraint on cursor motion so that these areas behave as
579 expected even in the face of multiple displays.
581 Absolute positioning devices like touchscreens do not obey pointer barriers.
582 There's no advantage to target acquisition to do so, since on a touchscreen
583 all points are in some sense equally large, whereas for a relative
584 positioning device the edges and corners are infinitely large.
586 WarpPointer and similar requests do not obey pointer barriers, for
587 essentially the same reason.
595 BarrierPositiveX: 1 << 0
596 BarrierPositiveY: 1 << 1
597 BarrierNegativeX: 1 << 2
598 BarrierNegativeY: 1 << 3
610 x1, y2, x2, y2: INT16
612 devices: LISTofDEVICEID
614 Creates a pointer barrier along the line specified by the given
615 coordinates on the screen associated with the given drawable. The
616 barrier has no spatial extent; it is simply a line along the left
617 or top edge of the specified pixels. Barrier coordinates are in
620 The coordinates must be axis aligned, either x1 == x2, or
621 y1 == y2, but not both. The varying coordinates may be specified
622 in any order. For x1 == x2, either y1 > y2 or y1 < y2 is valid.
623 If the coordinates are not valid BadValue is generated.
625 Motion is allowed through the barrier in the directions specified:
626 setting the BarrierPositiveX bit allows travel through the barrier
627 in the positive X direction, etc. Nonsensical values (forbidding Y
628 axis travel through a vertical barrier, for example) and excess set
631 If the server supports the X Input Extension version 2 or higher,
632 the devices element names a set of master device to apply the
633 barrier to. If XIAllDevices or XIAllMasterDevices are given, the
634 barrier applies to all master devices. If a slave device is named,
635 BadDevice is generated; this does not apply to slave devices named
636 implicitly by XIAllDevices. Naming a device multiple times is
637 legal, and is treated as though it were named only once. If a
638 device is removed, the barrier continues to apply to the remaining
639 devices, but will not apply to any future device with the same ID
640 as the removed device. Nothing special happens when all matching
641 devices are removed; barriers must be explicitly destroyed.
643 Errors: IDChoice, Window, Value, Device
645 DestroyPointerBarrier
649 Destroys the named barrier.
653 99. Future compatibility
655 This extension is not expected to remain fixed. Future changes will
656 strive to remain compatible if at all possible. The X server will always
657 support version 1 of the extension protocol if requested by a client.
659 Additions to the protocol will always by marked by minor version number
660 changes so that applications will be able to detect what requests are