From 7523a7a43782728f5bb0ad8d6b8232a8a704b0cd Mon Sep 17 00:00:00 2001 From: apricotbucket28 <71973804+apricotbucket28@users.noreply.github.com> Date: Thu, 22 Aug 2024 18:42:32 -0300 Subject: [PATCH] wayland: Do not reset clipboard data offer on keyboard leave (#16126) Closes #14415 (also removed an unused serial while I was at it) Release Notes: - Linux: Fixed cross-window copy/paste not working in some Wayland configurations. --- crates/gpui/src/platform/linux/wayland/client.rs | 7 +------ crates/gpui/src/platform/linux/wayland/serial.rs | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/crates/gpui/src/platform/linux/wayland/client.rs b/crates/gpui/src/platform/linux/wayland/client.rs index 5e6ede0c92719b9a7b9a97d24dd1c0f81f82f1e3..0bff0a310e10f069468e648095b7c1a040e74d6c 100644 --- a/crates/gpui/src/platform/linux/wayland/client.rs +++ b/crates/gpui/src/platform/linux/wayland/client.rs @@ -1110,10 +1110,7 @@ impl Dispatch for WaylandClientStatePtr { state.keymap_state = Some(xkb::State::new(&keymap)); state.compose_state = get_xkb_compose_state(&xkb_context); } - wl_keyboard::Event::Enter { - serial, surface, .. - } => { - state.serial_tracker.update(SerialKind::KeyEnter, serial); + wl_keyboard::Event::Enter { surface, .. } => { state.keyboard_focused_window = get_window(&mut state, &surface.id()); state.enter_token = Some(()); @@ -1128,8 +1125,6 @@ impl Dispatch for WaylandClientStatePtr { state.enter_token.take(); // Prevent keyboard events from repeating after opening e.g. a file chooser and closing it quickly state.repeat.current_id += 1; - state.clipboard.set_offer(None); - state.clipboard.set_primary_offer(None); if let Some(window) = keyboard_focused_window { if let Some(ref mut compose) = state.compose_state { diff --git a/crates/gpui/src/platform/linux/wayland/serial.rs b/crates/gpui/src/platform/linux/wayland/serial.rs index 5ac73dcd226f1c9b26163dba2b6051904af0a539..eadc7a9ca97c6f3c78f8a5609deb27e891e52949 100644 --- a/crates/gpui/src/platform/linux/wayland/serial.rs +++ b/crates/gpui/src/platform/linux/wayland/serial.rs @@ -6,7 +6,6 @@ pub(crate) enum SerialKind { InputMethod, MouseEnter, MousePress, - KeyEnter, KeyPress, }