From f5126c664c783b22a613322525f1debdcb40fc85 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 19 Oct 2022 11:28:33 +0530 Subject: [PATCH] Wayland KDE: Fix abort when pasting into Firefox Dunno why kwin uses drag and drop callbacks when pasting into Firefox on Wayland, but then this is Wayland, so every stupid thing imaginable will be done at least once. Fixes #5603 --- docs/changelog.rst | 2 ++ glfw/wl_window.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 8576b85db..8ae854931 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -40,6 +40,8 @@ Detailed list of changes - Fix a regression in the previous release that caused a :opt:`resize_draw_strategy` of ``static`` to not work (:iss:`5601`) +- Wayland KDE: Fix abort when pasting into Firefox (:iss:`5603`) + 0.26.4 [2022-10-17] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 95eca536a..0f3de081e 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -1691,9 +1691,18 @@ static void primary_selection_source_canceled(void *data UNUSED, struct zwp_prim zwp_primary_selection_source_v1_destroy(primary_selection_source); } +// KWin aborts if we don't define these even though they are not used for copy/paste +static void dummy_data_source_target(void* data UNUSED, struct wl_data_source* wl_data_source UNUSED, const char* mime_type UNUSED) { +} + +static void dummy_data_source_action(void* data UNUSED, struct wl_data_source* wl_data_source UNUSED, uint dnd_action UNUSED) { +} + static const struct wl_data_source_listener data_source_listener = { .send = _glfwSendClipboardText, .cancelled = data_source_canceled, + .target = dummy_data_source_target, + .action = dummy_data_source_action, }; static const struct zwp_primary_selection_source_v1_listener primary_selection_source_listener = {