[PATCH] Xephyr: Prefer using MIT-SHM FD-passing when possible

2018-01-30 Thread Alexander Volkov
This makes the shared memory visible only for the Xephyr and the X server to which it is connected. Signed-off-by: Alexander Volkov --- hw/kdrive/ephyr/ephyr.h | 1 + hw/kdrive/ephyr/hostx.c | 165 +++- 2 files changed, 121 insertions(+), 45

[PATCH xserver 1/2] Xephyr: Extract functions to create/delete shared memory segments

2018-01-31 Thread Alexander Volkov
Signed-off-by: Alexander Volkov --- hw/kdrive/ephyr/hostx.c | 85 - 1 file changed, 48 insertions(+), 37 deletions(-) diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index ef8541673..04a8de0b1 100644 --- a/hw/kdrive/ephyr/hostx.c

[PATCH xserver 2/2] Xephyr: Prefer using MIT-SHM FD-passing when possible

2018-01-31 Thread Alexander Volkov
This makes the shared memory visible only for the Xephyr and the X server to which it is connected. Signed-off-by: Alexander Volkov --- configure.ac| 2 +- hw/kdrive/ephyr/ephyr.h | 1 + hw/kdrive/ephyr/hostx.c | 109 +++- 3 files

[PATCH xserver] Xephyr: Call forgotten XShmDetach if can't mmap SHM segment

