xorgproto: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 4 23:55:58 UTC 2022


 COPYING-xwaylandproto                  |   19 ++++++
 Makefile.am                            |   11 +++
 configure.ac                           |    3 -
 include/X11/extensions/meson.build     |    1 
 include/X11/extensions/xwaylandproto.h |   63 +++++++++++++++++++++
 meson.build                            |    4 +
 xwaylandproto.pc.in                    |    7 ++
 xwaylandproto.txt                      |   96 +++++++++++++++++++++++++++++++++
 8 files changed, 201 insertions(+), 3 deletions(-)

New commits:
commit ad6412624ef6dc4d7548fe16c254c4166ffa7198
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jul 29 09:46:34 2022 +1000

    Add the XWAYLAND extension
    
    This extension exists to serve one purpose: reliably identifying
    Xwayland. Previous attempts at doing so included querying root window
    properties, output names or input device names. All these attempts are
    somewhat unreliable. Instead, let's use an extension - where that
    extension is present we have an Xwayland server.
    
    Clients should never need to do anything but check whether the extension
    exists through XQueryExtension/XListExtensions.
    
    This extension provides a single QueryVersion request only, and
    that is only to provide future compatibility if we ever need anything
    other than "this extension exists" functionality.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/COPYING-xwaylandproto b/COPYING-xwaylandproto
new file mode 100644
index 0000000..727a530
--- /dev/null
+++ b/COPYING-xwaylandproto
@@ -0,0 +1,19 @@
+Copyright 2022 Red Hat, Inc.
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting documentation, and
+that the name of the copyright holders not be used in advertising or
+publicity pertaining to distribution of the software without specific,
+written prior permission.  The copyright holders make no representations
+about the suitability of this software for any purpose.  It is provided "as
+is" without express or implied warranty.
+
+THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+OF THIS SOFTWARE.
diff --git a/Makefile.am b/Makefile.am
index 3d59178..e25650f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -326,6 +326,13 @@ xinerama_HEADERS = \
 xineramaprotopkgconfigdir = $(datadir)/pkgconfig
 xineramaprotopkgconfig_DATA = xineramaproto.pc
 
+xwaylandprotodir = $(includedir)/X11/extensions
+xwaylandproto_HEADERS = \
+	include/X11/extensions/xwaylandproto.h
+
+xwaylandprotopkgconfigdir = $(datadir)/pkgconfig
+xwaylandprotopkgconfig_DATA = xwaylandproto.pc
+
 if LEGACY
 XCalibrateincludedir = $(includedir)/X11/extensions
 XCalibrateinclude_HEADERS = \
@@ -430,7 +437,8 @@ dist_doc_DATA = \
 	randrproto.txt \
 	renderproto.txt \
 	resproto.txt \
-	xv-protocol-v2.txt
+	xv-protocol-v2.txt \
+	xwaylandproto.txt
 
 EXTRA_DIST = \
     COPYING-applewmproto \
@@ -469,6 +477,7 @@ EXTRA_DIST = \
     COPYING-xf86rushproto \
     COPYING-xf86vidmodeproto \
     COPYING-xineramaproto \
+    COPYING-xwaylandproto \
     README.md \
     autogen.sh \
     include/GL/internal/meson.build \
diff --git a/configure.ac b/configure.ac
index fa064f6..79464e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -157,6 +157,7 @@ AC_CONFIG_FILES([applewmproto.pc
 		 xf86vidmodeproto.pc
 		 xineramaproto.pc
 		 xproto.pc
-		 xproxymngproto.pc])
+		 xproxymngproto.pc
+		 xwaylandproto.pc])
 
 AC_OUTPUT
diff --git a/include/X11/extensions/meson.build b/include/X11/extensions/meson.build
index d1ac281..9c91f22 100644
--- a/include/X11/extensions/meson.build
+++ b/include/X11/extensions/meson.build
@@ -87,6 +87,7 @@ install_headers(
     'XvMC.h',
     'XvMCproto.h',
     'Xvproto.h',
+    'xwaylandproto.h',
     subdir : 'X11/extensions'
 )
 
