primary-selection: introduce wlr_primary_selection_source

This is a common interface that can be used for all primary selection
protocols, as discussed in [1]. A new function wlr_seat_set_primary_selection
is added to set the primary selection for all protocols.

The seat now owns again the source, and resets the selection to NULL when
destroyed.

[1]: https://github.com/swaywm/wlroots/issues/1367#issuecomment-442403454
This commit is contained in:
emersion 2018-11-28 16:37:35 +01:00
parent 658b590567
commit 9f0720c03a
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
15 changed files with 209 additions and 209 deletions

View file

@ -957,16 +957,8 @@ struct roots_desktop *desktop_create(struct roots_server *server,
WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT);
desktop->idle = wlr_idle_create(server->wl_display);
desktop->idle_inhibit = wlr_idle_inhibit_v1_create(server->wl_display);
desktop->primary_selection_device_manager =
wlr_gtk_primary_selection_device_manager_create(server->wl_display);
#if WLR_HAS_XWAYLAND
if (desktop->xwayland != NULL) {
wlr_xwayland_set_gtk_primary_selection_device_manager(
desktop->xwayland, desktop->primary_selection_device_manager);
}
#endif
desktop->input_inhibit =
wlr_input_inhibit_manager_create(server->wl_display);
desktop->input_inhibit_activate.notify = input_inhibit_activate;