diff options
Diffstat (limited to 'gdk/wayland')
-rw-r--r-- | gdk/wayland/gdkdevice-wayland.c | 4 | ||||
-rw-r--r-- | gdk/wayland/gdkdisplay-wayland.c | 2 | ||||
-rw-r--r-- | gdk/wayland/gdkdnd-wayland.c | 9 | ||||
-rw-r--r-- | gdk/wayland/gdkprivate-wayland.h | 7 | ||||
-rw-r--r-- | gdk/wayland/gdkselection-wayland.c | 87 |
5 files changed, 2 insertions, 107 deletions
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index b1d0a00d26..5bd5c85f3f 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -1102,10 +1102,8 @@ data_device_enter (void *data, 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; + dnd_owner = seat->foreign_dnd_window; _gdk_wayland_drag_context_set_source_window (seat->drop_context, dnd_owner); diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c index 8403938f3b..d276cf1b59 100644 --- a/gdk/wayland/gdkdisplay-wayland.c +++ b/gdk/wayland/gdkdisplay-wayland.c @@ -1019,8 +1019,6 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class) display_class->notify_startup_complete = gdk_wayland_display_notify_startup_complete; display_class->create_window_impl = _gdk_wayland_display_create_window_impl; display_class->get_keymap = _gdk_wayland_display_get_keymap; - display_class->get_selection_owner = _gdk_wayland_display_get_selection_owner; - display_class->set_selection_owner = _gdk_wayland_display_set_selection_owner; display_class->send_selection_notify = _gdk_wayland_display_send_selection_notify; display_class->get_selection_property = _gdk_wayland_display_get_selection_property; display_class->convert_selection = _gdk_wayland_display_convert_selection; diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c index ac849741a9..34cf3f35d1 100644 --- a/gdk/wayland/gdkdnd-wayland.c +++ b/gdk/wayland/gdkdnd-wayland.c @@ -80,15 +80,6 @@ gdk_wayland_drag_context_finalize (GObject *object) if (context->is_source) { - GdkDisplay *display = gdk_window_get_display (context->source_window); - GdkAtom selection; - GdkWindow *selection_owner; - - selection = gdk_drag_get_selection (context); - selection_owner = gdk_selection_owner_get_for_display (display, selection); - if (selection_owner == context->source_window) - gdk_wayland_selection_unset_data_source (display, selection); - gdk_drag_context_set_cursor (context, NULL); } diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h index f1ec0c79c2..b35a02fb7a 100644 --- a/gdk/wayland/gdkprivate-wayland.h +++ b/gdk/wayland/gdkprivate-wayland.h @@ -129,13 +129,6 @@ void _gdk_wayland_display_create_window_impl (GdkDisplay *display, GdkEventMask event_mask, GdkWindowAttr *attributes); -GdkWindow *_gdk_wayland_display_get_selection_owner (GdkDisplay *display, - GdkAtom selection); -gboolean _gdk_wayland_display_set_selection_owner (GdkDisplay *display, - GdkWindow *owner, - GdkAtom selection, - guint32 time, - gboolean send_event); void _gdk_wayland_display_send_selection_notify (GdkDisplay *dispay, GdkWindow *requestor, GdkAtom selection, diff --git a/gdk/wayland/gdkselection-wayland.c b/gdk/wayland/gdkselection-wayland.c index b456318918..7d1b30ae2f 100644 --- a/gdk/wayland/gdkselection-wayland.c +++ b/gdk/wayland/gdkselection-wayland.c @@ -98,12 +98,10 @@ struct _GdkWaylandSelection StoredSelection stored_selection; struct wl_data_source *dnd_source; /* Owned by the GdkDragContext */ - GdkWindow *dnd_owner; }; static void selection_buffer_read (SelectionBuffer *buffer); static void async_write_data_write (AsyncWriteData *write_data); -static void emit_selection_clear (GdkDisplay *display, GdkAtom selection); static void _gdk_display_put_event (GdkDisplay *display, @@ -550,26 +548,6 @@ gdk_wayland_selection_get_targets (GdkDisplay *display, return NULL; } -static void -gdk_wayland_selection_emit_request (GdkWindow *window, - GdkAtom selection, - GdkAtom target) -{ - GdkEvent *event; - - event = gdk_event_new (GDK_SELECTION_REQUEST); - event->selection.window = g_object_ref (window); - event->selection.send_event = FALSE; - event->selection.selection = selection; - event->selection.target = target; - event->selection.property = gdk_atom_intern_static_string ("GDK_SELECTION"); - event->selection.time = GDK_CURRENT_TIME; - event->selection.requestor = g_object_ref (window); - - _gdk_display_put_event (gdk_window_get_display (window), event); - gdk_event_free (event); -} - static AsyncWriteData * async_write_data_new (GdkWaylandSelection *selection) { @@ -826,8 +804,6 @@ data_source_cancelled (void *data, if (context) 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); } @@ -856,15 +832,7 @@ data_source_dnd_finished (void *data, if (!context) return; - if (context->action == GDK_ACTION_MOVE) - { - gdk_wayland_selection_emit_request (context->source_window, - atoms[ATOM_DND], - gdk_atom_intern_static_string ("DELETE")); - } - g_signal_emit_by_name (context, "dnd-finished"); - gdk_selection_owner_set (NULL, atoms[ATOM_DND], GDK_CURRENT_TIME, TRUE); } static void @@ -907,8 +875,7 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner, if (selection == atoms[ATOM_DND]) { - if (wayland_selection->dnd_source && - (!owner || owner == wayland_selection->dnd_owner)) + if (wayland_selection->dnd_source) return wayland_selection->dnd_source; } else @@ -942,36 +909,6 @@ gdk_wayland_selection_unset_data_source (GdkDisplay *display, } } -GdkWindow * -_gdk_wayland_display_get_selection_owner (GdkDisplay *display, - GdkAtom selection) -{ - GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display); - - if (selection == atoms[ATOM_DND]) - return wayland_selection->dnd_owner; - - return NULL; -} - -gboolean -_gdk_wayland_display_set_selection_owner (GdkDisplay *display, - GdkWindow *owner, - GdkAtom selection, - guint32 time, - gboolean send_event) -{ - GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display); - - if (selection == atoms[ATOM_DND]) - { - wayland_selection->dnd_owner = owner; - return TRUE; - } - - return FALSE; -} - void _gdk_wayland_display_send_selection_notify (GdkDisplay *dispay, GdkWindow *requestor, @@ -1047,28 +984,6 @@ emit_empty_selection_notify (GdkWindow *requestor, gdk_event_free (event); } -static void -emit_selection_clear (GdkDisplay *display, - GdkAtom selection) -{ - GdkEvent *event; - GdkWindow *window; - - event = gdk_event_new (GDK_SELECTION_CLEAR); - event->selection.selection = selection; - event->selection.time = GDK_CURRENT_TIME; - - window = _gdk_wayland_display_get_selection_owner (display, selection); - if (window != NULL) - { - event->selection.window = g_object_ref (window); - event->selection.requestor = g_object_ref (window); - } - - _gdk_display_put_event (display, event); - gdk_event_free (event); -} - void _gdk_wayland_display_convert_selection (GdkDisplay *display, GdkWindow *requestor, |