mutter/0004-wayland-Emit-wl-primary-offer-after-changing-selecti.patch
Adam Williamson 751740e9bf Backport multiple fixes for F31 FE/blocker bugs
MR #832 for #1749433 (also needs change in gnome-shell)
MR #840 for #1760254
MR #848 for #1751646 and #1759644
MR #842 for #1758873
2019-10-12 08:52:31 -07:00

98 lines
3.6 KiB
Diff

From e53db92a7b65e450594a72076386c597548681b1 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Fri, 11 Oct 2019 12:27:56 +0200
Subject: [PATCH 4/8] wayland: Emit wl/primary offer after changing selection
We are still poking the mimetypes from the previous selection when creating
the new offer. This may come out wrong between changes of the copied
mimetypes.
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/789
---
src/wayland/meta-wayland-data-device.c | 48 +++++++++++++-------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 7948fe912..24e97222a 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -1660,18 +1660,6 @@ meta_wayland_data_device_set_selection (MetaWaylandDataDevice *data_device,
data_device->selection_data_source = source;
data_device->selection_serial = serial;
- focus_client = meta_wayland_keyboard_get_focus_client (seat->keyboard);
- if (focus_client)
- {
- data_device_resource = wl_resource_find_for_client (&data_device->resource_list, focus_client);
- if (data_device_resource)
- {
- struct wl_resource *offer;
- offer = create_and_send_clipboard_offer (data_device, data_device_resource);
- wl_data_device_send_selection (data_device_resource, offer);
- }
- }
-
if (source)
{
MetaWaylandDataSourceWayland *source_wayland =
@@ -1700,6 +1688,18 @@ meta_wayland_data_device_set_selection (MetaWaylandDataDevice *data_device,
unset_selection_source (data_device, META_SELECTION_CLIPBOARD);
}
+ focus_client = meta_wayland_keyboard_get_focus_client (seat->keyboard);
+ if (focus_client)
+ {
+ data_device_resource = wl_resource_find_for_client (&data_device->resource_list, focus_client);
+ if (data_device_resource)
+ {
+ struct wl_resource *offer;
+ offer = create_and_send_clipboard_offer (data_device, data_device_resource);
+ wl_data_device_send_selection (data_device_resource, offer);
+ }
+ }
+
wl_signal_emit (&data_device->selection_ownership_signal, source);
}
@@ -1800,18 +1800,6 @@ meta_wayland_data_device_set_primary (MetaWaylandDataDevice *data_device,
data_device->primary_data_source = source;
data_device->primary_serial = serial;
- focus_client = meta_wayland_keyboard_get_focus_client (seat->keyboard);
- if (focus_client)
- {
- data_device_resource = wl_resource_find_for_client (&data_device->primary_resource_list, focus_client);
- if (data_device_resource)
- {
- struct wl_resource *offer;
- offer = create_and_send_primary_offer (data_device, data_device_resource);
- gtk_primary_selection_device_send_selection (data_device_resource, offer);
- }
- }
-
if (source)
{
MetaSelectionSource *selection_source;
@@ -1838,6 +1826,18 @@ meta_wayland_data_device_set_primary (MetaWaylandDataDevice *data_device,
unset_selection_source (data_device, META_SELECTION_PRIMARY);
}
+ focus_client = meta_wayland_keyboard_get_focus_client (seat->keyboard);
+ if (focus_client)
+ {
+ data_device_resource = wl_resource_find_for_client (&data_device->primary_resource_list, focus_client);
+ if (data_device_resource)
+ {
+ struct wl_resource *offer;
+ offer = create_and_send_primary_offer (data_device, data_device_resource);
+ gtk_primary_selection_device_send_selection (data_device_resource, offer);
+ }
+ }
+
wl_signal_emit (&data_device->primary_ownership_signal, source);
}
--
2.23.0