Fix regression in opening local display in waitforx

Commit 80fab03198 introduced a way to
prevent waitforx going to the network when trying to open a display,
and hence potentially blocking.

This method turned out to be invalidated by libxcb version 1.16 and
1.17

This change adds an explicit check that the Unix socket for the display
in /tmp/.X11-unix/Xn is open before trying to connect to display ':n'.
This has the same effect.
This commit is contained in:
matt335672
2024-12-09 20:51:03 +00:00
parent e404509be3
commit 2a190a2264
5 changed files with 99 additions and 37 deletions
+6
View File
@@ -61,4 +61,10 @@
#define XRDP_X11RDP_STR XRDP_SOCKET_PATH "/" XRDP_X11RDP_BASE_STR
#define XRDP_DISCONNECT_STR XRDP_SOCKET_PATH "/" XRDP_DISCONNECT_BASE_STR
/* Where X11 stores its Unix Domain Sockets (unlikely to change) */
#define X11_UNIX_SOCKET_DIRECTORY "/tmp/.X11-unix"
/* fullpath to an X11 display socket */
#define X11_UNIX_SOCKET_STR X11_UNIX_SOCKET_DIRECTORY "/X%d"
#endif