From 6c76d6ada539c179c00bd6ec0f21138abdb830dd Mon Sep 17 00:00:00 2001 From: vmfortress Date: Mon, 7 Mar 2022 13:43:59 -0500 Subject: [PATCH] [host] xcb: fixed early start of pointer thread by adding xcb_start --- host/platform/Linux/capture/XCB/src/xcb.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/host/platform/Linux/capture/XCB/src/xcb.c b/host/platform/Linux/capture/XCB/src/xcb.c index e39b8595..3ee492b7 100644 --- a/host/platform/Linux/capture/XCB/src/xcb.c +++ b/host/platform/Linux/capture/XCB/src/xcb.c @@ -174,13 +174,6 @@ static bool xcb_init(void) } free(version_reply); - if (!lgCreateThread("XCBPointer", pointerThread, NULL, &this->pointerThread)) - { - DEBUG_ERROR("Failed to create the XCBPointer thread"); - xcb_deinit(); - return false; - } - this->initialized = true; return true; fail: @@ -188,6 +181,19 @@ fail: return false; } +static bool xcb_start(void) +{ + this->stop = false; + + if (!lgCreateThread("XCBPointer", pointerThread, NULL, &this->pointerThread)) + { + DEBUG_ERROR("Failed to create the XCBPointer thread"); + return false; + } + + return true; +} + static void xcb_stop(void) { this->stop = true; @@ -375,6 +381,7 @@ struct CaptureInterface Capture_XCB = .getName = xcb_getName, .create = xcb_create, .init = xcb_init, + .start = xcb_start, .stop = xcb_stop, .deinit = xcb_deinit, .free = xcb_free,