fixesproto.txt revision 5395ea76
117ca54c3Smrg                        The XFIXES Extension
217ca54c3Smrg			    Version 5.0
317ca54c3Smrg			 Document Revision 1
417ca54c3Smrg			     2010-11-15
517ca54c3Smrg			    Keith Packard
617ca54c3Smrg			  keithp@keithp.com
717ca54c3Smrg
817ca54c3Smrg1. Introduction
917ca54c3Smrg
1017ca54c3SmrgX applications have often needed to work around various shortcomings in the
1117ca54c3Smrgcore X window system.  This extension is designed to provide the minimal
1217ca54c3Smrgserver-side support necessary to eliminate problems caused by these
1317ca54c3Smrgworkarounds.
1417ca54c3Smrg
1517ca54c3Smrg2. Acknowledgements
1617ca54c3Smrg
1717ca54c3SmrgThis extension is a direct result of requests made by application
1817ca54c3Smrgdevelopers, in particular,
1917ca54c3Smrg
2017ca54c3Smrg +	Owen Taylor for describing the issues raised with the XEMBED
2117ca54c3Smrg 	mechanisms and SaveSet processing and his initial extension
2217ca54c3Smrg	to handle this issue, and for pointer barriers
2317ca54c3Smrg
2417ca54c3Smrg +	Bill Haneman for the design for cursor image tracking.
2517ca54c3Smrg
2617ca54c3Smrg +	Havoc Pennington 
2717ca54c3Smrg
2817ca54c3Smrg +	Fredrik Höglund for cursor names
2917ca54c3Smrg
3017ca54c3Smrg +	Deron Johnson for cursor visibility
3117ca54c3Smrg
3217ca54c3Smrg3. Basic Premise
3317ca54c3Smrg
3417ca54c3SmrgRequests in this extension may seem to wander all over the map of X server
3517ca54c3Smrgcapabilities, but they are tied by a simple rule -- resolving issues raised
3617ca54c3Smrgby application interaction with core protocol mechanisms that cannot be
3717ca54c3Smrgadequately worked around on the client side of the wire.
3817ca54c3Smrg
3917ca54c3Smrg4. Extension initialization
4017ca54c3Smrg
4117ca54c3SmrgThe client must negotiate the version of the extension before executing
4217ca54c3Smrgextension requests.  Behavior of the server is undefined otherwise.
4317ca54c3Smrg
4417ca54c3SmrgQueryVersion
4517ca54c3Smrg
4617ca54c3Smrg	client-major-version:		CARD32
4717ca54c3Smrg	client-minor-version:		CARD32
4817ca54c3Smrg
4917ca54c3Smrg	->
5017ca54c3Smrg
5117ca54c3Smrg	major-version:			CARD32
5217ca54c3Smrg	minor-version:			CARD32
5317ca54c3Smrg
5417ca54c3Smrg	The client sends the highest supported version to the server and
5517ca54c3Smrg	the server sends the highest version it supports, but no higher than
5617ca54c3Smrg	the requested version.  Major versions changes can introduce
5717ca54c3Smrg	new requests, minor version changes introduce only adjustments to
5817ca54c3Smrg	existing requests or backward compatible changes.  It is
5917ca54c3Smrg	the clients responsibility to ensure that the server supports
6017ca54c3Smrg	a version which is compatible with its expectations.
6117ca54c3Smrg
6217ca54c3Smrg************* XFIXES VERSION 1 OR BETTER ***********
6317ca54c3Smrg
6417ca54c3Smrg5. Save Set processing changes
6517ca54c3Smrg
6617ca54c3SmrgEmbedding one application within another provides a way of unifying
6717ca54c3Smrgdisparate documents and views within a single framework.  From the X
6817ca54c3Smrgprotocol perspective, this appears similar to nested window managers; the
6917ca54c3Smrgembedding application "manages" the embedded windows much as a window
7017ca54c3Smrgmanager does for top-level windows.  To protect the embedded application
7117ca54c3Smrgfrom embedding application failure, it is reasonable to use the core SaveSet
7217ca54c3Smrgmechanism so that embedding application failure causes embedded windows to
7317ca54c3Smrgbe preserved instead of destroyed.
7417ca54c3Smrg
7517ca54c3SmrgThe core save set mechanism defines the target for each save set member
7617ca54c3Smrgwindow as the nearest enclosing window not owned by the terminating client.
7717ca54c3SmrgFor embedding applications, this nearest window is usually the window
7817ca54c3Smrgmanager frame.  The problem here is that the window manager will not
7917ca54c3Smrggenerally expect to receive and correctly manage new windows appearing within
8017ca54c3Smrgthat window by the save set mechanism, and will instead destroy the frame
8117ca54c3Smrgwindow in response to the client window destruction.  This causes the
8217ca54c3Smrgembedded window to be destroyed.
8317ca54c3Smrg
8417ca54c3SmrgAn easy fix for this problem is to change the target of the save set member
8517ca54c3Smrgto a window which won't be affected by the underlying window destruction.
8617ca54c3SmrgXFIXES chooses the root window as the target.
8717ca54c3Smrg
8817ca54c3SmrgHaving embedded windows suddenly appear at the top level can confuse users,
8917ca54c3Smrgso XFIXES also lets the client select whether the window should end up
9017ca54c3Smrgunmapped after the save set processing instead of unconditionally making
9117ca54c3Smrgthem be mapped.
9217ca54c3Smrg
9317ca54c3Smrg5.1 Requests
9417ca54c3Smrg
9517ca54c3SmrgChangeSaveSet
9617ca54c3Smrg
9717ca54c3Smrg		window:				Window
9817ca54c3Smrg		mode:				{ Insert, Delete }
9917ca54c3Smrg		target:				{ Nearest, Root }
10017ca54c3Smrg		map:				{ Map, Unmap }
10117ca54c3Smrg
10217ca54c3Smrg	ChangeSaveSet is an extension of the core protocol ChangeSaveSet
10317ca54c3Smrg	request.  As in that request, mode specifies whether the indicated
10417ca54c3Smrg	window is inserted or deleted from the save-set.  Target specifies
10517ca54c3Smrg	whether the window is reparented to the nearest non-client window as
10617ca54c3Smrg	in the core protocol, or reparented to the root window.  Map
10717ca54c3Smrg	specifies whether the window is mapped as in the core protocol or
10817ca54c3Smrg	unmapped.
10917ca54c3Smrg
11017ca54c3Smrg6. Selection Tracking
11117ca54c3Smrg
11217ca54c3SmrgApplications wishing to monitor the contents of current selections must
11317ca54c3Smrgpoll for selection changes.  XFIXES improves this by providing an event
11417ca54c3Smrgdelivered whenever the selection ownership changes.
11517ca54c3Smrg
11617ca54c3Smrg6.1 Types
11717ca54c3Smrg
11817ca54c3Smrg	SELECTIONEVENT			{ SetSelectionOwner,
11917ca54c3Smrg					  SelectionWindowDestroy,
12017ca54c3Smrg					  SelectionClientClose }
12117ca54c3Smrg
12217ca54c3Smrg6.1 Events
12317ca54c3Smrg
12417ca54c3SmrgSelectionNotify
12517ca54c3Smrg
12617ca54c3Smrg	subtype:			SELECTIONEVENT
12717ca54c3Smrg	window:				Window
12817ca54c3Smrg	owner:				Window
12917ca54c3Smrg	selection:			Atom
13017ca54c3Smrg	timestamp:			Timestamp
13117ca54c3Smrg	selection-timestamp:		Timestamp
13217ca54c3Smrg
13317ca54c3Smrg6.2 Requests
13417ca54c3Smrg
13517ca54c3SmrgSelectSelectionInput
13617ca54c3Smrg
13717ca54c3Smrg		window:				Window
13817ca54c3Smrg		selection:			Atom
13917ca54c3Smrg		event-mask:			SETofSELECTIONEVENT
14017ca54c3Smrg
14117ca54c3Smrg	Selects for events to be delivered to window when various causes of
14217ca54c3Smrg	ownership of selection occur.  Subtype indicates the cause of the
14317ca54c3Smrg	selection ownership change.  Owner is set to the current selection
14417ca54c3Smrg	owner, or None.  Timestamp indicates the time the event was
14517ca54c3Smrg	generated while selection-timestamp indicates the timestamp used to
14617ca54c3Smrg	own the selection.
14717ca54c3Smrg
14817ca54c3Smrg7. Cursor Image Monitoring
14917ca54c3Smrg
15017ca54c3SmrgMirroring the screen contents is easily done with the core protocol or VNC
15117ca54c3Smrgaddons, except for the current cursor image.  There is no way using the core
15217ca54c3Smrgprotocol to discover which cursor image is currently displayed.  The
15317ca54c3Smrgcursor image often contains significant semantic content about the user
15417ca54c3Smrginterface.  XFIXES provides a simple mechanism to discover when the cursor
15517ca54c3Smrgimage changes and to fetch the current cursor image.
15617ca54c3Smrg
15717ca54c3SmrgAs the current cursor may or may not have any XID associated with it, there
15817ca54c3Smrgis no stable name available.  Instead, XFIXES returns only the image of the
15917ca54c3Smrgcurrent cursor and provides a way to identify cursor images to avoid
16017ca54c3Smrgrefetching the image each time it changes to a previously seen cursor.
16117ca54c3Smrg
16217ca54c3Smrg7.1 Types
16317ca54c3Smrg	CURSOREVENT			{ DisplayCursor }
16417ca54c3Smrg
16517ca54c3Smrg7.2 Events
16617ca54c3Smrg
16717ca54c3SmrgCursorNotify
16817ca54c3Smrg
16917ca54c3Smrg	subtype:		CURSOREVENT
17017ca54c3Smrg	window:			Window
17117ca54c3Smrg	cursor-serial:		CARD32
17217ca54c3Smrg	timestamp:		Timestamp
17317ca54c3Smrg	name:			Atom		(Version 2 only)
17417ca54c3Smrg
17517ca54c3Smrg7.3 Requests
17617ca54c3Smrg
17717ca54c3SmrgSelectCursorInput
17817ca54c3Smrg
17917ca54c3Smrg		window:			Window
18017ca54c3Smrg		event-mask:		SETofCURSOREVENT
18117ca54c3Smrg
18217ca54c3Smrg	This request directs cursor change events to the named window.
18317ca54c3Smrg	Events will be delivered irrespective of the screen on which they
18417ca54c3Smrg	occur.  Subtype indicates the cause of the cursor image change
18517ca54c3Smrg	(there is only one subtype at present).  Cursor-serial is a number
18617ca54c3Smrg	assigned to the cursor image which identifies the image.  Cursors
18717ca54c3Smrg	with different serial numbers may have different images.  Timestamp
18817ca54c3Smrg	is the time of the cursor change.
18917ca54c3Smrg
19017ca54c3Smrg	Servers supporting the X Input Extension Version 2.0 or higher only
19117ca54c3Smrg	notify the clients of cursor change events for the ClientPointer, not
19217ca54c3Smrg	of any other master pointer (see Section 4.4. in the XI2 protocol
193d63b911fSmrg	specification).
19417ca54c3Smrg
19517ca54c3SmrgGetCursorImage
19617ca54c3Smrg
19717ca54c3Smrg		->
19817ca54c3Smrg
19917ca54c3Smrg		x:			INT16
20017ca54c3Smrg		y:			INT16
20117ca54c3Smrg		width:			CARD16
20217ca54c3Smrg		height:			CARD16
20317ca54c3Smrg		x-hot:			CARD16
20417ca54c3Smrg		y-hot:			CARD16
20517ca54c3Smrg		cursor-serial:		CARD32
20617ca54c3Smrg		cursor-image:		LISTofCARD32
20717ca54c3Smrg
20817ca54c3Smrg	GetCursorImage returns the image of the current cursor.  X and y are
20917ca54c3Smrg	the current cursor position.  Width and height are the size of the
21017ca54c3Smrg	cursor image.  X-hot and y-hot mark the hotspot within the cursor
21117ca54c3Smrg	image.  Cursor-serial provides the number assigned to this cursor
21217ca54c3Smrg	image, this same serial number will be reported in a CursorNotify
21317ca54c3Smrg	event if this cursor image is redisplayed in the future.
21417ca54c3Smrg
21517ca54c3Smrg	The cursor image itself is returned as a single image at 32 bits per
21617ca54c3Smrg	pixel with 8 bits of alpha in the most significant 8 bits of the
21717ca54c3Smrg	pixel followed by 8 bits each of red, green and finally 8 bits of
21817ca54c3Smrg	blue in the least significant 8 bits.  The color components are
21917ca54c3Smrg	pre-multiplied with the alpha component.
22017ca54c3Smrg	
22117ca54c3Smrg************* XFIXES VERSION 2 OR BETTER ***********
22217ca54c3Smrg
22317ca54c3Smrg8. Region Objects
22417ca54c3Smrg
22517ca54c3SmrgThe core protocol doesn't expose regions as a primitive object and this
22617ca54c3Smrgmakes many operations more complicated than they really need to be.  Adding
22717ca54c3Smrgregion objects simplifies expose handling, the Shape extension and other
22817ca54c3Smrgoperations. These operations are also designed to support a separate
22917ca54c3Smrgextension, the X Damage Extension.
23017ca54c3Smrg
23117ca54c3Smrg8.1 Types
23217ca54c3Smrg
23317ca54c3Smrg	Region:				XID
23417ca54c3Smrg	WINDOW_REGION_KIND:		{ Bounding, Clip }
23517ca54c3Smrg	
23617ca54c3Smrg8.2 Errors
23717ca54c3Smrg
23817ca54c3Smrg	Region				The specified region is invalid
23917ca54c3Smrg
24017ca54c3Smrg8.3 Requests
24117ca54c3Smrg
24217ca54c3SmrgCreateRegion
24317ca54c3Smrg
24417ca54c3Smrg		region:				REGION
24517ca54c3Smrg		rects:				LISTofRECTANGLE
24617ca54c3Smrg
24717ca54c3Smrg	Creates a region initialized to the specified list of rectangles.
24817ca54c3Smrg	The rectangles may be specified in any order, their union becomes
24917ca54c3Smrg	the region.  The core protocol allows applications to specify an
25017ca54c3Smrg	order for the rectangles, but it turns out to be just as hard to
25117ca54c3Smrg	verify the rectangles are actually in that order as it is to simply
25217ca54c3Smrg	ignore the ordering information and union them together.  Hence,
25317ca54c3Smrg	this request dispenses with the ordering information.
25417ca54c3Smrg
25517ca54c3Smrg	Errors: IDChoice
25617ca54c3Smrg
25717ca54c3SmrgCreateRegionFromBitmap
25817ca54c3Smrg
25917ca54c3Smrg		region:				REGION
26017ca54c3Smrg		bitmap:				PIXMAP
26117ca54c3Smrg
26217ca54c3Smrg	Creates a region initialized to the set of 'one' pixels in bitmap
26317ca54c3Smrg	(which must be depth 1, else Match error).
26417ca54c3Smrg
26517ca54c3Smrg	Errors: Pixmap, IDChoice, Match
26617ca54c3Smrg
26717ca54c3SmrgCreateRegionFromWindow
26817ca54c3Smrg
26917ca54c3Smrg		window:				Window
27017ca54c3Smrg		kind:				WINDOW_REGION_KIND
27117ca54c3Smrg		region:				Region
27217ca54c3Smrg
27317ca54c3Smrg	Creates a region initialized to the specified window region.  See the
27417ca54c3Smrg	Shape extension for the definition of Bounding and Clip regions.
27517ca54c3Smrg
27617ca54c3Smrg	Errors: Window, IDChoice, Value
27717ca54c3Smrg
27817ca54c3SmrgCreateRegionFromGC
27917ca54c3Smrg
28017ca54c3Smrg		gc:				GContext
28117ca54c3Smrg		region:				Region
28217ca54c3Smrg
28317ca54c3Smrg	Creates a region initialized from the clip list of the specified
28417ca54c3Smrg	GContext.
28517ca54c3Smrg
28617ca54c3Smrg	Errors: GContext, IDChoice
28717ca54c3Smrg
28817ca54c3SmrgCreateRegionFromPicture
28917ca54c3Smrg
29017ca54c3Smrg		picture:			Picture
29117ca54c3Smrg		region:				Region
29217ca54c3Smrg
29317ca54c3Smrg
29417ca54c3Smrg	Creates a region initialized from the clip list of the specified
29517ca54c3Smrg	Picture.
29617ca54c3Smrg
29717ca54c3Smrg	Errors: Picture, IDChoice
29817ca54c3Smrg
29917ca54c3SmrgDestroyRegion
30017ca54c3Smrg
30117ca54c3Smrg		region:				Region
30217ca54c3Smrg
30317ca54c3Smrg	Destroys the specified region.
30417ca54c3Smrg
30517ca54c3Smrg	Errors: Region
30617ca54c3Smrg
30717ca54c3SmrgSetRegion
30817ca54c3Smrg
30917ca54c3Smrg		region:				Region
31017ca54c3Smrg		rects:				LISTofRECTANGLE
31117ca54c3Smrg
31217ca54c3Smrg	This replaces the current contents of region with the region formed
31317ca54c3Smrg	by the union of rects.
31417ca54c3Smrg
31517ca54c3SmrgCopyRegion
31617ca54c3Smrg		source:				Region
31717ca54c3Smrg		destination:			Region
31817ca54c3Smrg
31917ca54c3Smrg	This replaces the contents of destination with the contents of 
32017ca54c3Smrg	source.
32117ca54c3Smrg
32217ca54c3SmrgUnionRegion
32317ca54c3SmrgIntersectRegion
32417ca54c3SmrgSubtractRegion
32517ca54c3Smrg
32617ca54c3Smrg		source1:			Region
32717ca54c3Smrg		source2:			Region
32817ca54c3Smrg		destination:			Region
32917ca54c3Smrg	
33017ca54c3Smrg	Combines source1 and source2, placing the result in destination.
33117ca54c3Smrg	Destination may be the same as either source1 or source2.
33217ca54c3Smrg
33317ca54c3Smrg	Errors: Region, Value
33417ca54c3Smrg	
33517ca54c3SmrgInvertRegion
33617ca54c3Smrg
33717ca54c3Smrg		source:				Region
33817ca54c3Smrg		bounds:				RECTANGLE
33917ca54c3Smrg		destination:			Region
34017ca54c3Smrg	
34117ca54c3Smrg	The source region is subtracted from the region specified by
34217ca54c3Smrg	bounds.  The result is placed in destination, replacing its contents.
34317ca54c3Smrg
34417ca54c3Smrg	Errors: Region
34517ca54c3Smrg	
34617ca54c3SmrgTranslateRegion
34717ca54c3Smrg
34817ca54c3Smrg		region:				Region
34917ca54c3Smrg		dx, dy:				INT16
35017ca54c3Smrg
35117ca54c3Smrg	The region is translated by dx, dy in place.
35217ca54c3Smrg
35317ca54c3Smrg	Errors: Region
35417ca54c3Smrg
35517ca54c3SmrgRegionExtents
35617ca54c3Smrg
35717ca54c3Smrg		source:				Region
35817ca54c3Smrg		destination:			Region
35917ca54c3Smrg
36017ca54c3Smrg	The extents of the source region are placed in the destination
36117ca54c3Smrg
36217ca54c3SmrgFetchRegion
36317ca54c3Smrg
36417ca54c3Smrg		region:				Region
36517ca54c3Smrg		->
36617ca54c3Smrg		extents:			RECTANGLE
36717ca54c3Smrg		rectangles:			LISTofRECTANGLE
36817ca54c3Smrg
36917ca54c3Smrg	The region is returned as a list of rectangles in YX-banded order.
37017ca54c3Smrg
37117ca54c3Smrg	Errors: Region
37217ca54c3Smrg
37317ca54c3SmrgSetGCClipRegion
37417ca54c3Smrg
37517ca54c3Smrg		gc:				GCONTEXT
37617ca54c3Smrg		clip-x-origin, clip-y-origin:	INT16
37717ca54c3Smrg		region:				Region or None
37817ca54c3Smrg
37917ca54c3Smrg	This request changes clip-mask in gc to the specified region and
38017ca54c3Smrg	sets the clip origin.  Output will be clipped to remain contained
38117ca54c3Smrg	within the region.  The clip origin is interpreted relative to the
38217ca54c3Smrg	origin of whatever destination drawable is specified in a graphics
38317ca54c3Smrg	request.  The region is interpreted relative to the clip origin.
38417ca54c3Smrg	Future changes to region have no effect on the gc clip-mask.
38517ca54c3Smrg
38617ca54c3Smrg	Errors: GContext, Region
38717ca54c3Smrg
38817ca54c3SmrgSetWindowShapeRegion
38917ca54c3Smrg
39017ca54c3Smrg		dest:				Window
39117ca54c3Smrg		destKind:			SHAPE_KIND
39217ca54c3Smrg		xOff, yOff:			INT16
39317ca54c3Smrg		region:				Region or None
39417ca54c3Smrg
39517ca54c3Smrg	This request sets the specified (by destKind) Shape extension region
39617ca54c3Smrg	of the window to region, offset by xOff and yOff.   Future changes to
39717ca54c3Smrg	region have no effect on the window shape.
39817ca54c3Smrg
39917ca54c3Smrg	Errors: Window, Value, Region
40017ca54c3Smrg
40117ca54c3SmrgSetPictureClipRegion
40217ca54c3Smrg
40317ca54c3Smrg		picture:			Picture
40417ca54c3Smrg		clip-x-origin, clip-y-origin:	INT16
40517ca54c3Smrg		region:				Region or None
40617ca54c3Smrg
40717ca54c3Smrg	This request changes clip-mask in picture to the specified region
40817ca54c3Smrg	and sets the clip origin.  Input and output will be clipped to
40917ca54c3Smrg	remain contained within the region.  The clip origin is interpreted
41017ca54c3Smrg	relative to the origin of the drawable associated with picture.  The
41117ca54c3Smrg	region is interpreted relative to the clip origin.  Future changes
41217ca54c3Smrg	to region have no effect on the picture clip-mask.
41317ca54c3Smrg
41417ca54c3Smrg	Errors: Picture, Region
41517ca54c3Smrg
41617ca54c3Smrg9. Cursor Names
41717ca54c3Smrg
41817ca54c3SmrgAttaching names to cursors permits some abstract semantic content to be
41917ca54c3Smrgassociated with specific cursor images.  Reflecting those names back to
42017ca54c3Smrgapplications allows that semantic content to be related to the user through
42117ca54c3Smrgnon-visual means.
42217ca54c3Smrg
42317ca54c3Smrg9.1 Events
42417ca54c3Smrg
42517ca54c3SmrgCursorNotify
42617ca54c3Smrg
42717ca54c3Smrg		subtype:		CURSOREVENT
42817ca54c3Smrg		window:			Window
42917ca54c3Smrg		cursor-serial:		CARD32
43017ca54c3Smrg		timestamp:		Timestamp
43117ca54c3Smrg		name:			Atom or None
43217ca54c3Smrg	
43317ca54c3Smrg	In Version 2 of the XFIXES protocol, this event adds the atom
43417ca54c3Smrg	of any name associated with the current cursor (else None).
43517ca54c3Smrg
43617ca54c3Smrg9.2 Requests
43717ca54c3Smrg
43817ca54c3SmrgSetCursorName
43917ca54c3Smrg
44017ca54c3Smrg		cursor:			CURSOR
44117ca54c3Smrg		name:			LISTofCARD8
44217ca54c3Smrg
44317ca54c3Smrg	This request interns name as an atom and sets that atom as the name
44417ca54c3Smrg	of cursor.
44517ca54c3Smrg
44617ca54c3Smrg	Errors: Cursor
44717ca54c3Smrg
44817ca54c3SmrgGetCursorName
44917ca54c3Smrg
45017ca54c3Smrg		cursor:			CURSOR
45117ca54c3Smrg		->
45217ca54c3Smrg		atom:			ATOM or None
45317ca54c3Smrg		name:			LISTofCARD8
45417ca54c3Smrg
45517ca54c3Smrg	This request returns the name and atom of cursor.  If no name is
45617ca54c3Smrg	set, atom is None and name is empty.
45717ca54c3Smrg
45817ca54c3Smrg	Errors: Cursor
45917ca54c3Smrg
46017ca54c3SmrgGetCursorImageAndName
46117ca54c3Smrg
46217ca54c3Smrg		->
46317ca54c3Smrg
46417ca54c3Smrg		x:			INT16
46517ca54c3Smrg		y:			INT16
46617ca54c3Smrg		width:			CARD16
46717ca54c3Smrg		height:			CARD16
46817ca54c3Smrg		x-hot:			CARD16
46917ca54c3Smrg		y-hot:			CARD16
47017ca54c3Smrg		cursor-serial:		CARD32
47117ca54c3Smrg		cursor-atom:		ATOM
47217ca54c3Smrg		cursor-image:		LISTofCARD32
47317ca54c3Smrg		cursor-name:		LISTofCARD8
47417ca54c3Smrg
47517ca54c3Smrg	This is similar to GetCursorImage except for including both
47617ca54c3Smrg	the atom and name of the current cursor.
47717ca54c3Smrg
47817ca54c3SmrgChangeCursor
47917ca54c3Smrg
48017ca54c3Smrg		source, destination:	CURSOR
48117ca54c3Smrg
48217ca54c3Smrg	This request replaces all references to the destination with a
48317ca54c3Smrg	reference to source.  Any existing uses of the destination cursor
48417ca54c3Smrg	object will now show the source cursor image.
48517ca54c3Smrg
48617ca54c3SmrgChangeCursorByName
48717ca54c3Smrg
48817ca54c3Smrg		src:			CURSOR
48917ca54c3Smrg		name:			LISTofCARD8
49017ca54c3Smrg
49117ca54c3Smrg	This request replaces the contents of all cursors with the specified
49217ca54c3Smrg	name with the src cursor.
49317ca54c3Smrg
49417ca54c3Smrg************* XFIXES VERSION 3 OR BETTER ***********
49517ca54c3Smrg
49617ca54c3Smrg10. Region Expansion
49717ca54c3Smrg
49817ca54c3SmrgThis update provides another operation on the region objects defined in
49917ca54c3SmrgSection 8 of this document.
50017ca54c3Smrg
50117ca54c3Smrg10.1 Requests
50217ca54c3Smrg
50317ca54c3SmrgExpandRegion
50417ca54c3Smrg		source:				REGION
50517ca54c3Smrg		destination:			REGION
50617ca54c3Smrg		left, right, top, bottom:	CARD16
50717ca54c3Smrg
50817ca54c3Smrg	Creates destination region containing the area specified by
50917ca54c3Smrg	expanding each rectangle in the source region by the specified
51017ca54c3Smrg	number of pixels to the left, right, top and bottom.
51117ca54c3Smrg
51217ca54c3Smrg************* XFIXES VERSION 4 OR BETTER ***********
51317ca54c3Smrg
51417ca54c3Smrg11. Cursor Visibility
51517ca54c3Smrg
51617ca54c3SmrgComposite managers may want to render the cursor themselves instead of
51717ca54c3Smrgrelying on the X server sprite drawing, this provides a way for them to
51817ca54c3Smrgdo so without getting a double cursor image.
51917ca54c3Smrg
52017ca54c3Smrg11.1 Requests
52117ca54c3Smrg
52217ca54c3SmrgHideCursor
52317ca54c3Smrg
52417ca54c3Smrg		window:			WINDOW
52517ca54c3Smrg
52617ca54c3Smrg	A client sends this request to indicate that it wants the
52717ca54c3Smrg	cursor image to be hidden (i.e. to not be displayed) when
52817ca54c3Smrg	the sprite is on the same screen as the specified window.
52917ca54c3Smrg	The sprite will be hidden if one or more clients have called
53017ca54c3Smrg	HideCursor and not ShowCursor.
53117ca54c3Smrg
53217ca54c3Smrg	Note that even though cursor hiding causes the cursor image
53317ca54c3Smrg	to be invisible, CursorNotify events will still be sent
53417ca54c3Smrg	normally, as if the cursor image were visible.
53517ca54c3Smrg
53617ca54c3Smrg	When a client with outstanding cursor hiding requests
53717ca54c3Smrg	terminates its connection these requests will be deleted.
53817ca54c3Smrg
53917ca54c3Smrg	Servers supporting the X Input Extension Version 2.0 or higher hide
54017ca54c3Smrg	all visible cursors in response to a HideCursor request. If a master
54117ca54c3Smrg	pointer is created while the cursors are hidden, this master pointer's
54217ca54c3Smrg	cursor will be hidden as well.
54317ca54c3Smrg
54417ca54c3SmrgShowCursor
54517ca54c3Smrg
54617ca54c3Smrg		window:			WINDOW
54717ca54c3Smrg
54817ca54c3Smrg	A client sends this request to indicate that it wants the
54917ca54c3Smrg	cursor image to be displayed when the sprite is on the same
55017ca54c3Smrg	screen as the specified window. The sprite will be hidden
55117ca54c3Smrg	if one or more clients have called HideCursor and not ShowCursor.
55217ca54c3Smrg
55317ca54c3Smrg	If the client has made no outstanding HideCursor requests
55417ca54c3Smrg	a BadMatch error is generated.
55517ca54c3Smrg
55617ca54c3Smrg	Servers supporting the X Input Extension Version 2.0 or higher show
55717ca54c3Smrg	all visible cursors in response to a ShowCursor request.
55817ca54c3Smrg
55917ca54c3Smrg************* XFIXES VERSION 5 OR BETTER ***********
56017ca54c3Smrg
56117ca54c3Smrg12. Pointer Barriers
56217ca54c3Smrg
56317ca54c3SmrgCompositing managers and desktop environments may have UI elements in
56417ca54c3Smrgparticular screen locations such that for a single-headed display they
56517ca54c3Smrgcorrespond to easy targets according to Fitt's Law, for example, the top
56617ca54c3Smrgleft corner.  For a multi-headed environment these corners should still be
56717ca54c3Smrgsemi-impermeable.  Pointer barriers allow the application to define
56817ca54c3Smrgadditional constraint on cursor motion so that these areas behave as
56917ca54c3Smrgexpected even in the face of multiple displays.
57017ca54c3Smrg
57117ca54c3SmrgAbsolute positioning devices like touchscreens do not obey pointer barriers.
57217ca54c3SmrgThere's no advantage to target acquisition to do so, since on a touchscreen
57317ca54c3Smrgall points are in some sense equally large, whereas for a relative
57417ca54c3Smrgpositioning device the edges and corners are infinitely large.
57517ca54c3Smrg
57617ca54c3SmrgWarpPointer and similar requests do not obey pointer barriers, for
57717ca54c3Smrgessentially the same reason.
57817ca54c3Smrg
57917ca54c3Smrg12.1 Types
58017ca54c3Smrg
58117ca54c3Smrg	BARRIER:	XID
58217ca54c3Smrg
58317ca54c3Smrg	BarrierDirections
58417ca54c3Smrg
58517ca54c3Smrg		BarrierPositiveX:	    1 << 0
58617ca54c3Smrg		BarrierPositiveY:	    1 << 1
58717ca54c3Smrg		BarrierNegativeX:	    1 << 2
58817ca54c3Smrg		BarrierNegativeY:	    1 << 3
58917ca54c3Smrg
59017ca54c3Smrg12.2 Errors
59117ca54c3Smrg
59217ca54c3Smrg	Barrier
59317ca54c3Smrg
59417ca54c3Smrg12.3 Requests
59517ca54c3Smrg
59617ca54c3SmrgCreatePointerBarrier
59717ca54c3Smrg
59817ca54c3Smrg		barrier:		    BARRIER
59917ca54c3Smrg		window:			    Window
60017ca54c3Smrg		x1, y2, x2, y2:		    INT16
60117ca54c3Smrg		directions:		    CARD32
60217ca54c3Smrg		devices:		    LISTofDEVICEID
60317ca54c3Smrg
60417ca54c3Smrg	Creates a pointer barrier along the line specified by the given
60517ca54c3Smrg	coordinates on the screen associated with the given window.  The
60617ca54c3Smrg	barrier has no spatial extent; it is simply a line along the left
60717ca54c3Smrg	or top edge of the specified pixels.  Barrier coordinates are in
60817ca54c3Smrg	screen space.
60917ca54c3Smrg
61017ca54c3Smrg	The coordinates must be axis aligned, either x1 == x2, or
61117ca54c3Smrg	y1 == y2, but not both.  The varying coordinates may be specified
61217ca54c3Smrg	in any order.  For x1 == x2, either y1 > y2 or y1 < y2 is valid.
61317ca54c3Smrg	If the coordinates are not valid BadValue is generated.
61417ca54c3Smrg
61517ca54c3Smrg	Motion is allowed through the barrier in the directions specified:
61617ca54c3Smrg	setting the BarrierPositiveX bit allows travel through the barrier
61717ca54c3Smrg	in the positive X direction, etc.  Nonsensical values (forbidding Y
61817ca54c3Smrg	axis travel through a vertical barrier, for example) and excess set
61917ca54c3Smrg	bits are ignored.
62017ca54c3Smrg
62117ca54c3Smrg	If the server supports the X Input Extension version 2 or higher,
62217ca54c3Smrg	the devices element names a set of master device to apply the
62317ca54c3Smrg	barrier to.  If XIAllDevices or XIAllMasterDevices are given, the
62417ca54c3Smrg	barrier applies to all master devices.  If a slave device is named,
62517ca54c3Smrg	BadDevice is generated; this does not apply to slave devices named
62617ca54c3Smrg	implicitly by XIAllDevices.  Naming a device multiple times is
62717ca54c3Smrg	legal, and is treated as though it were named only once.  If a
62817ca54c3Smrg	device is removed, the barrier continues to apply to the remaining
62917ca54c3Smrg	devices, but will not apply to any future device with the same ID
63017ca54c3Smrg	as the removed device.  Nothing special happens when all matching
63117ca54c3Smrg	devices are removed; barriers must be explicitly destroyed.
63217ca54c3Smrg
63317ca54c3Smrg	Errors: IDChoice, Window, Value, Device
63417ca54c3Smrg
63517ca54c3SmrgDestroyPointerBarrier
63617ca54c3Smrg
63717ca54c3Smrg		barrier:		    BARRIER
63817ca54c3Smrg
63917ca54c3Smrg	Destroys the named barrier.
64017ca54c3Smrg
64117ca54c3Smrg	Errors: Barrier 
64217ca54c3Smrg
6435395ea76Smrg************* XFIXES VERSION 6 OR BETTER ***********
6445395ea76Smrg
6455395ea76Smrg13. Disconnect mode
6465395ea76Smrg
6475395ea76SmrgThe X11 server is capable of terminating itself once all X11 clients are
6485395ea76Smrggone.
6495395ea76Smrg
6505395ea76SmrgYet, in a typical user session, there are a number of X11 clients running
6515395ea76Smrgcontinuously (e.g. Xsettings daemon, IBus, etc.). Those always-running
6525395ea76Smrgclients will prevent the X11 server from terminating, because the actual
6535395ea76Smrgnumber of X11 clients will never drop to 0.
6545395ea76Smrg
6555395ea76SmrgDisconnect mode allows the X11 clients themselves to specify that they
6565395ea76Smrgshould not be accounted for when checking the remaining clients prior
6575395ea76Smrgto terminate the X11 server.
6585395ea76Smrg
6595395ea76SmrgThis can be particularly useful for Wayland compositors which are able to
6605395ea76Smrgstart Xwayland on demand, as this allows Xwayland to terminate automatically
6615395ea76Smrgwhen the relevant X11 clients have quit.
6625395ea76Smrg
6635395ea76Smrg13.1 Types
6645395ea76Smrg
6655395ea76Smrg	XFixesClientDisconnectFlags
6665395ea76Smrg
6675395ea76Smrg		XFixesClientDisconnectFlagDefault:	    0
6685395ea76Smrg		XFixesClientDisconnectFlagTerminate:	    1 << 0
6695395ea76Smrg
6705395ea76Smrg	XFixesClientDisconnectFlagDefault is the default behavior for
6715395ea76Smrg	regular clients, i.e. the X11 server won't terminate as long as such
6725395ea76Smrg	clients are still connected.
6735395ea76Smrg
6745395ea76Smrg	XFixesClientDisconnectFlagTerminate indicates to the X11 server that
6755395ea76Smrg	it can ignore the client and terminate itself even though the client
6765395ea76Smrg	is still connected to the X11 server.
6775395ea76Smrg
6785395ea76Smrg13.2 Requests
6795395ea76Smrg
6805395ea76SmrgSetClientDisconnectMode
6815395ea76Smrg
6825395ea76Smrg		disconnect-mode:	    CARD32
6835395ea76Smrg
6845395ea76Smrg	Sets the disconnect mode for the client.
6855395ea76Smrg
6865395ea76Smrg	The disconnect-mode is a bit mask of XFixesClientDisconnectFlags.
6875395ea76Smrg
6885395ea76Smrg
6895395ea76SmrgGetClientDisconnectMode
6905395ea76Smrg
6915395ea76Smrg	Gets the disconnect mode for the client.
6925395ea76Smrg
6935395ea76Smrg		->
6945395ea76Smrg
6955395ea76Smrg		disconnect-mode:	    CARD32
6965395ea76Smrg
6975395ea76Smrg	The disconnect-mode is a bit mask of XFixesClientDisconnectFlags.
6985395ea76Smrg
6995395ea76Smrg
70017ca54c3Smrg99. Future compatibility
70117ca54c3Smrg
70217ca54c3SmrgThis extension is not expected to remain fixed.  Future changes will
70317ca54c3Smrgstrive to remain compatible if at all possible.  The X server will always
70417ca54c3Smrgsupport version 1 of the extension protocol if requested by a client.
70517ca54c3Smrg
70617ca54c3SmrgAdditions to the protocol will always by marked by minor version number
70717ca54c3Smrgchanges so that applications will be able to detect what requests are
70817ca54c3Smrgsupported.
709