From 474dd2ba0c281f8a4d19264d67d8a22e5e543ac3653091899ac5957c6db8981f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Fri, 23 Sep 2022 13:08:11 +0000 Subject: [PATCH 1/2] Accepting request 1005583 from home:fusionfuture:branches:openSUSE:Factory - Fix unstable drag-and-drop on Wayland KDE (https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5045) * gtk3-gdkwayland-Update-selections-offer-before-updating-dnd.patch OBS-URL: https://build.opensuse.org/request/show/1005583 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gtk3?expand=0&rev=422 --- ...selections-offer-before-updating-dnd.patch | 52 +++++++++++++++++++ gtk3.changes | 7 +++ gtk3.spec | 3 ++ 3 files changed, 62 insertions(+) create mode 100644 gtk3-gdkwayland-Update-selections-offer-before-updating-dnd.patch diff --git a/gtk3-gdkwayland-Update-selections-offer-before-updating-dnd.patch b/gtk3-gdkwayland-Update-selections-offer-before-updating-dnd.patch new file mode 100644 index 0000000..c1870fa --- /dev/null +++ b/gtk3-gdkwayland-Update-selections-offer-before-updating-dnd.patch @@ -0,0 +1,52 @@ +From 965aa2e65f1c25113472f06b6662b0b69d724605 Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii +Date: Fri, 23 Sep 2022 10:39:41 +0300 +Subject: [PATCH] gdk/wayland: Update selection's offer before updating dnd + targets + +gdk_wayland_drop_context_update_targets gets targets from the +selection's offer. In order to ensure that the drop context has +up-to-date targets, update the selection's offer before updating +targets. + +This fixes drag-and-drop not working reliably when running Firefox in +Plasma Wayland session. +--- + gdk/wayland/gdkdevice-wayland.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c +index ed6ad3b138..a3d464be22 100644 +--- a/gdk/wayland/gdkdevice-wayland.c ++++ b/gdk/wayland/gdkdevice-wayland.c +@@ -1188,14 +1188,16 @@ data_device_enter (void *data, + seat->pointer_info.surface_x = wl_fixed_to_double (x); + seat->pointer_info.surface_y = wl_fixed_to_double (y); + +- gdk_wayland_drop_context_update_targets (seat->drop_context); +- + selection = gdk_drag_get_selection (seat->drop_context); + dnd_owner = gdk_selection_owner_get_for_display (seat->display, selection); + + if (!dnd_owner) + dnd_owner = seat->foreign_dnd_window; + ++ gdk_wayland_selection_set_offer (seat->display, selection, offer); ++ ++ gdk_wayland_drop_context_update_targets (seat->drop_context); ++ + _gdk_wayland_drag_context_set_source_window (seat->drop_context, dnd_owner); + + _gdk_wayland_drag_context_set_dest_window (seat->drop_context, +@@ -1206,8 +1208,6 @@ data_device_enter (void *data, + _gdk_wayland_drag_context_emit_event (seat->drop_context, GDK_DRAG_ENTER, + GDK_CURRENT_TIME); + +- gdk_wayland_selection_set_offer (seat->display, selection, offer); +- + emit_selection_owner_change (dest_window, selection); + } + +-- +GitLab + diff --git a/gtk3.changes b/gtk3.changes index f5f0a12..4e9f6d4 100644 --- a/gtk3.changes +++ b/gtk3.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Sep 23 09:30:34 UTC 2022 - Fusion Future + +- Fix unstable drag-and-drop on Wayland KDE + (https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5045) + * gtk3-gdkwayland-Update-selections-offer-before-updating-dnd.patch + ------------------------------------------------------------------- Thu Sep 1 10:27:46 UTC 2022 - Bjørn Lie diff --git a/gtk3.spec b/gtk3.spec index 4acaf8c..609fcef 100644 --- a/gtk3.spec +++ b/gtk3.spec @@ -47,6 +47,8 @@ Source99: baselibs.conf Patch0: gtk3-GTK_PATH64.patch # PATCH-FIX-OPENSUSE gtk3-revert-forced-xftdpi.patch fvogt@opensuse.org -- Revert very controversal commit on GTK3, forcing DPI to 96 Patch1: gtk3-revert-forced-xftdpi.patch +# PATCH-FIX-UPSTREAM Fix unstable drag&drop on Wayland KDE https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5045 +Patch2: gtk3-gdkwayland-Update-selections-offer-before-updating-dnd.patch BuildRequires: cups-devel >= 1.7 BuildRequires: docbook-xsl-stylesheets @@ -387,6 +389,7 @@ cp -a %{SOURCE1} . %patch0 -p1 %endif %patch1 -p1 +%patch2 -p1 %build NOCONFIGURE=1 ./autogen.sh From 03038817c78de7863787c0fff2907dd7a24c7983c9e1f48a3345097384b826a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Fri, 23 Sep 2022 13:13:08 +0000 Subject: [PATCH 2/2] Tweak OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gtk3?expand=0&rev=423 --- gtk3.changes | 4 ++-- gtk3.spec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk3.changes b/gtk3.changes index 4e9f6d4..a1b391f 100644 --- a/gtk3.changes +++ b/gtk3.changes @@ -1,9 +1,9 @@ ------------------------------------------------------------------- Fri Sep 23 09:30:34 UTC 2022 - Fusion Future -- Fix unstable drag-and-drop on Wayland KDE - (https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5045) +- Fix unstable drag-and-drop on Wayland KDE, add: * gtk3-gdkwayland-Update-selections-offer-before-updating-dnd.patch + https://gitlab.gnome.org/GNOME/gtk/-/commit/56100ab4 ------------------------------------------------------------------- Thu Sep 1 10:27:46 UTC 2022 - Bjørn Lie diff --git a/gtk3.spec b/gtk3.spec index 609fcef..bff305d 100644 --- a/gtk3.spec +++ b/gtk3.spec @@ -47,7 +47,7 @@ Source99: baselibs.conf Patch0: gtk3-GTK_PATH64.patch # PATCH-FIX-OPENSUSE gtk3-revert-forced-xftdpi.patch fvogt@opensuse.org -- Revert very controversal commit on GTK3, forcing DPI to 96 Patch1: gtk3-revert-forced-xftdpi.patch -# PATCH-FIX-UPSTREAM Fix unstable drag&drop on Wayland KDE https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5045 +# PATCH-FIX-UPSTREAM gtk3-gdkwayland-Update-selections-offer-before-updating-dnd.patch -- Fix unstable drag&drop on Wayland Patch2: gtk3-gdkwayland-Update-selections-offer-before-updating-dnd.patch BuildRequires: cups-devel >= 1.7