[PATCH 1/2] Atomic query requests

Peter Hutterer peter.hutterer at who-t.net
Thu Dec 1 21:05:49 PST 2011


On Thu, Dec 01, 2011 at 03:53:40PM -0500, Adam Jackson wrote:
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  fixesproto.txt |   64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  xfixesproto.h  |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  xfixeswire.h   |    7 ++++-
>  3 files changed, 126 insertions(+), 3 deletions(-)
> 
> diff --git a/fixesproto.txt b/fixesproto.txt
> index 5903ac9..1ff442f 100644
> --- a/fixesproto.txt
> +++ b/fixesproto.txt
> @@ -1,7 +1,7 @@
>                          The XFIXES Extension
>  			    Version 5.0
>  			 Document Revision 1

something tells me that the revision number is lying.

> -			     2010-11-15
> +			     2011-09-12
>  			    Keith Packard
>  			  keithp at keithp.com
>  
> @@ -160,6 +160,7 @@ current cursor and provides a way to identify cursor images to avoid
>  refetching the image each time it changes to a previously seen cursor.
>  
>  7.1 Types
> +
>  	CURSOREVENT			{ DisplayCursor }
>  

whitespace noise

>  7.2 Events
> @@ -650,6 +651,67 @@ DestroyPointerBarrier
>  
>  	Errors: Barrier 
>  
> +************* XFIXES VERSION 6 OR BETTER ***********
> +
> +13. Atomic queries
> +
> +Some core protocol requests return information about only a few windows,
> +when the application often wants information about the hierarchy all the

s/application/client/ ?

> +way to the root.  In order to get consistent information this has to be
> +done under a server grab, which is impolite when the client is remote.
> +
> +13.1 Types
> +
> +	POINTERWINDOW			{ Window w,
> +					  CARD16 x,
> +					  CARD16 y }
> +
> +13.2 Requests
> +
> +QueryPointer
> +
> +		pointer:		DEVICEID

Please use 'deviceid' instead of 'pointer', it's the common naming in XI2.

> +
> +		->
> +
> +		mask:			SETofKEYBUTMASK

that only works for core/XI1. In XI2, you need the same as in the
XIQueryPointer reply:
            mods:           MODIFIERINFO
            group:          GROUPINFO
            buttons_len:    CARD16
            buttons:        SETofBUTTONMASK

however, with that the question arises: why not tack the full window list to
the XIQueryPointer reply instead of adding a new request in xfixes?
getting a request that's core and XI2 compatible is a bit dirty.

> +		pointer_windows:	LISTofPOINTERWINOW

typo: LISTofPOINTERWINDOW

> +
> +	This request returns the list of windows that contain the given
> +	pointer device, from leafmost to rootmost, and the pointer's offset
> +	within each. It also returns the current button mask for the pointer.
> +
> +	Unlike the core QueryPointer request, this does not take a root
> +	window argument a priori; the client simply receives the cursor
> +	state for whichever root window the cursor happens to be on.  If
> +	the cursor is on no screen (for example, in a dead area between
> +	screens, or owned by a native window system) a zero-sized list
> +	is returned.
> +
> +	If the pointer argument is None, information for the core pointer is
> +	returned.  Otherwise, if the server supports the X Input Extension
> +	version 2 or greater, the pointer argument may name any pointer
> +	device.

This paragraph is more explicit as:
"If the deviceid is None, information for the first master pointer is
returned. If the deviceid names a pointer device, that device is returned.
If the device is not a pointer device, a BadDevice error is generated.
If the server does not support the X Input Extension version 2 or later,
deviceid is ignored and the core pointer is returned."


