From bf5613f888e837641b9e16aacb36ffb43a9cccda Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Wed, 2 Jan 2019 21:55:23 +0100 Subject: [PATCH] xwayland: Fix wm_fd readin with no listen_fds Since 08843efc KWin was not able to start a Wayland session. Independently of listen_fd_count add_client_fd must be called. Same holds for the wm_selection_callback. Therefore just remove the condition. Bugzilla: https://bugs.freedesktop.org/109220 Signed-off-by: Roman Gilg --- hw/xwayland/xwayland.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index cc815d511..289683b6e 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -95,7 +95,7 @@ ddxUseMsg(void) static int wm_fd = -1; static int listen_fds[5] = { -1, -1, -1, -1, -1 }; -static int listen_fd_count; +static int listen_fd_count = 0; int ddxProcessArgument(int argc, char *argv[], int i) @@ -1165,12 +1165,10 @@ InitOutput(ScreenInfo * screen_info, int argc, char **argv) LocalAccessScopeUser(); - if (listen_fd_count > 0) { - if (wm_fd >= 0) { - TimerSet(NULL, 0, 1, add_client_fd, NULL); - AddCallback(&SelectionCallback, wm_selection_callback, NULL); - } else { - listen_on_fds(); - } + if (wm_fd >= 0) { + TimerSet(NULL, 0, 1, add_client_fd, NULL); + AddCallback(&SelectionCallback, wm_selection_callback, NULL); + } else if (listen_fd_count > 0) { + listen_on_fds(); } }