diff options
Diffstat (limited to 'src/wayland/meta-wayland-data-offer.c')
-rw-r--r-- | src/wayland/meta-wayland-data-offer.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/wayland/meta-wayland-data-offer.c b/src/wayland/meta-wayland-data-offer.c index f490b8551..4ccb7439e 100644 --- a/src/wayland/meta-wayland-data-offer.c +++ b/src/wayland/meta-wayland-data-offer.c @@ -41,6 +41,15 @@ WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE | \ WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK) +static MetaDisplay * +display_from_offer (MetaWaylandDataOffer *offer) +{ + MetaContext *context = + meta_wayland_compositor_get_context (offer->compositor); + + return meta_context_get_display (context); +} + static void data_offer_accept (struct wl_client *client, struct wl_resource *resource, @@ -85,7 +94,7 @@ data_offer_receive (struct wl_client *client, struct wl_resource *resource, const char *mime_type, int32_t fd) { MetaWaylandDataOffer *offer = wl_resource_get_user_data (resource); - MetaDisplay *display = meta_get_display (); + MetaDisplay *display = display_from_offer (offer); MetaSelectionType selection_type; GList *mime_types; gboolean found; @@ -228,18 +237,20 @@ destroy_data_offer (struct wl_resource *resource) offer->source = NULL; } - meta_display_sync_wayland_input_focus (meta_get_display ()); + meta_display_sync_wayland_input_focus (display_from_offer (offer)); g_free (offer); } MetaWaylandDataOffer * -meta_wayland_data_offer_new (MetaSelectionType selection_type, +meta_wayland_data_offer_new (MetaWaylandCompositor *compositor, + MetaSelectionType selection_type, MetaWaylandDataSource *source, struct wl_resource *target) { MetaWaylandDataOffer *offer; offer = g_new0 (MetaWaylandDataOffer, 1); + offer->compositor = compositor; offer->selection_type = selection_type; offer->resource = wl_resource_create (wl_resource_get_client (target), &wl_data_offer_interface, |