mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2025-12-20 00:10:02 +01:00
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:
parent
cd7ba93fad
commit
b645b892b1
1 changed files with 2 additions and 1 deletions
|
|
@ -630,7 +630,8 @@ void CHyprpicker::initMouse() {
|
|||
}
|
||||
}
|
||||
|
||||
m_pCursorShapeDevice->sendSetShape(serial, WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR);
|
||||
if (m_pCursorShapeDevice)
|
||||
m_pCursorShapeDevice->sendSetShape(serial, WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR);
|
||||
|
||||
markDirty();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue