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()