> +	
> +	Errors: Device
> +
> +QueryAncestors
> +
> +		window:			WINDOW
> +
> +		->
> +
> +		windows:		LISTofWINDOW
> +
> +	This request returns the list of ancestors of the named window,
> +	from nearest to rootmost.  If the named window is a root window,
> +	a zero-sized list is returned.
> +
> +	If the window argument does not name a defined window, BadWindow
> +	is generated.
> +
> +	Errors: Window
> +
>  99. Future compatibility
>  
>  This extension is not expected to remain fixed.  Future changes will
> diff --git a/xfixesproto.h b/xfixesproto.h
> index fcf409a..717cba4 100644
> --- a/xfixesproto.h
> +++ b/xfixesproto.h
> @@ -532,6 +532,64 @@ typedef struct {
>  
>  #define sz_xXFixesDestroyPointerBarrierReq 8
>  
> +/*************** Version 6.0 ******************/
> +
> +typedef struct {
> +    CARD8   reqType;
> +    CARD8   xfixesReqType;
> +    CARD16  length B16;
> +    CARD16  device B16;

s/device/deviceid/

Cheers,
  Peter

> +    CARD16  pad1 B16;
> +} xXFixesQueryPointerReq;
> +
> +#define sz_xXFixesQueryPointerReq sizeof(xXFixesQueryPointerReq)
> +
> +typedef struct {
> +    Window  window B32;
> +    CARD16  x B16;
> +    CARD16  y B16;
> +} xXFixesPointerWindow;
> +
> +typedef struct {
> +    BYTE    type;   /* X_Reply */
> +    BYTE    pad1;
> +    CARD16  sequenceNumber B16;
> +    CARD32  length B32;
> +    CARD16  mask B16;
> +    CARD16  pad2 B16;
> +    CARD32  numWindows B32;
> +    CARD32  pad3 B32;
> +    CARD32  pad4 B32;
> +    CARD32  pad5 B32;
> +    CARD32  pad6 B32;
> +} xXFixesQueryPointerReply;
> +
> +#define sz_xXFixesQueryPointerReply 32
> +
> +typedef struct {
> +    CARD8   reqType;
> +    CARD8   xfixesReqType;
> +    CARD16  length B16;
> +    Window  window B32;
> +} xXFixesQueryAncestorsReq;
> +
> +#define sz_xXFixesQueryAncestorsReq sizeof(xXFixesQueryAncestorsReq)
> +
> +typedef struct {
> +    BYTE    type;   /* X_Reply */
> +    BYTE    pad1;
> +    CARD16  sequenceNumber B16;
> +    CARD32  length B32;
> +    CARD32  numWindows B32;
> +    CARD32  pad3 B32;
> +    CARD32  pad4 B32;
> +    CARD32  pad5 B32;
> +    CARD32  pad6 B32;
> +    CARD32  pad7 B32;
> +} xXFixesQueryAncestorsReply;
> +
> +#define sz_xXFixesQueryAncestorsReply 32
> +
>  #undef Barrier
>  #undef Region
>  #undef Picture
> diff --git a/xfixeswire.h b/xfixeswire.h
> index 432349a..8d2319b 100644
> --- a/xfixeswire.h
> +++ b/xfixeswire.h
> @@ -48,7 +48,7 @@
>  #define _XFIXESWIRE_H_
>  
>  #define XFIXES_NAME	"XFIXES"
> -#define XFIXES_MAJOR	5
> +#define XFIXES_MAJOR	6
>  #define XFIXES_MINOR	0
>  
>  /*************** Version 1 ******************/
> @@ -89,8 +89,11 @@
>  /*************** Version 5 ******************/
>  #define X_XFixesCreatePointerBarrier	    31
>  #define X_XFixesDestroyPointerBarrier	    32
> +/*************** Version 6 ******************/
> +#define X_XFixesQueryPointer		    33
> +#define X_XFixesQueryAncestors		    34
>  
> -#define XFixesNumberRequests		    (X_XFixesDestroyPointerBarrier+1)
> +#define XFixesNumberRequests		    (X_XFixesQueryAncestors+1)
>  
>  /* Selection events share one event number */
>  #define XFixesSelectionNotify		    0
> -- 
> 1.7.6.4
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list