fixesproto.txt 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. The XFIXES Extension
  2. Version 5.0
  3. Document Revision 1
  4. 2010-11-15
  5. Keith Packard
  6. keithp@keithp.com
  7. 1. Introduction
  8. X applications have often needed to work around various shortcomings in the
  9. core X window system. This extension is designed to provide the minimal
  10. server-side support necessary to eliminate problems caused by these
  11. workarounds.
  12. 2. Acknowledgements
  13. This extension is a direct result of requests made by application
  14. developers, in particular,
  15. + Owen Taylor for describing the issues raised with the XEMBED
  16. mechanisms and SaveSet processing and his initial extension
  17. to handle this issue, and for pointer barriers
  18. + Bill Haneman for the design for cursor image tracking.
  19. + Havoc Pennington
  20. + Fredrik Höglund for cursor names
  21. + Deron Johnson for cursor visibility
  22. 3. Basic Premise
  23. Requests in this extension may seem to wander all over the map of X server
  24. capabilities, but they are tied by a simple rule -- resolving issues raised
  25. by application interaction with core protocol mechanisms that cannot be
  26. adequately worked around on the client side of the wire.
  27. 4. Extension initialization
  28. The client must negotiate the version of the extension before executing
  29. extension requests. Behavior of the server is undefined otherwise.
  30. QueryVersion
  31. client-major-version: CARD32
  32. client-minor-version: CARD32
  33. ->
  34. major-version: CARD32
  35. minor-version: CARD32
  36. The client sends the highest supported version to the server and
  37. the server sends the highest version it supports, but no higher than
  38. the requested version. Major versions changes can introduce
  39. new requests, minor version changes introduce only adjustments to
  40. existing requests or backward compatible changes. It is
  41. the clients responsibility to ensure that the server supports
  42. a version which is compatible with its expectations.
  43. ************* XFIXES VERSION 1 OR BETTER ***********
  44. 5. Save Set processing changes
  45. Embedding one application within another provides a way of unifying
  46. disparate documents and views within a single framework. From the X
  47. protocol perspective, this appears similar to nested window managers; the
  48. embedding application "manages" the embedded windows much as a window
  49. manager does for top-level windows. To protect the embedded application
  50. from embedding application failure, it is reasonable to use the core SaveSet
  51. mechanism so that embedding application failure causes embedded windows to
  52. be preserved instead of destroyed.
  53. The core save set mechanism defines the target for each save set member
  54. window as the nearest enclosing window not owned by the terminating client.
  55. For embedding applications, this nearest window is usually the window
  56. manager frame. The problem here is that the window manager will not
  57. generally expect to receive and correctly manage new windows appearing within
  58. that window by the save set mechanism, and will instead destroy the frame
  59. window in response to the client window destruction. This causes the
  60. embedded window to be destroyed.
  61. An easy fix for this problem is to change the target of the save set member
  62. to a window which won't be affected by the underlying window destruction.
  63. XFIXES chooses the root window as the target.
  64. Having embedded windows suddenly appear at the top level can confuse users,
  65. so XFIXES also lets the client select whether the window should end up
  66. unmapped after the save set processing instead of unconditionally making
  67. them be mapped.
  68. 5.1 Requests
  69. ChangeSaveSet
  70. window: Window
  71. mode: { Insert, Delete }
  72. target: { Nearest, Root }
  73. map: { Map, Unmap }
  74. ChangeSaveSet is an extension of the core protocol ChangeSaveSet
  75. request. As in that request, mode specifies whether the indicated
  76. window is inserted or deleted from the save-set. Target specifies
  77. whether the window is reparented to the nearest non-client window as
  78. in the core protocol, or reparented to the root window. Map
  79. specifies whether the window is mapped as in the core protocol or
  80. unmapped.
  81. 6. Selection Tracking
  82. Applications wishing to monitor the contents of current selections must
  83. poll for selection changes. XFIXES improves this by providing an event
  84. delivered whenever the selection ownership changes.
  85. 6.1 Types
  86. SELECTIONEVENT { SetSelectionOwner,
  87. SelectionWindowDestroy,
  88. SelectionClientClose }
  89. 6.1 Events
  90. SelectionNotify
  91. subtype: SELECTIONEVENT
  92. window: Window
  93. owner: Window
  94. selection: Atom
  95. timestamp: Timestamp
  96. selection-timestamp: Timestamp
  97. 6.2 Requests
  98. SelectSelectionInput
  99. window: Window
  100. selection: Atom
  101. event-mask: SETofSELECTIONEVENT
  102. Selects for events to be delivered to window when various causes of
  103. ownership of selection occur. Subtype indicates the cause of the
  104. selection ownership change. Owner is set to the current selection
  105. owner, or None. Timestamp indicates the time the event was
  106. generated while selection-timestamp indicates the timestamp used to
  107. own the selection.
  108. 7. Cursor Image Monitoring
  109. Mirroring the screen contents is easily done with the core protocol or VNC
  110. addons, except for the current cursor image. There is no way using the core
  111. protocol to discover which cursor image is currently displayed. The
  112. cursor image often contains significant semantic content about the user
  113. interface. XFIXES provides a simple mechanism to discover when the cursor
  114. image changes and to fetch the current cursor image.
  115. As the current cursor may or may not have any XID associated with it, there
  116. is no stable name available. Instead, XFIXES returns only the image of the
  117. current cursor and provides a way to identify cursor images to avoid
  118. refetching the image each time it changes to a previously seen cursor.
  119. 7.1 Types
  120. CURSOREVENT { DisplayCursor }
  121. 7.2 Events
  122. CursorNotify
  123. subtype: CURSOREVENT
  124. window: Window
  125. cursor-serial: CARD32
  126. timestamp: Timestamp
  127. name: Atom (Version 2 only)
  128. 7.3 Requests
  129. SelectCursorInput
  130. window: Window
  131. event-mask: SETofCURSOREVENT
  132. This request directs cursor change events to the named window.
  133. Events will be delivered irrespective of the screen on which they
  134. occur. Subtype indicates the cause of the cursor image change
  135. (there is only one subtype at present). Cursor-serial is a number
  136. assigned to the cursor image which identifies the image. Cursors
  137. with different serial numbers may have different images. Timestamp
  138. is the time of the cursor change.
  139. Servers supporting the X Input Extension Version 2.0 or higher only
  140. notify the clients of cursor change events for the ClientPointer, not
  141. of any other master pointer (see Section 4.4. in the XI2 protocol
  142. specificiation).
  143. GetCursorImage
  144. ->
  145. x: INT16
  146. y: INT16
  147. width: CARD16
  148. height: CARD16
  149. x-hot: CARD16
  150. y-hot: CARD16
  151. cursor-serial: CARD32
  152. cursor-image: LISTofCARD32
  153. GetCursorImage returns the image of the current cursor. X and y are
  154. the current cursor position. Width and height are the size of the
  155. cursor image. X-hot and y-hot mark the hotspot within the cursor
  156. image. Cursor-serial provides the number assigned to this cursor
  157. image, this same serial number will be reported in a CursorNotify
  158. event if this cursor image is redisplayed in the future.
  159. The cursor image itself is returned as a single image at 32 bits per
  160. pixel with 8 bits of alpha in the most significant 8 bits of the
  161. pixel followed by 8 bits each of red, green and finally 8 bits of
  162. blue in the least significant 8 bits. The color components are
  163. pre-multiplied with the alpha component.
  164. ************* XFIXES VERSION 2 OR BETTER ***********
  165. 8. Region Objects
  166. The core protocol doesn't expose regions as a primitive object and this
  167. makes many operations more complicated than they really need to be. Adding
  168. region objects simplifies expose handling, the Shape extension and other
  169. operations. These operations are also designed to support a separate
  170. extension, the X Damage Extension.
  171. 8.1 Types
  172. Region: XID
  173. WINDOW_REGION_KIND: { Bounding, Clip }
  174. 8.2 Errors
  175. Region The specified region is invalid
  176. 8.3 Requests
  177. CreateRegion
  178. region: REGION
  179. rects: LISTofRECTANGLE
  180. Creates a region initialized to the specified list of rectangles.
  181. The rectangles may be specified in any order, their union becomes
  182. the region. The core protocol allows applications to specify an
  183. order for the rectangles, but it turns out to be just as hard to
  184. verify the rectangles are actually in that order as it is to simply
  185. ignore the ordering information and union them together. Hence,
  186. this request dispenses with the ordering information.
  187. Errors: IDChoice
  188. CreateRegionFromBitmap
  189. region: REGION
  190. bitmap: PIXMAP
  191. Creates a region initialized to the set of 'one' pixels in bitmap
  192. (which must be depth 1, else Match error).
  193. Errors: Pixmap, IDChoice, Match
  194. CreateRegionFromWindow
  195. window: Window
  196. kind: WINDOW_REGION_KIND
  197. region: Region
  198. Creates a region initialized to the specified window region. See the
  199. Shape extension for the definition of Bounding and Clip regions.
  200. Errors: Window, IDChoice, Value
  201. CreateRegionFromGC
  202. gc: GContext
  203. region: Region
  204. Creates a region initialized from the clip list of the specified
  205. GContext.
  206. Errors: GContext, IDChoice
  207. CreateRegionFromPicture
  208. picture: Picture
  209. region: Region
  210. Creates a region initialized from the clip list of the specified
  211. Picture.
  212. Errors: Picture, IDChoice
  213. DestroyRegion
  214. region: Region
  215. Destroys the specified region.
  216. Errors: Region
  217. SetRegion
  218. region: Region
  219. rects: LISTofRECTANGLE
  220. This replaces the current contents of region with the region formed
  221. by the union of rects.
  222. CopyRegion
  223. source: Region
  224. destination: Region
  225. This replaces the contents of destination with the contents of
  226. source.
  227. UnionRegion
  228. IntersectRegion
  229. SubtractRegion
  230. source1: Region
  231. source2: Region
  232. destination: Region
  233. Combines source1 and source2, placing the result in destination.
  234. Destination may be the same as either source1 or source2.
  235. Errors: Region, Value
  236. InvertRegion
  237. source: Region
  238. bounds: RECTANGLE
  239. destination: Region
  240. The source region is subtracted from the region specified by
  241. bounds. The result is placed in destination, replacing its contents.
  242. Errors: Region
  243. TranslateRegion
  244. region: Region
  245. dx, dy: INT16
  246. The region is translated by dx, dy in place.
  247. Errors: Region
  248. RegionExtents
  249. source: Region
  250. destination: Region
  251. The extents of the source region are placed in the destination
  252. FetchRegion
  253. region: Region
  254. ->
  255. extents: RECTANGLE
  256. rectangles: LISTofRECTANGLE
  257. The region is returned as a list of rectangles in YX-banded order.
  258. Errors: Region
  259. SetGCClipRegion
  260. gc: GCONTEXT
  261. clip-x-origin, clip-y-origin: INT16
  262. region: Region or None
  263. This request changes clip-mask in gc to the specified region and
  264. sets the clip origin. Output will be clipped to remain contained
  265. within the region. The clip origin is interpreted relative to the
  266. origin of whatever destination drawable is specified in a graphics
  267. request. The region is interpreted relative to the clip origin.
  268. Future changes to region have no effect on the gc clip-mask.
  269. Errors: GContext, Region
  270. SetWindowShapeRegion
  271. dest: Window
  272. destKind: SHAPE_KIND
  273. xOff, yOff: INT16
  274. region: Region or None
  275. This request sets the specified (by destKind) Shape extension region
  276. of the window to region, offset by xOff and yOff. Future changes to
  277. region have no effect on the window shape.
  278. Errors: Window, Value, Region
  279. SetPictureClipRegion
  280. picture: Picture
  281. clip-x-origin, clip-y-origin: INT16
  282. region: Region or None
  283. This request changes clip-mask in picture to the specified region
  284. and sets the clip origin. Input and output will be clipped to
  285. remain contained within the region. The clip origin is interpreted
  286. relative to the origin of the drawable associated with picture. The
  287. region is interpreted relative to the clip origin. Future changes
  288. to region have no effect on the picture clip-mask.
  289. Errors: Picture, Region
  290. 9. Cursor Names
  291. Attaching names to cursors permits some abstract semantic content to be
  292. associated with specific cursor images. Reflecting those names back to
  293. applications allows that semantic content to be related to the user through
  294. non-visual means.
  295. 9.1 Events
  296. CursorNotify
  297. subtype: CURSOREVENT
  298. window: Window
  299. cursor-serial: CARD32
  300. timestamp: Timestamp
  301. name: Atom or None
  302. In Version 2 of the XFIXES protocol, this event adds the atom
  303. of any name associated with the current cursor (else None).
  304. 9.2 Requests
  305. SetCursorName
  306. cursor: CURSOR
  307. name: LISTofCARD8
  308. This request interns name as an atom and sets that atom as the name
  309. of cursor.
  310. Errors: Cursor
  311. GetCursorName
  312. cursor: CURSOR
  313. ->
  314. atom: ATOM or None
  315. name: LISTofCARD8
  316. This request returns the name and atom of cursor. If no name is
  317. set, atom is None and name is empty.
  318. Errors: Cursor
  319. GetCursorImageAndName
  320. ->
  321. x: INT16
  322. y: INT16
  323. width: CARD16
  324. height: CARD16
  325. x-hot: CARD16
  326. y-hot: CARD16
  327. cursor-serial: CARD32
  328. cursor-atom: ATOM
  329. cursor-name: LISTofCARD8
  330. cursor-image: LISTofCARD32
  331. This is similar to GetCursorImage except for including both
  332. the atom and name of the current cursor.
  333. ChangeCursor
  334. source, destination: CURSOR
  335. This request replaces all references to the destination with a
  336. reference to source. Any existing uses of the destination cursor
  337. object will now show the source cursor image.
  338. ChangeCursorByName
  339. src: CURSOR
  340. name: LISTofCARD8
  341. This request replaces the contents of all cursors with the specified
  342. name with the src cursor.
  343. ************* XFIXES VERSION 3 OR BETTER ***********
  344. 10. Region Expansion
  345. This update provides another operation on the region objects defined in
  346. Section 8 of this document.
  347. 10.1 Requests
  348. ExpandRegion
  349. source: REGION
  350. destination: REGION
  351. left, right, top, bottom: CARD16
  352. Creates destination region containing the area specified by
  353. expanding each rectangle in the source region by the specified
  354. number of pixels to the left, right, top and bottom.
  355. ************* XFIXES VERSION 4 OR BETTER ***********
  356. 11. Cursor Visibility
  357. Composite managers may want to render the cursor themselves instead of
  358. relying on the X server sprite drawing, this provides a way for them to
  359. do so without getting a double cursor image.
  360. 11.1 Requests
  361. HideCursor
  362. window: WINDOW
  363. A client sends this request to indicate that it wants the
  364. cursor image to be hidden (i.e. to not be displayed) when
  365. the sprite is inside the specified window, or one of its
  366. subwindows. If the sprite is inside a window for which one
  367. or more active clients have requested cursor hiding then the
  368. cursor image will not be displayed.
  369. Note that even though cursor hiding causes the cursor image
  370. to be invisible, CursorNotify events will still be sent
  371. normally, as if the cursor image were visible.
  372. If, during a grab, one or more active clients have requested
  373. cursor hiding for grab window, or one of its ancestors, the
  374. cursor image of the grab cursor will not be displayed during
  375. the lifetime of that grab.
  376. When a client with outstanding cursor hiding requests
  377. terminates its connection these requests will be deleted.
  378. Servers supporting the X Input Extension Version 2.0 or higher hide
  379. all visible cursors in response to a HideCursor request. If a master
  380. pointer is created while the cursors are hidden, this master pointer's
  381. cursor will be hidden as well.
  382. ShowCursor
  383. window: WINDOW
  384. A client sends this request to indicate that it wants the
  385. cursor image to be displayed when the sprite is inside the
  386. specified window, or one of its subwindows. If the sprite
  387. is inside a window for which no active clients have requested
  388. cursor hiding then the cursor image for that window will be
  389. displayed. In other words, if a client calls HideCursor for
  390. a specified window, or window subtree, this request reverses
  391. the effects of the HideCursor request.
  392. If the client has made no outstanding HideCursor requests
  393. a BadMatch error is generated.
  394. Servers supporting the X Input Extension Version 2.0 or higher show
  395. all visible cursors in response to a ShowCursor request.
  396. ************* XFIXES VERSION 5 OR BETTER ***********
  397. 12. Pointer Barriers
  398. Compositing managers and desktop environments may have UI elements in
  399. particular screen locations such that for a single-headed display they
  400. correspond to easy targets according to Fitt's Law, for example, the top
  401. left corner. For a multi-headed environment these corners should still be
  402. semi-impermeable. Pointer barriers allow the application to define
  403. additional constraint on cursor motion so that these areas behave as
  404. expected even in the face of multiple displays.
  405. Absolute positioning devices like touchscreens do not obey pointer barriers.
  406. There's no advantage to target acquisition to do so, since on a touchscreen
  407. all points are in some sense equally large, whereas for a relative
  408. positioning device the edges and corners are infinitely large.
  409. WarpPointer and similar requests do not obey pointer barriers, for
  410. essentially the same reason.
  411. 12.1 Types
  412. BARRIER: XID
  413. BarrierDirections
  414. BarrierPositiveX: 1 << 0
  415. BarrierPositiveY: 1 << 1
  416. BarrierNegativeX: 1 << 2
  417. BarrierNegativeY: 1 << 3
  418. 12.2 Errors
  419. Barrier
  420. 12.3 Requests
  421. CreatePointerBarrier
  422. barrier: BARRIER
  423. drawable: DRAWABLE
  424. x1, y2, x2, y2: INT16
  425. directions: CARD32
  426. devices: LISTofDEVICEID
  427. Creates a pointer barrier along the line specified by the given
  428. coordinates on the screen associated with the given drawable. The
  429. barrier has no spatial extent; it is simply a line along the left
  430. or top edge of the specified pixels. Barrier coordinates are in
  431. screen space.
  432. The coordinates must be axis aligned, either x1 == x2, or
  433. y1 == y2, but not both. The varying coordinates may be specified
  434. in any order. For x1 == x2, either y1 > y2 or y1 < y2 is valid.
  435. If the coordinates are not valid BadValue is generated.
  436. Motion is allowed through the barrier in the directions specified:
  437. setting the BarrierPositiveX bit allows travel through the barrier
  438. in the positive X direction, etc. Nonsensical values (forbidding Y
  439. axis travel through a vertical barrier, for example) and excess set
  440. bits are ignored.
  441. If the server supports the X Input Extension version 2 or higher,
  442. the devices element names a set of master device to apply the
  443. barrier to. If XIAllDevices or XIAllMasterDevices are given, the
  444. barrier applies to all master devices. If a slave device is named,
  445. BadDevice is generated; this does not apply to slave devices named
  446. implicitly by XIAllDevices. Naming a device multiple times is
  447. legal, and is treated as though it were named only once. If a
  448. device is removed, the barrier continues to apply to the remaining
  449. devices, but will not apply to any future device with the same ID
  450. as the removed device. Nothing special happens when all matching
  451. devices are removed; barriers must be explicitly destroyed.
  452. Errors: IDChoice, Window, Value, Device
  453. DestroyPointerBarrier
  454. barrier: BARRIER
  455. Destroys the named barrier.
  456. Errors: Barrier
  457. 99. Future compatibility
  458. This extension is not expected to remain fixed. Future changes will
  459. strive to remain compatible if at all possible. The X server will always
  460. support version 1 of the extension protocol if requested by a client.
  461. Additions to the protocol will always by marked by minor version number
  462. changes so that applications will be able to detect what requests are
  463. supported.