[PATCH] Atomic query requests

Peter Hutterer peter.hutterer at who-t.net
Mon Mar 15 17:56:11 PDT 2010


On Mon, Mar 15, 2010 at 12:06:15PM -0400, Adam Jackson wrote:
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  fixesproto.txt |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
>  xfixesproto.h  |   54 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  xfixeswire.h   |    7 ++++-
>  3 files changed, 113 insertions(+), 5 deletions(-)
> 
> diff --git a/fixesproto.txt b/fixesproto.txt
> index 5ef8153..9d0547f 100644
> --- a/fixesproto.txt
> +++ b/fixesproto.txt
> @@ -1,7 +1,7 @@
>                          The XFIXES Extension
> -			    Version 4.0
> -			 Document Revision 2
> -			     2006-12-14
> +			    Version 5.0
> +			 Document Revision 1
> +			     2010-03-15
>  			    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 }
>  
>  7.2 Events
> @@ -566,6 +567,56 @@ ShowCursor
>  	Servers supporting the X Input Extension Version 2.0 or higher show
>  	all visible cursors in response to a ShowCursor request.
>  
> +************* XFIXES VERSION 5 OR BETTER ***********
> +
> +12. Atomic queries
> +
> +Some core protocol requests return information about only a few windows,
> +when the application often wants information about the hierarchy all the
> +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.
> +
> +12.1 Types
> +
> +	POINTERWINDOW			{ Window w,
> +					  CARD16 x,
> +					  CARD16 y }
> +
> +12.2 Requests
> +
> +QueryPointer
> +
> +		->
> +
> +		mask:			SETofKEYBUTMASK
> +		pointer_windows:	LISTofPOINTERWINOW
> +
> +	This request returns the list of windows that contain the cursor,
> +	from leafmost to rootmost, and the cursor'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.

I think this one should leave room for the device ID. Gtk is being ported to
XI2 already, so not including a device specifier is likely to bite us quite
soon. Having said that, this makes the mask more complex as well since the
XI2 mask usage is more verbose than the core one.

Cheers,
  Peter

> +
> +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.
> +
>  99. Future compatibility
>  
>  This extension is not expected to remain fixed.  Future changes will
> diff --git a/xfixesproto.h b/xfixesproto.h
> index 545e325..9b745bb 100644
> --- a/xfixesproto.h
> +++ b/xfixesproto.h
> @@ -500,6 +500,60 @@ typedef struct {
>  
>  #define sz_xXFixesShowCursorReq	sizeof(xXFixesShowCursorReq)
>  
> +typedef struct {
> +    CARD8   reqType;
> +    CARD8   xfixesReqType;
> +    CARD16  length 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 Region
>  #undef Picture
>  #undef Window
> diff --git a/xfixeswire.h b/xfixeswire.h
> index 6f20270..70ba4c5 100644
> --- a/xfixeswire.h
> +++ b/xfixeswire.h
> @@ -47,7 +47,7 @@
>  #define _XFIXESWIRE_H_
>  
>  #define XFIXES_NAME	"XFIXES"
> -#define XFIXES_MAJOR	4
> +#define XFIXES_MAJOR	5
>  #define XFIXES_MINOR	0
>  
>  /*************** Version 1 ******************/
> @@ -85,8 +85,11 @@
>  /*************** Version 4 ******************/
>  #define X_XFixesHideCursor		    29
>  #define X_XFixesShowCursor		    30
> +/*************** Version 5 ******************/
> +#define X_XFixesQueryPointer		    31
> +#define X_XFixesQueryAncestors		    32
>  
> -#define XFixesNumberRequests		    (X_XFixesShowCursor+1)
> +#define XFixesNumberRequests		    (X_XFixesQueryAncestors+1)
>  
>  /* Selection events share one event number */
>  #define XFixesSelectionNotify		    0
> -- 
> 1.6.5.2


More information about the xorg-devel mailing list