Commit b6bc35b8 authored by Olivier Fourdan's avatar Olivier Fourdan Committed by Peter Hutterer
Browse files

xfixes: Add ClientDisconnectMode



The Xserver itself is capable of terminating itself once all X11 clients
are gone, yet in a typical full session, there are a number of X11
clients running continuously (e.g. the Xsettings daemon, IBus, etc.).

Those always-running clients will prevent the Xserver from terminating,
because the actual number of X11 clients will never drop to 0.

To solve this issue directly at the Xserver level, this add new entries
to the XFixes extension to let the X11 clients themselves specify the
disconnect mode they expect.

Typically, those X11 daemon clients would specify the disconnect mode
XFixesClientDisconnectFlagTerminate to let the Xserver know that they
should not be accounted for when checking the remaining clients prior
to terminate.
Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
parent 55914149
Pipeline #310500 passed with stages
in 3 minutes and 59 seconds
......@@ -3,6 +3,6 @@ includedir=@includedir@
Name: FixesProto
Description: X Fixes extension headers
Version: 5.0
Version: 6.0
Cflags: -I${includedir}
Requires: xextproto >= 7.0.99.1
......@@ -640,6 +640,63 @@ DestroyPointerBarrier
Errors: Barrier
************* XFIXES VERSION 6 OR BETTER ***********
13. Disconnect mode
The X11 server is capable of terminating itself once all X11 clients are
gone.
Yet, in a typical user session, there are a number of X11 clients running
continuously (e.g. Xsettings daemon, IBus, etc.). Those always-running
clients will prevent the X11 server from terminating, because the actual
number of X11 clients will never drop to 0.
Disconnect mode allows the X11 clients themselves to specify that they
should not be accounted for when checking the remaining clients prior
to terminate the X11 server.
This can be particularly useful for Wayland compositors which are able to
start Xwayland on demand, as this allows Xwayland to terminate automatically
when the relevant X11 clients have quit.
13.1 Types
XFixesClientDisconnectFlags
XFixesClientDisconnectFlagDefault: 0
XFixesClientDisconnectFlagTerminate: 1 << 0
XFixesClientDisconnectFlagDefault is the default behavior for
regular clients, i.e. the X11 server won't terminate as long as such
clients are still connected.
XFixesClientDisconnectFlagTerminate indicates to the X11 server that
it can ignore the client and terminate itself even though the client
is still connected to the X11 server.
13.2 Requests
SetClientDisconnectMode
disconnect-mode: CARD32
Sets the disconnect mode for the client.
The disconnect-mode is a bit mask of XFixesClientDisconnectFlags.
GetClientDisconnectMode
Gets the disconnect mode for the client.
->
disconnect-mode: CARD32
The disconnect-mode is a bit mask of XFixesClientDisconnectFlags.
99. Future compatibility
This extension is not expected to remain fixed. Future changes will
......
......@@ -532,6 +532,40 @@ typedef struct {
#define sz_xXFixesDestroyPointerBarrierReq 8
/*************** Version 6.0 ******************/
typedef struct {
CARD8 reqType;
CARD8 xfixesReqType;
CARD16 length;
CARD32 disconnect_mode;
} xXFixesSetClientDisconnectModeReq;
#define sz_xXFixesSetClientDisconnectModeReq 8
typedef struct {
CARD8 reqType;
CARD8 xfixesReqType;
CARD16 length;
} xXFixesGetClientDisconnectModeReq;
#define sz_xXFixesGetClientDisconnectModeReq 4
typedef struct {
BYTE type; /* X_Reply */
CARD8 pad0;
CARD16 sequenceNumber;
CARD32 length;
CARD32 disconnect_mode;
CARD32 pad1;
CARD32 pad2;
CARD32 pad3;
CARD32 pad4;
CARD32 pad5;
} xXFixesGetClientDisconnectModeReply;
#define sz_xXFixesGetClientDisconnectModeReply 32
#undef Barrier
#undef Region
#undef Picture
......
......@@ -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_XFixesSetClientDisconnectMode 33
#define X_XFixesGetClientDisconnectMode 34
#define XFixesNumberRequests (X_XFixesDestroyPointerBarrier+1)
#define XFixesNumberRequests (X_XFixesGetClientDisconnectMode+1)
/* Selection events share one event number */
#define XFixesSelectionNotify 0
......@@ -136,4 +139,11 @@
#define BarrierNegativeX (1L << 2)
#define BarrierNegativeY (1L << 3)
/*************** Version 6 ******************/
/* The default server behaviour */
#define XFixesClientDisconnectFlagDefault 0
/* The server may disconnect this client to shut down */
#define XFixesClientDisconnectFlagTerminate (1L << 0)
#endif /* _XFIXESWIRE_H_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment