wayland: Add null check for cursor shape device (#145)

Fixes segmentation fault when running on Wayland compositors that don't support the cursor_shape_v1 protocol (e.g., Wayfire).

The crash occurs in the pointer enter event handler when attempting to call m_pCursorShapeDevice->sendSetShape() without checking if the device was successfully initialized. On compositors without cursor_shape_v1 support, m_pCursorShapeDevice remains null, leading to a null pointer dereference.
This commit is contained in:
Pavel Khromov 2025-10-31 16:03:31 +01:00 committed by GitHub
parent cd7ba93fad
commit b645b892b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -630,6 +630,7 @@ void CHyprpicker::initMouse() {
}
}
if (m_pCursorShapeDevice)
m_pCursorShapeDevice->sendSetShape(serial, WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR);
markDirty();