# HG changeset patch # User Paper # Date 1713827466 14400 # Node ID a796e97cc86d7e228550578f0ceeccd03ae3dfc6 # Parent ec0a2b5493f8f1f8953e5bf78bfb82471fab7e9e dep/animone: x11: correctly check for connection failure if there's no X server running then the previous code segfaults(!) diff -r ec0a2b5493f8 -r a796e97cc86d dep/animone/src/win/x11.cc --- a/dep/animone/src/win/x11.cc Mon Apr 22 19:10:28 2024 -0400 +++ b/dep/animone/src/win/x11.cc Mon Apr 22 19:11:06 2024 -0400 @@ -11,6 +11,7 @@ #include #include #include +#include #include @@ -156,7 +157,7 @@ return false; xcb_connection_t* connection = ::xcb_connect(NULL, NULL); - if (!connection) + if (xcb_connection_has_error(connection)) return false; std::set windows; @@ -168,7 +169,7 @@ roots.push_back(iter.data->root); } - if (!GetAllTopLevelWindowsEWMH(connection, roots, windows)) + //if (!GetAllTopLevelWindowsEWMH(connection, roots, windows)) GetAllTopLevelWindowsICCCM(connection, roots, windows); }