10#include <QtGui/QWindow>
11#include <QtGui/QBitmap>
12#include <QtGui/private/qguiapplication_p.h>
14#if QT_CONFIG(xcb_xlib)
15#include <X11/cursorfont.h>
20#include <xcb/xfixes.h>
21#include <xcb/xcb_image.h>
33 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
34 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
38 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f,
39 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xf0, 0x0f,
40 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00 };
42 0x00, 0x00, 0x80, 0x03, 0xc0, 0x07, 0xe0, 0x0f, 0xf0, 0x1f, 0xf8, 0x3f,
43 0xfc, 0x7f, 0xc0, 0x07, 0xc0, 0x07, 0xc0, 0x07, 0xfc, 0x7f, 0xf8, 0x3f,
44 0xf0, 0x1f, 0xe0, 0x0f, 0xc0, 0x07, 0x80, 0x03 };
46 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x08, 0x30, 0x18,
47 0x38, 0x38, 0xfc, 0x7f, 0xfc, 0x7f, 0x38, 0x38, 0x30, 0x18, 0x20, 0x08,
48 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
50 0x00, 0x00, 0x00, 0x00, 0x40, 0x04, 0x60, 0x0c, 0x70, 0x1c, 0x78, 0x3c,
51 0xfc, 0x7f, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfc, 0x7f, 0x78, 0x3c,
52 0x70, 0x1c, 0x60, 0x0c, 0x40, 0x04, 0x00, 0x00 };
54 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x3e, 0x00, 0x3c, 0x00, 0x3e,
55 0x00, 0x37, 0x88, 0x23, 0xd8, 0x01, 0xf8, 0x00, 0x78, 0x00, 0xf8, 0x00,
56 0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
58 0x00, 0x00, 0xc0, 0x7f, 0x80, 0x7f, 0x00, 0x7f, 0x00, 0x7e, 0x04, 0x7f,
59 0x8c, 0x7f, 0xdc, 0x77, 0xfc, 0x63, 0xfc, 0x41, 0xfc, 0x00, 0xfc, 0x01,
60 0xfc, 0x03, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00 };
62 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0xf8, 0x00, 0x78, 0x00,
63 0xf8, 0x00, 0xd8, 0x01, 0x88, 0x23, 0x00, 0x37, 0x00, 0x3e, 0x00, 0x3c,
64 0x00, 0x3e, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00 };
66 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xfc, 0x03, 0xfc, 0x01, 0xfc, 0x00,
67 0xfc, 0x41, 0xfc, 0x63, 0xdc, 0x77, 0x8c, 0x7f, 0x04, 0x7f, 0x00, 0x7e,
68 0x00, 0x7f, 0x80, 0x7f, 0xc0, 0x7f, 0x00, 0x00 };
75 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
76 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
77 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00,
78 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
79 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00,
80 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00,
81 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
82 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00,
83 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
84 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
85 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
87 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
88 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
89 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xf0, 0x07, 0x00,
90 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
91 0x00, 0xc0, 0x01, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00,
92 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00,
93 0x80, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
94 0x00, 0xc0, 0x01, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf0, 0x07, 0x00,
95 0x00, 0xe0, 0x03, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00,
96 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
97 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
99 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
100 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
101 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
102 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
103 0x00, 0x41, 0x82, 0x00, 0x80, 0x41, 0x82, 0x01, 0xc0, 0x7f, 0xfe, 0x03,
104 0x80, 0x41, 0x82, 0x01, 0x00, 0x41, 0x82, 0x00, 0x00, 0x40, 0x02, 0x00,
105 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
106 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
107 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
108 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
109 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
111 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
112 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
113 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
114 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe2, 0x47, 0x00, 0x00, 0xe3, 0xc7, 0x00,
115 0x80, 0xe3, 0xc7, 0x01, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07,
116 0xc0, 0xff, 0xff, 0x03, 0x80, 0xe3, 0xc7, 0x01, 0x00, 0xe3, 0xc7, 0x00,
117 0x00, 0xe2, 0x47, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
118 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
119 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
120 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
121 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
123 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0xf0, 0x07, 0x00,
124 0x09, 0x18, 0x0e, 0x00, 0x11, 0x1c, 0x0e, 0x00, 0x21, 0x1c, 0x0e, 0x00,
125 0x41, 0x1c, 0x0e, 0x00, 0x81, 0x1c, 0x0e, 0x00, 0x01, 0x01, 0x07, 0x00,
126 0x01, 0x82, 0x03, 0x00, 0xc1, 0xc7, 0x01, 0x00, 0x49, 0xc0, 0x01, 0x00,
127 0x95, 0xc0, 0x01, 0x00, 0x93, 0xc0, 0x01, 0x00, 0x21, 0x01, 0x00, 0x00,
128 0x20, 0xc1, 0x01, 0x00, 0x40, 0xc2, 0x01, 0x00, 0x40, 0x02, 0x00, 0x00,
129 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
130 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
131 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
132 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
133 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
135 0x01, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x07, 0x00, 0x07, 0xf8, 0x0f, 0x00,
136 0x0f, 0xfc, 0x1f, 0x00, 0x1f, 0x3e, 0x1f, 0x00, 0x3f, 0x3e, 0x1f, 0x00,
137 0x7f, 0x3e, 0x1f, 0x00, 0xff, 0x3e, 0x1f, 0x00, 0xff, 0x9d, 0x0f, 0x00,
138 0xff, 0xc3, 0x07, 0x00, 0xff, 0xe7, 0x03, 0x00, 0x7f, 0xe0, 0x03, 0x00,
139 0xf7, 0xe0, 0x03, 0x00, 0xf3, 0xe0, 0x03, 0x00, 0xe1, 0xe1, 0x03, 0x00,
140 0xe0, 0xe1, 0x03, 0x00, 0xc0, 0xe3, 0x03, 0x00, 0xc0, 0xe3, 0x03, 0x00,
141 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
142 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
143 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
144 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
145 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
147 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
148 0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
149 0x41, 0xe0, 0xff, 0x00, 0x81, 0x20, 0x80, 0x00, 0x01, 0xe1, 0xff, 0x00,
150 0x01, 0x42, 0x40, 0x00, 0xc1, 0x47, 0x40, 0x00, 0x49, 0x40, 0x55, 0x00,
151 0x95, 0x80, 0x2a, 0x00, 0x93, 0x00, 0x15, 0x00, 0x21, 0x01, 0x0a, 0x00,
152 0x20, 0x01, 0x11, 0x00, 0x40, 0x82, 0x20, 0x00, 0x40, 0x42, 0x44, 0x00,
153 0x80, 0x41, 0x4a, 0x00, 0x00, 0x40, 0x55, 0x00, 0x00, 0xe0, 0xff, 0x00,
154 0x00, 0x20, 0x80, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
155 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
156 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
157 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
159 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
160 0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,
161 0x7f, 0xe0, 0xff, 0x00, 0xff, 0xe0, 0xff, 0x00, 0xff, 0xe1, 0xff, 0x00,
162 0xff, 0xc3, 0x7f, 0x00, 0xff, 0xc7, 0x7f, 0x00, 0x7f, 0xc0, 0x7f, 0x00,
163 0xf7, 0x80, 0x3f, 0x00, 0xf3, 0x00, 0x1f, 0x00, 0xe1, 0x01, 0x0e, 0x00,
164 0xe0, 0x01, 0x1f, 0x00, 0xc0, 0x83, 0x3f, 0x00, 0xc0, 0xc3, 0x7f, 0x00,
165 0x80, 0xc1, 0x7f, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0xe0, 0xff, 0x00,
166 0x00, 0xe0, 0xff, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
167 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
168 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
169 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
177 0x00,0x00,0x00,0x80,0x1f,0x00,0xe0,0x7f,0x00,0xf0,0xf0,0x00,0x38,0xc0,0x01,
178 0x7c,0x80,0x03,0xec,0x00,0x03,0xce,0x01,0x07,0x86,0x03,0x06,0x06,0x07,0x06,
179 0x06,0x0e,0x06,0x06,0x1c,0x06,0x0e,0x38,0x07,0x0c,0x70,0x03,0x1c,0xe0,0x03,
180 0x38,0xc0,0x01,0xf0,0xe0,0x00,0xe0,0x7f,0x00,0x80,0x1f,0x00,0x00,0x00,0x00 };
183 0x80,0x1f,0x00,0xe0,0x7f,0x00,0xf0,0xff,0x00,0xf8,0xff,0x01,0xfc,0xf0,0x03,
184 0xfe,0xc0,0x07,0xfe,0x81,0x07,0xff,0x83,0x0f,0xcf,0x07,0x0f,0x8f,0x0f,0x0f,
185 0x0f,0x1f,0x0f,0x0f,0x3e,0x0f,0x1f,0xfc,0x0f,0x1e,0xf8,0x07,0x3e,0xf0,0x07,
186 0xfc,0xe0,0x03,0xf8,0xff,0x01,0xf0,0xff,0x00,0xe0,0x7f,0x00,0x80,0x1f,0x00};
189 0x80,0x01,0x58,0x0e,0x64,0x12,0x64,0x52,0x48,0xb2,0x48,0x92,
190 0x16,0x90,0x19,0x80,0x11,0x40,0x02,0x40,0x04,0x40,0x04,0x20,
191 0x08,0x20,0x10,0x10,0x20,0x10,0x00,0x00};
193 0x80,0x01,0xd8,0x0f,0xfc,0x1f,0xfc,0x5f,0xf8,0xff,0xf8,0xff,
194 0xf6,0xff,0xff,0xff,0xff,0x7f,0xfe,0x7f,0xfc,0x7f,0xfc,0x3f,
195 0xf8,0x3f,0xf0,0x1f,0xe0,0x1f,0x00,0x00};
197 0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x0d,0x48,0x32,0x08,0x50,
198 0x10,0x40,0x18,0x40,0x04,0x40,0x04,0x20,0x08,0x20,0x10,0x10,
199 0x20,0x10,0x20,0x10,0x00,0x00,0x00,0x00};
201 0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x0d,0xf8,0x3f,0xf8,0x7f,
202 0xf0,0x7f,0xf8,0x7f,0xfc,0x7f,0xfc,0x3f,0xf8,0x3f,0xf0,0x1f,
203 0xe0,0x1f,0xe0,0x1f,0x00,0x00,0x00,0x00};
211 {
"left_ptr",
"default",
"top_left_arrow",
"left_arrow" },
214 {
"wait",
"watch",
"0426c94ea35c87780ff01dc239897213" },
215 {
"ibeam",
"text",
"xterm" },
216 {
"size_ver",
"ns-resize",
"v_double_arrow",
"00008160000006810000408080010102" },
217 {
"size_hor",
"ew-resize",
"h_double_arrow",
"028006030e0e7ebffc7f7070c0600140" },
218 {
"size_bdiag",
"nesw-resize",
"50585d75b494802d0151028115016902",
"fcf1c3c7cd4491d801f1e1c78f100000" },
219 {
"size_fdiag",
"nwse-resize",
"38c5dff7c7b8962045400281044508d2",
"c7088f0f3e6c8088236ef8e1e3e70000" },
222 {
"split_v",
"row-resize",
"sb_v_double_arrow",
"2870a09082c103050810ffdffffe0204",
"c07385c7190e701020ff7ffffd08103c" },
223 {
"split_h",
"col-resize",
"sb_h_double_arrow",
"043a9f68147c53184671403ffa811cc5",
"14fef782d02440884392942c11205230" },
224 {
"pointing_hand",
"pointer",
"hand1",
"e29285e634086352946a0e7090d73106" },
225 {
"forbidden",
"not-allowed",
"crossed_circle",
"circle",
"03b6e0fcb3499374a867c041f52298f0" },
226 {
"whats_this",
"help",
"question_arrow",
"5c6cd98b3f3ebcb1f9c7f1c204630408",
"d9ce0ab605698f320427677b458ad60b" },
227 {
"left_ptr_watch",
"half-busy",
"progress",
"00000000000000020006000e7e9ffc3f",
"08e8e1c95fe2fc01f976f1e063a24ccd" },
228 {
"openhand",
"grab",
"fleur",
"5aca4d189052212118709018842178c0",
"9d800788f1b08800ae810202380a0822" },
229 {
"closedhand",
"grabbing",
"208530c400c041818281048008011002" },
230 {
"dnd-copy",
"copy" },
231 {
"dnd-move",
"move" },
232 {
"dnd-link",
"link" }
236 : shape(
c.shape()), bitmapCacheKey(0), maskCacheKey(0)
239 const qint64 pixmapCacheKey =
c.pixmap().cacheKey();
240 if (pixmapCacheKey) {
267 const char *cursorStr =
"cursor";
275 if (m_callbackForPropertyRegistered) {
283 for (xcb_cursor_t
cursor : std::as_const(m_cursorHash))
284 xcb_free_cursor(conn,
cursor);
288 xcb_cursor_context_free(m_cursorContext);
294 xcb_cursor_context_free(m_cursorContext);
296 m_cursorContext =
nullptr;
299 if (xcb_cursor_context_new(conn, m_screen->
screen(), &m_cursorContext) < 0) {
300 qWarning() <<
"xcb: Could not initialize xcb-cursor";
301 m_cursorContext =
nullptr;
311 xcb_cursor_t
c = XCB_CURSOR_NONE;
321 c = createBitmapCursor(
cursor);
326 if (
it == m_cursorHash.
end()) {
327 c = createFontCursor(shape);
336 xcb_change_window_attributes(
xcb_connection(),
w->xcb_window(), XCB_CW_CURSOR, &
c);
394xcb_cursor_t QXcbCursor::createNonStandardCursor(
int cshape)
400 xcb_pixmap_t cp = xcb_create_pixmap_from_bitmap_data(conn, m_screen->
root(),
cur_blank_bits, 16, 16,
402 xcb_pixmap_t mp = xcb_create_pixmap_from_bitmap_data(conn, m_screen->
root(),
cur_blank_bits, 16, 16,
404 cursor = xcb_generate_id(conn);
405 xcb_create_cursor(conn,
cursor, cp, mp, 0, 0, 0, 0xFFFF, 0xFFFF, 0xFFFF, 8, 8);
408 xcb_pixmap_t pm = xcb_create_pixmap_from_bitmap_data(conn, m_screen->
root(),
410 16, 16, 1, 0, 0,
nullptr);
411 xcb_pixmap_t pmm = xcb_create_pixmap_from_bitmap_data(conn, m_screen->
root(),
413 16, 16, 1, 0, 0,
nullptr);
414 cursor = xcb_generate_id(conn);
415 xcb_create_cursor(conn,
cursor, pm, pmm, 0, 0, 0, 0xFFFF, 0xFFFF, 0xFFFF, 8, 8);
419 xcb_pixmap_t pm = xcb_create_pixmap_from_bitmap_data(conn, m_screen->
root(),
421 32, 32, 1, 0, 0,
nullptr);
422 xcb_pixmap_t pmm = xcb_create_pixmap_from_bitmap_data(conn, m_screen->
root(),
424 32, 32, 1, 0, 0,
nullptr);
427 cursor = xcb_generate_id(conn);
428 xcb_create_cursor(conn,
cursor, pm, pmm, 0, 0, 0, 0xFFFF, 0xFFFF, 0xFFFF, hs, hs);
431 xcb_pixmap_t pm = xcb_create_pixmap_from_bitmap_data(conn, m_screen->
root(),
433 20, 20, 1, 0, 0,
nullptr);
434 xcb_pixmap_t pmm = xcb_create_pixmap_from_bitmap_data(conn, m_screen->
root(),
436 20, 20, 1, 0, 0,
nullptr);
437 cursor = xcb_generate_id(conn);
438 xcb_create_cursor(conn,
cursor, pm, pmm, 0, 0, 0, 0xFFFF, 0xFFFF, 0xFFFF, 10, 10);
441 xcb_pixmap_t pm = xcb_create_pixmap_from_bitmap_data(conn, m_screen->
root(),
444 xcb_pixmap_t pmm = xcb_create_pixmap_from_bitmap_data(conn, m_screen->
root(),
447 cursor = xcb_generate_id(conn);
448 xcb_create_cursor(conn,
cursor, pm, pmm, 0, 0, 0, 0xFFFF, 0xFFFF, 0xFFFF, 8, 8);
452 if (!
image.isNull()) {
455 cursor = xcb_generate_id(conn);
456 xcb_create_cursor(conn,
cursor, pm, pmm, 0, 0, 0, 0xFFFF, 0xFFFF, 0xFFFF, 8, 8);
457 xcb_free_pixmap(conn, pm);
458 xcb_free_pixmap(conn, pmm);
472 self->updateContext();
475xcb_cursor_t QXcbCursor::createFontCursor(
int cshape)
477 if (!m_cursorContext)
482 xcb_cursor_t
cursor = XCB_NONE;
487 m_callbackForPropertyRegistered =
true;
492 for (
const char *cursorName :
cursorNames[cshape]) {
493 cursor = xcb_cursor_load_cursor(m_cursorContext, cursorName);
500 cursor = createNonStandardCursor(cshape);
503 if (!
cursor && cursorId) {
504 cursor = xcb_generate_id(conn);
506 cursorId, cursorId + 1,
507 0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0);
521 xcb_cursor_t
c = XCB_NONE;
526 qCWarning(lcQpaXcb,
"xrender >= 0.5 required to create pixmap cursors");
531 c = xcb_generate_id(conn);
532 xcb_create_cursor(conn,
c, cp, mp, 0, 0, 0, 0xFFFF, 0xFFFF, 0xFFFF,
534 xcb_free_pixmap(conn, cp);
535 xcb_free_pixmap(conn, mp);
552 xcb_window_t root =
c->primaryVirtualDesktop()->root();
556 if (virtualDesktop) {
557 const auto virtualDesktops =
c->virtualDesktops();
559 if (vd->root() ==
reply->root) {
560 *virtualDesktop = vd;
568 *keybMask =
reply->mask;
void setMaxCost(qsizetype m) noexcept(std::is_nothrow_destructible_v< Node >)
T * object(const Key &key) const noexcept
bool insert(const Key &key, T *object, qsizetype cost=1)
The QCursor class provides a mouse cursor with an arbitrary shape.
QBitmap bitmap() const
Returns the cursor bitmap, or a null bitmap if it is one of the standard cursors.
QPixmap pixmap() const
Returns the cursor pixmap.
Qt::CursorShape shape() const
Returns the cursor shape identifier.
QPoint hotSpot() const
Returns the cursor hot spot, or (0, 0) if it is one of the standard cursors.
QBitmap mask() const
Returns the cursor bitmap mask, or a null bitmap if it is one of the standard cursors.
static QGuiApplicationPrivate * instance()
QPixmap getPixmapCursor(Qt::CursorShape cshape)
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QImage toImage() const
Converts the pixmap to a QImage.
int depth() const
Returns the depth of the pixmap.
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
void clear()
Clears the contents of the string and makes it null.
void changeCursor(QCursor *cursor, QWindow *window) override
This method is called by Qt whenever the cursor graphic should be changed.
QPoint pos() const override
QXcbCursor(QXcbConnection *conn, QXcbScreen *screen)
static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask=nullptr)
void setPos(const QPoint &pos) override
QXcbConnection * connection() const
xcb_connection_t * xcb_connection() const
xcb_screen_t * screen() const
xcb_window_t root() const
QXcbXSettings * xSettings() const
xcb_window_t root() const
void removeCallbackForHandle(const QByteArray &property, void *handle)
void registerCallbackForProperty(const QByteArray &property, PropertyChangeFunc func, void *handle)
QSet< QString >::iterator it
Combined button and popup list for selecting options.
#define qCWarning(category,...)
GLuint64 GLenum void * handle
GLfloat GLfloat GLfloat w
[0]
GLsizei GLfixed GLfixed GLfixed GLfixed const GLubyte * bitmap
#define Q_XCB_REPLY(call,...)
static const uint8_t cur_hor_bits[]
static uint8_t cur_blank_bits[]
static const uint8_t whatsthis_bits[]
static const uint8_t cur_fdiag_bits[]
static int cursorIdForShape(int cshape)
static const uint8_t openhandm_bits[]
static const uint8_t *const cursor_bits32[]
static const uint8_t closedhand_bits[]
static const uint8_t cur_ver_bits[]
static const uint8_t whatsthism_bits[]
static const std::vector< const char * > cursorNames[]
static const uint8_t hsplit_bits[]
static const uint8_t cur_bdiag_bits[]
static const uint8_t closedhandm_bits[]
static xcb_font_t cursorFont
static const uint8_t forbidden_bits[]
static const uint8_t mcur_fdiag_bits[]
static const uint8_t vsplitm_bits[]
static const uint8_t * cursor_bits16[]
static const uint8_t mcur_ver_bits[]
static const uint8_t forbiddenm_bits[]
static const uint8_t mcur_bdiag_bits[]
static const uint8_t busy_bits[]
static const uint8_t vsplit_bits[]
static const uint8_t busym_bits[]
static const uint8_t hsplitm_bits[]
static const uint8_t *const cursor_bits20[]
static const uint8_t openhand_bits[]
static const uint8_t mcur_hor_bits[]
#define XC_bottom_right_corner
#define XC_sb_h_double_arrow
#define XC_question_arrow
#define XC_sb_v_double_arrow
#define XC_top_right_corner
xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image)
xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot)
file open(QIODevice::ReadOnly)