Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/x11/standalone/x11_platform.cpp
Show First 20 Lines • Show All 202 Lines • ▼ Show 20 Line(s) | 201 | case OpenGLSafePoint::PreInit: | |||
---|---|---|---|---|---|
203 | break; | 203 | break; | ||
204 | case OpenGLSafePoint::PostInit: | 204 | case OpenGLSafePoint::PostInit: | ||
205 | group.writeEntry(unsafeKey, false); | 205 | group.writeEntry(unsafeKey, false); | ||
206 | break; | 206 | break; | ||
207 | } | 207 | } | ||
208 | group.sync(); | 208 | group.sync(); | ||
209 | } | 209 | } | ||
210 | 210 | | |||
211 | PlatformCursorImage X11StandalonePlatform::cursorImage() const | ||||
212 | { | ||||
213 | auto c = kwinApp()->x11Connection(); | ||||
214 | QScopedPointer<xcb_xfixes_get_cursor_image_reply_t, QScopedPointerPodDeleter> cursor( | ||||
215 | xcb_xfixes_get_cursor_image_reply(c, | ||||
216 | xcb_xfixes_get_cursor_image_unchecked(c), | ||||
217 | nullptr)); | ||||
218 | if (cursor.isNull()) { | ||||
219 | return PlatformCursorImage(); | ||||
220 | } | ||||
221 | | ||||
222 | QImage qcursorimg((uchar *) xcb_xfixes_get_cursor_image_cursor_image(cursor.data()), cursor->width, cursor->height, | ||||
223 | QImage::Format_ARGB32_Premultiplied); | ||||
224 | // deep copy of image as the data is going to be freed | ||||
225 | return PlatformCursorImage(qcursorimg.copy(), QPoint(cursor->xhot, cursor->yhot)); | ||||
226 | } | ||||
227 | | ||||
211 | } | 228 | } |