diff --git a/include/X11/extensions/xwaylandproto.h b/include/X11/extensions/xwaylandproto.h
new file mode 100644
index 0000000..49f048d
--- /dev/null
+++ b/include/X11/extensions/xwaylandproto.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright © 2022 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifndef _XWAYLAND_PROTO_H_
+#define _XWAYLAND_PROTO_H_
+
+#include <X11/Xproto.h>
+
+#define XWAYLAND_EXTENSION_NAME		"XWAYLAND"
+#define XWAYLAND_EXTENSION_MAJOR	1
+#define XWAYLAND_EXTENSION_MINOR	0
+
+/* Request opcodes */
+#define X_XwlQueryVersion		0
+
+#define XwlNumberRequests		1
+#define XwlNumberErrors			0
+#define XwlNumberEvents			0
+
+typedef struct {
+    CARD8   reqType;
+    CARD8   xwlReqType;
+    CARD16  length;
+    CARD16  majorVersion;
+    CARD16  minorVersion;
+} xXwlQueryVersionReq;
+#define sz_xXwlQueryVersionReq		8
+
+typedef struct {
+    BYTE    type;   /* X_Reply */
+    BYTE    pad1;
+    CARD16  sequenceNumber;
+    CARD32  length;
+    CARD16  majorVersion;
+    CARD16  minorVersion;
+    CARD32  pad2;
+    CARD32  pad3;
+    CARD32  pad4;
+    CARD32  pad5;
+    CARD32  pad6;
+} xXwlQueryVersionReply;
+#define sz_xXwlQueryVersionReply	32
+
+#endif
diff --git a/meson.build b/meson.build
index 7e02ac5..cee73de 100644
--- a/meson.build
+++ b/meson.build
@@ -51,6 +51,7 @@ pcs = [
         'xf86vidmodeproto',
         'xineramaproto',
         'xproto',
+        'xwaylandproto',
 ]
 
 pc_data = configuration_data()
@@ -78,7 +79,8 @@ docs = files('compositeproto.txt',
              'randrproto.txt',
              'renderproto.txt',
              'resproto.txt',
-             'xv-protocol-v2.txt')
+             'xv-protocol-v2.txt',
+             'xwaylandproto.txt')
 install_data(docs,
              install_dir: get_option('datadir') / 'doc' / 'xorgproto')
 
diff --git a/xwaylandproto.pc.in b/xwaylandproto.pc.in
new file mode 100644
index 0000000..16fccc7
--- /dev/null
+++ b/xwaylandproto.pc.in
@@ -0,0 +1,7 @@
+prefix=@prefix@
+includedir=@includedir@
+
+Name: XwaylandProto
+Description: Xwayland extension headers
+Version: 1.0
+Cflags: -I${includedir}
diff --git a/xwaylandproto.txt b/xwaylandproto.txt
new file mode 100644
index 0000000..25fdf87
--- /dev/null
+++ b/xwaylandproto.txt
@@ -0,0 +1,96 @@
+                        The XWAYLAND Extension
+			    Version 1.0
+			     2022-07-29
+
+1. Introduction
+
+The XWAYLAND extension allows clients to reliably identify whether an X server
+is Xwayland. It does not provide any functionality beyond the absolute minimum
+to identify as extension.
+
+Only Xwayland initializes this extension. Thus, if the extension is present,
+the X server is Xwayland. Clients should not need the protocol detailed in this
+document, a QueryExtension or ListExtensions request is sufficient to check
+whether the extension is present.
+
+The protocol detailed in this document is merely to future-proof this extension
+in case actual functionality is added in the future.
+
+			     ❄ ❄ ❄  ❄  ❄ ❄ ❄
+2. Version History
+
+- 1.0, July 2022: QueryVersion request only
+
+			     ❄ ❄ ❄  ❄  ❄ ❄ ❄
+
+3. Events and Errors
+
+XWAYLAND defines no events or errrors
+
+			     ❄ ❄ ❄  ❄  ❄ ❄ ❄
+
+4. Extension initialization
+
+The name of this extension is "XWAYLAND"
+
+┌───
+   XwlQueryVersion
+	client-major-version:	CARD16
+	client-minor-version:	CARD16
+      ▶
+	major-version:		CARD16
+	minor-version:		CARD16
+└───
+
+	The client sends the highest supported version to the server
+	and the server replies with the highest version it supports,
+	but no higher than the requested version. Major versions changes
+	can introduce incompatibilities in existing functionality, minor
+	version changes introduce only backward compatible changes.
+	It is the clients responsibility to ensure that the server
+	supports a version which is compatible with its expectations.
+
+	Backwards compatible changes include addition of new
+	requests.
+
+			     ❄ ❄ ❄  ❄  ❄ ❄ ❄
+
+Appendix A. Protocol Encoding
+
+Syntactic Conventions
+
+This document uses the same syntactic conventions as the core X
+protocol encoding document.
+
+A.1 Common Types
+
+None.
+
+A.2 Protocol Requests
+
+┌───
+    XwlQueryVersion
+	1	CARD8			major opcode
+	1	0			XWAYLAND opcode
+	2	2			length
+	2	CARD16			major version
+	2	CARD16			minor version
+      ▶
+	1	1			Reply
+	1				unused
+	2	CARD16			sequence number
+	4	0			reply length
+	2	CARD16			major version
+	2	CARD16			minor version
+	20				unused
+└───
+
+A.3 Protocol Events
+
+The XWAYLAND extension defines no events.
+
+A.4 Protocol Errors
+
+The XWAYLAND extension defines no errors.
+
+			     ❄ ❄ ❄  ❄  ❄ ❄ ❄


More information about the xorg-commit mailing list