2018-02-02 Thread Alexander Volkov
--- hw/kdrive/ephyr/hostx.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 23e1cd3bf..8a69ec1e0 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -457,8 +457,9 @@ hostx_create_shm_segment(xc

[PATCH xserver] Xephyr: Require xcb-shm version 1.9.3 or newer

2018-02-07 Thread Alexander Volkov
It's needed for FD-passing. Signed-off-by: Alexander Volkov --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 98b8ea2ed..9e498e662 100644 --- a/configure.ac +++ b/configure.ac @@ -2305,7 +2305,7 @@ XEPHYR_INCS= AM_CONDIT

[PATCH xserver] Xephyr: Avoid calling xcb_shm_detach() twice

2018-02-20 Thread Alexander Volkov
This call was forgotten to be removed in 90996f5909aab4bc9aa4011a6a6d0555a7aa3adf in which hostx_destroy_shm_segment() was introduced, which itself does it. Signed-off-by: Alexander Volkov --- hw/kdrive/ephyr/hostx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/kdrive/ephyr/hostx.c b

[PATCH xserver] os/xdmcp: Don't create a new socket in XdmcpReset()

2018-02-26 Thread Alexander Volkov
xdmcpSocket survives during the reset, there is no need to create a new one. This commit restores logic that was broken by 49c0f2413d32fdfe36e45861fcb32aaeab633094 in Xorg 1.19. Signed-off-by: Alexander Volkov --- os/xdmcp.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions

Re: [PATCH xserver] os/xdmcp: Don't create a new socket in XdmcpReset()

2018-03-06 Thread Alexander Volkov
26.02.2018 19:53, Alexander Volkov пишет: xdmcpSocket survives during the reset, there is no need to create a new one. This commit restores logic that was broken by 49c0f2413d32fdfe36e45861fcb32aaeab633094 in Xorg 1.19. Signed-off-by: Alexander Volkov --- os/xdmcp.c | 12 +--- 1

[PATCH xserver] Xext/shm: Downgrade from error to debug log output about success

2018-03-12 Thread Alexander Volkov
Signed-off-by: Alexander Volkov --- Xext/shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xext/shm.c b/Xext/shm.c index 15e1b67ff..fc8441c43 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -1199,7 +1199,7 @@ shm_tmpfile(void) #ifdef O_TMPFILE fd = open(SHMDIR

[PATCH xserver] os: Call FlushClient() before sending FD-passing messages

2018-03-30 Thread Alexander Volkov
Otherwise a client may receive data with an unrelated file descriptor after calling recvmsg() if its input buffer is not big enough. In libxcb it may lead to a situation when all received messages fit the buffer while a message related to the attached fd is not received yet. libxcb can't find the c

Re: [PATCH xserver] os: Call FlushClient() before sending FD-passing messages

2018-04-03 Thread Alexander Volkov
31.03.2018 22:00, Keith Packard пишет: +if (oc->output && oc->output->count > 0) +(void) FlushClient(client, oc, (char *) NULL, 0); + FlushClient doesn't empty the buffer when the kernel buffers are full, so while calling it here may reduce the occurrence of the problem, it won't eli

Re: [PATCH xserver] os: Call FlushClient() before sending FD-passing messages

2018-04-09 Thread Alexander Volkov
03.04.2018 21:57, Keith Packard пишет: Alexander Volkov writes: Yes, it would be easier to fix this in libxcb, but I believe that it would be more correct to do this in the X server. At least I want to try to fix the X server. Hrm. The problem is that there are two streams of data here

[PATCH] Introduce xcb_aux_alloc_shm() to create anonymous files in RAM

2018-04-10 Thread Alexander Volkov
... which then can be mapped with mmap(). It is intended to be used in conjunction with xcb_shm_attach_fd() to access the created shared memory from a client and the X server. Signed-off-by: Alexander Volkov --- configure.ac | 47 + src/xcb_aux.c | 83

[PATCH] Xi: call UpdateDeviceState() even when the client is missing

2015-06-02 Thread Alexander Volkov
been sent to the client. It results in a stuck left mouse button. This patch adds a call to UpdateDeviceState() in case the client can't be found. Signed-off-by: Alexander Volkov --- Xi/exevents.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Xi/exevents.c b/Xi/exevents.c index 1c

[PATCH] Xi: call UpdateDeviceState() even when the client is missing

2015-06-16 Thread Alexander Volkov
been sent to the client. It results in a stuck left mouse button. This patch adds a call to UpdateDeviceState() in case the client can't be found. Signed-off-by: Alexander Volkov --- Xi/exevents.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Xi/exevents.c b/Xi/exevents.c index 1c

[PATCH v2] Xi: call UpdateDeviceState() even when the client is missing

2015-06-17 Thread Alexander Volkov
been sent to the client. It results in a stuck left mouse button. This patch leads to calling UpdateDeviceState() in case the client can't be found. Signed-off-by: Alexander Volkov --- Xi/exevents.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Xi/exevents.c

[PATCH xserver] Xext/shm: Refuse to work for remote clients

2018-06-04 Thread Alexander Volkov
Avoid access to System V shared memory segment on the X server side for clients forwarded via SSH. Also prevent them from hanging while waiting for the reply from the ShmCreateSegment request. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=11080 Signed-off-by: Alexander Volkov --- Xext

[PATCH xserver] Xext/shm: Refuse to work for remote clients

2018-06-05 Thread Alexander Volkov
/show_bug.cgi?id=11080 Signed-off-by: Alexander Volkov --- Xext/shm.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Xext/shm.c b/Xext/shm.c index fc8441c43..896a966e3 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -1302,9 +1302,14 @@ static int ProcShmDispatch

[PATCH xserver] dpms: Add support for DPMSInfoNotify event

2018-10-02 Thread Alexander Volkov
From: Alexander Volkov It was introduced in DPMS 1.2 (xorgproto). This allows applications to respond to changes of power level of a monitor, e.g. an application may stop rendering and related calculations when the monitor is off. Related bug: https://bugs.freedesktop.org/57120 Signed-off-by

[PATCH xcb] dpms: Add DPMSInfoNotify event

2018-10-02 Thread Alexander Volkov
From: Alexander Volkov See the description in xorgproto repository. Signed-off-by: Alexander Volkov --- src/dpms.xml | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/dpms.xml b/src/dpms.xml index 5581284..51decb7 100644 --- a/src/dpms.xml +++ b/src

[PATCH xorgproto] Add DPMSInfoNotify event

2018-10-02 Thread Alexander Volkov
From: Alexander Volkov This allows applications to respond to changes of power level of a monitor, e.g. an application may stop rendering and related calculations when the monitor is off. Bump DPMS version to 1.2. Signed-off-by: Alexander Volkov --- include/X11/extensions/dpmsconst.h | 5

[PATCH xserver] dpms: Add support for DPMSInfoNotify event

2018-10-02 Thread Alexander Volkov
From: Alexander Volkov It was introduced in DPMS 1.2 (xorgproto). This allows applications to respond to changes of power level of a monitor, e.g. an application may stop rendering and related calculations when the monitor is off. Related bug: https://bugs.freedesktop.org/57120 Signed-off-by

[PATCH xcb] dpms: Add DPMSInfoNotify event

2018-10-02 Thread Alexander Volkov
From: Alexander Volkov See the description in xorgproto repository. Signed-off-by: Alexander Volkov --- src/dpms.xml | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/dpms.xml b/src/dpms.xml index 5581284..51decb7 100644 --- a/src/dpms.xml +++ b/src

[PATCH xorgproto] Add DPMSInfoNotify event

2018-10-02 Thread Alexander Volkov
From: Alexander Volkov This allows applications to respond to changes of power level of a monitor, e.g. an application may stop rendering and related calculations when the monitor is off. Bump DPMS version to 1.2. Signed-off-by: Alexander Volkov --- include/X11/extensions/dpmsconst.h | 5

Re: [PATCH xcb] dpms: Add DPMSInfoNotify event

2018-10-02 Thread Alexander Volkov
Oh, sorry for sending it twice. See the test program in the attachment. It can be compiled by gcc -o dpmsnotify dpmsnotify.c -lxcb -lxcb-dpms #include #include #include #include int main() { xcb_connection_t*c; xcb_generic_event_t *e; /* Open the connection to the X server

Re: [PATCH xorgproto] Add DPMSInfoNotify event

2018-10-02 Thread Alexander Volkov
02.10.2018 17:33, Julien Cristau пишет: We shouldn't be adding new extension events that don't come through the Generic Event Extension, as the extension event space is basically full, IIRC (see https://lists.x.org/pipermail/xorg-devel/2010-March/006716.html). Ok, thanks. This also seems like

[PATCH xserver v2] dpms: Add support for DPMSInfoNotify event

2018-10-02 Thread Alexander Volkov
From: Alexander Volkov It was introduced in DPMS 1.2 (xorgproto). This allows applications to respond to changes of power level of a monitor, e.g. an application may stop rendering and related calculations when the monitor is off. Related bug: https://bugs.freedesktop.org/57120 v2: send as

[PATCH xorgproto v2] Add DPMSInfoNotify event

2018-10-02 Thread Alexander Volkov
From: Alexander Volkov This allows applications to respond to changes of power level of a monitor, e.g. an application may stop rendering and related calculations when the monitor is off. Bump DPMS version to 1.2. v2: add it as generic event Signed-off-by: Alexander Volkov --- include/X11