mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-08-26 13:29:31 +08:00
Merge branch 'slint-client' of https://github.com/kunkundi/crossdesk into slint-client
This commit is contained in:
@@ -56,6 +56,12 @@ bool CursorStateProvider::Sample(CursorState* state) {
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
|
||||
// X11/X.h defines CursorShape as a protocol request opcode, which conflicts
|
||||
// with CrossDesk's CursorShape enum.
|
||||
#ifdef CursorShape
|
||||
#undef CursorShape
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <string>
|
||||
@@ -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);
|
||||
|
||||
+1
-1
Submodule submodules/minirtc updated: d0a78e8bf9...3aa5fa5ed0
Reference in New Issue
Block a user