From f1ce1ab19c67e314f5421e70d1bf56ee068efc80 Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Mon, 29 Sep 2025 12:19:03 -0400 Subject: [PATCH] xcbWindow: Callback w/early ret if window not found --- senseApis/xcbWindow/xcbWindow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/senseApis/xcbWindow/xcbWindow.cpp b/senseApis/xcbWindow/xcbWindow.cpp index 70b92b6..6167096 100644 --- a/senseApis/xcbWindow/xcbWindow.cpp +++ b/senseApis/xcbWindow/xcbWindow.cpp @@ -283,8 +283,15 @@ static void xcbWindow_attachDeviceReq( // Not used yet, but may be used later. (void)componentThread; - g_attachedWindows.emplace_back( - std::make_unique(desc)); + try { + g_attachedWindows.emplace_back( + std::make_unique(desc)); + } catch (const std::exception& exc) { + std::cerr << __func__ << ": Exception while attaching X11 window: " + << exc.what() << "\n"; + cb.callbackFn(false, desc); + return; + } std::cout << __func__ << ": Attached X11 window:\n " << g_attachedWindows.back()->stringify()