From 0a6f7feeca328250d340c32931af7e4e371d4b4f Mon Sep 17 00:00:00 2001 From: Hayodea Hakol Date: Tue, 14 Jan 2025 16:50:37 -0400 Subject: [PATCH] xcbXorg: Now properly connects to requested display *AND* screen We append the desired screen number to the connection string. --- senseApis/xcbXorg/xcbXorg.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/senseApis/xcbXorg/xcbXorg.cpp b/senseApis/xcbXorg/xcbXorg.cpp index 79841d3..052be38 100644 --- a/senseApis/xcbXorg/xcbXorg.cpp +++ b/senseApis/xcbXorg/xcbXorg.cpp @@ -38,10 +38,11 @@ struct XcbConnection , connectionIdentifier(id) , refCount(0) { - // Convert display number to X display string format (e.g., ":0") - std::string displayString = ":" + std::to_string(id.display); - int screenNum; + // Convert to X display string format (e.g., ":0.1") + std::string displayString = ":" + std::to_string(id.display) + + "." + std::to_string(id.screen); + int screenNum; connection.reset(xcb_connect(displayString.c_str(), &screenNum)); if (xcb_connection_has_error(connection.get())) {