Skip to content

Commit

Permalink
Merge #189
Browse files Browse the repository at this point in the history
189: Set the selection when offering cut & paste r=wmww a=AlanGriffiths

Fixes: canonical/mir#1940

Co-authored-by: Alan Griffiths <[email protected]>
  • Loading branch information
bors[bot] and AlanGriffiths committed Feb 19, 2021
1 parent b3c55a9 commit 0af6228
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/copy_cut_paste.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ struct CCnPSource : Client
Surface const surface{create_visible_surface(any_width, any_height)};
WlHandle<wl_data_device_manager> const manager{
this->bind_if_supported<wl_data_device_manager>(AnyVersion)};
DataDevice data_device{wl_data_device_manager_get_data_device(manager,seat())};
DataSource data{wl_data_device_manager_create_data_source(manager)};

void offer(char const* mime_type)
{
wl_data_source_offer(data, mime_type);
// TODO: collect a serial from the "event that triggered" the selection
// (This works while Mir fails to validate the serial)
uint32_t const serial = 0;
wl_data_device_set_selection(data_device, data, serial);
roundtrip();
}
};
Expand Down

0 comments on commit 0af6228

Please sign in to comment.