linux: Fix cursor-related panic on Wayland (#29060)
This fixes the panic that happened in debug builds in Wayland when focusing/defocusing window in the edit mode: ``` "Thread "main" panicked with "CursorStyle::None should be handled separately in the client" at crates/gpui/src/platform/linux/wayland.rs:40:17" ``` Full log: [stacktrace.txt](https://github.com/user-attachments/files/19814411/stacktrace.txt) @smitbarmase, you seem to have worked on this code. Tagging you for visibility :) Release Notes: - N/A
This commit is contained in:
parent
c585dbd8ff
commit
4405ed04d0
1 changed files with 7 additions and 1 deletions
|
@ -1498,7 +1498,13 @@ impl Dispatch<wl_pointer::WlPointer, ()> for WaylandClientStatePtr {
|
|||
state.enter_token = None;
|
||||
}
|
||||
if let Some(style) = state.cursor_style {
|
||||
if let Some(cursor_shape_device) = &state.cursor_shape_device {
|
||||
if let CursorStyle::None = style {
|
||||
let wl_pointer = state
|
||||
.wl_pointer
|
||||
.clone()
|
||||
.expect("window is focused by pointer");
|
||||
wl_pointer.set_cursor(serial, None, 0, 0);
|
||||
} else if let Some(cursor_shape_device) = &state.cursor_shape_device {
|
||||
cursor_shape_device.set_shape(serial, style.to_shape());
|
||||
} else {
|
||||
let scale = window.primary_output_scale();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue