diff --git a/src/gui/runtime/cursor_state_provider.cpp b/src/gui/runtime/cursor_state_provider.cpp index c55b322..aaeb2bd 100644 --- a/src/gui/runtime/cursor_state_provider.cpp +++ b/src/gui/runtime/cursor_state_provider.cpp @@ -56,6 +56,12 @@ bool CursorStateProvider::Sample(CursorState* state) { #include #include +// X11/X.h defines CursorShape as a protocol request opcode, which conflicts +// with CrossDesk's CursorShape enum. +#ifdef CursorShape +#undef CursorShape +#endif + #include #include #include @@ -158,17 +164,10 @@ CursorStateProvider::~CursorStateProvider() = default; bool CursorStateProvider::Sample(CursorState* state) { if (!state || !impl_ || !impl_->display) return false; - XFixesCursorImage* image = XFixesGetCursorImageAndName(impl_->display); + XFixesCursorImage* image = XFixesGetCursorImage(impl_->display); if (!image) return false; - std::string name; - if (image->atom != None) { - char* atom_name = XGetAtomName(impl_->display, image->atom); - if (atom_name) { - name = atom_name; - XFree(atom_name); - } - } + const std::string name = image->name ? image->name : ""; state->seq = 0; state->visible = CursorHasVisiblePixel(*image);