summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-10-22 05:29:10 +0000
committerMatthias Clasen <mclasen@redhat.com>2019-10-22 05:29:10 +0000
commite4049d42a57a50133ff37183014cf54f21e4b8c1 (patch)
tree17de0c36179427ea01a11a36c016a9329fbc4584
parentce5e97f720947e304b188b5edc33fc3c727e730e (diff)
parent7a891eeb6def29f6562a3833c272b0cb2a67ae23 (diff)
downloadgtk+-e4049d42a57a50133ff37183014cf54f21e4b8c1.tar.gz
Merge branch 'wip/carlosg/avoid-selection-clear' into 'gtk-3-24'
Avoid clearing selection on wl_data_source.cancelled See merge request GNOME/gtk!1142
-rw-r--r--gdk/wayland/gdkselection-wayland.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/gdk/wayland/gdkselection-wayland.c b/gdk/wayland/gdkselection-wayland.c
index cb799e53e0..e14f50de8d 100644
--- a/gdk/wayland/gdkselection-wayland.c
+++ b/gdk/wayland/gdkselection-wayland.c
@@ -937,7 +937,6 @@ data_source_cancelled (void *data,
gdk_drag_context_cancel (context, GDK_DRAG_CANCEL_ERROR);
emit_selection_clear (display, atom);
- gdk_selection_owner_set (NULL, atom, GDK_CURRENT_TIME, TRUE);
gdk_wayland_selection_unset_data_source (display, atom);
}
@@ -1048,7 +1047,6 @@ primary_source_cancelled (void *data,
atom = atoms[ATOM_PRIMARY];
emit_selection_clear (display, atom);
- gdk_selection_owner_set (NULL, atom, GDK_CURRENT_TIME, TRUE);
gdk_wayland_selection_unset_data_source (display, atom);
}
@@ -1140,10 +1138,6 @@ gdk_wayland_selection_unset_data_source (GdkDisplay *display,
if (selection == atoms[ATOM_CLIPBOARD])
{
- GdkSeat *seat = gdk_display_get_default_seat (display);
-
- gdk_wayland_seat_set_selection (seat, NULL);
-
if (wayland_selection->clipboard_source)
{
wl_data_source_destroy (wayland_selection->clipboard_source);
@@ -1152,10 +1146,6 @@ gdk_wayland_selection_unset_data_source (GdkDisplay *display,
}
else if (selection == atoms[ATOM_PRIMARY])
{
- GdkSeat *seat = gdk_display_get_default_seat (display);
-
- gdk_wayland_seat_set_primary (seat, NULL);
-
if (wayland_selection->primary_source)
{
gtk_primary_selection_source_destroy (wayland_selection->primary_source);
@@ -1192,19 +1182,26 @@ _gdk_wayland_display_set_selection_owner (GdkDisplay *display,
gboolean send_event)
{
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
+ GdkSeat *seat = gdk_display_get_default_seat (display);
if (selection == atoms[ATOM_CLIPBOARD])
{
wayland_selection->clipboard_owner = owner;
if (send_event && !owner)
- gdk_wayland_selection_unset_data_source (display, selection);
+ {
+ gdk_wayland_seat_set_selection (seat, NULL);
+ gdk_wayland_selection_unset_data_source (display, selection);
+ }
return TRUE;
}
else if (selection == atoms[ATOM_PRIMARY])
{
wayland_selection->primary_owner = owner;
if (send_event && !owner)
- gdk_wayland_selection_unset_data_source (display, selection);
+ {
+ gdk_wayland_seat_set_primary (seat, NULL);
+ gdk_wayland_selection_unset_data_source (display, selection);
+ }
return TRUE;
}
else if (selection == atoms[ATOM_DND])