Commit Graph

81 Commits

Author SHA1 Message Date
emersion 9f0720c03a
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
2018-11-29 19:40:28 +01:00
emersion cbe42d1006
gtk-primary-selection: remove offer struct
We don't need it, we can use the device instead.
2018-11-27 19:45:39 +01:00
emersion f001f98cef
gtk-primary-selection: refactor everything, untie from seat
This commits completely refactors wlr_gtk_primary_selection. The goal is to
remove gtk-primary-selection state from the seat and better handle inert
resources where it makes sense.

wlr_seat_client.primary_selection_devices has been removed and replaced by
wlr_gtk_primary_selection_device. This allows us to make offers inert when the
current selection is replaced.

wlr_seat_set_primary_selection has been removed because it relied on wlr_seat
instead of wlr_gtk_primary_selection_device_manager. A new function,
wlr_gtk_primary_selection_device_manager_set_selection (candidate for the
longest function name in wlroots) has been added. It doesn't take a serial
anymore as serial checking only makes sense for set_selection requests coming
from Wayland clients (serial checking is now done in the Wayland interface
implementation).

Since wlr_gtk_primary_selection_device_manager is now required to set the
selection, a new function wlr_xwayland_set_gtk_primary_selection_device_manager
(candidate number two for longest function name) has been added.

Devices are now made inert when the seat goes away.

Future work includes removing the last primary selection bits from the seat,
mainly wlr_seat.primary_selection_source and wlr_seat.events.primary_selection,
replacing those with new fields in wlr_gtk_primary_selection_device. Or maybe
we could keep those in the seat and replace them with a re-usable interface
(for future zwp_primary_selection_v1 support). We need to think how we'll sync
these three protocols (GTK, X11 and wayland-protocols).

See https://github.com/swaywm/wlroots/issues/1388
2018-11-27 18:57:26 +01:00
emersion 811a4d997b
Rename wlr_primary_selection to wlr_gtk_primary_selection 2018-11-23 11:58:56 +01:00
emersion fadbdcd13c seat: remove unused keyboard focus_change event 2018-09-27 12:21:30 +02:00
Las d446c53fe1 Make (wlr_)seat_client_from_pointer_resource public 2018-09-18 10:14:33 +02:00
Las 252bcce2f3 Add focus change event for seats 2018-09-18 10:14:33 +02:00
Drew DeVault 211ae764fd Initial pass on API stability guarantees
This introduces -DWLR_USE_UNSTABLE and adds information regarding the
stability status to all headers. I started with a conservative set of
headers to mark as stable:

- types/wlr_matrix.h
- util/edges.h
- util/log.h
- util/region.h
- xcursor.h
2018-07-29 19:20:34 -04:00
Markus Ongyerth 9a6f77fc2c tablet-v2: fix merge commits and test again
There were a few issues after rebase, that the merge algorithm didn't
throw at my face:

wlr_output did a check on the actual role, not a string anymore, so that
had to go to allow tablet-v2 to set cursor surfaces.
A few L_DEBUG/L_ERRORs were still around
There was a user-after-free in tablet-group free()ing, probably after
insufficient testing from a previous feedback pass
2018-07-14 10:29:22 +02:00
Drew DeVault c0b4217fce
Merge pull request #1116 from emersion/surface-role
surface: replace wlr_surface_set_role_committed with wlr_surface_role
2018-07-11 15:27:42 -07:00
emersion deeca53e33
Rename wl_resources to resource, wl_global to global 2018-07-08 19:21:31 +01:00
emersion 33db4263a0
surface: replace wlr_surface_set_role_committed with wlr_surface_role 2018-07-07 22:45:16 +01:00
Dominique Martinet 51b9883ea0 seat: allow clients to bind to seat multiple times
This lets clients bind to a seat multiple times by re-using the existing
wlr_seat_client whenever a duplicate request happens.
Previously, an independant wlr_seat_client would be created and only
events from one would be processed.

Fixes #1023.
2018-06-04 22:31:36 +09:00
emersion db84379242
Send axis source event 2018-05-12 13:53:21 +01:00
emersion 0b58579564
Add support for discrete axis values 2018-05-12 13:34:58 +01:00
emersion 2cff6dbd63
seat: split into multiple files 2018-05-03 10:30:47 +01:00
Drew DeVault 6710de9878 Merge branch 'master' into xwayland-dnd 2018-04-05 15:04:49 -04:00
Drew DeVault 56deff41b6 Implement input inhibit in rootston 2018-04-03 15:09:53 -04:00
emersion 743466d475
data-device: add seat.drag_source 2018-03-29 11:33:40 -04:00
emersion 0d7a81ccdf
xwayland: send DND_ENTER 2018-03-28 12:59:11 -04:00
emersion 392d54a35d
Wrap wl_resource_get_user_data into safer helper functions
This ensures we're not incorrectly casting a resource.

Fixes #628
2018-02-13 23:48:46 +01:00
emersion c2e1474010
Reformat all #include directives 2018-02-12 21:29:23 +01:00
emersion 4d282c8590
rootston: damage tracking for drag icons 2018-01-23 13:37:58 +01:00
Tony Crisci b40a5f084a keyboard grab enter with modifiers 2018-01-06 11:06:09 -05:00
Tony Crisci 0ef2df21f2 compositor modifier hook 2018-01-05 07:00:50 -05:00
emersion 38ed3b4245
seat: rename selection_source to selection_data_source, remove unused data_device 2017-12-30 09:58:04 +01:00
Dominique Martinet 58488ec5ce wlr_seat: add destroy signal 2017-12-29 17:55:03 +01:00
Tony Crisci 815d71a3aa validate grab serial for shell events 2017-12-27 08:04:01 -05:00
emersion a95d09d561
Add missing gtk-primary-selection interfaces 2017-12-22 22:22:29 +01:00
emersion 8af6fbd7a0
Support multiple resources per seat client for data_device 2017-12-16 14:22:59 +01:00
emersion 4f0443a344
Support multiple resources per seat client for pointer, keyboard, touch 2017-12-16 13:53:39 +01:00
emersion c67a5824b8
Merge branch 'master' into display-destroy 2017-12-11 16:14:03 +01:00
emersion a3c0f97810
Make keyboard repeat info configurable 2017-12-08 17:03:05 +01:00
emersion 983ea3033f
Listen to display destroy in seat 2017-12-07 01:02:07 +01:00
Tony Crisci af23192ede wlr-seat: remove client bound and unbound signal 2017-11-19 11:13:59 -05:00
Tony Crisci 3b74db467b data-device: wlr-drag-icon 2017-11-19 09:33:55 -05:00
Tony Crisci fb18e345a6 wlr-seat: return serial from touch down interface 2017-11-16 17:44:10 -05:00
Tony Crisci 12758a00a2 rootston: touch to focus 2017-11-15 08:34:48 -05:00
Tony Crisci ac4841ba37 put dnd icon in the right place 2017-11-15 08:34:48 -05:00
Tony Crisci a337e95505 wlr-touch: make dnd work 2017-11-15 08:34:48 -05:00
Tony Crisci 4eab61f86f wlr-seat: refactor touch grab interface 2017-11-15 08:34:48 -05:00
Tony Crisci 6a516f7c41 basic touch dnd 2017-11-15 08:34:48 -05:00
Tony Crisci 94e7dc8a3e data-device: touch grab stubs 2017-11-15 08:34:48 -05:00
Tony Crisci cbb6fd7352 wlr-seat: touch grab begin and end 2017-11-15 08:34:48 -05:00
Tony Crisci 469729d3af wlr-seat: document seat touch functions 2017-11-15 08:34:48 -05:00
Tony Crisci 4240096b83 wlr-seat: default touch grab 2017-11-15 08:34:48 -05:00
Tony Crisci e5a31ae870 wlr-seat: basic touch 2017-11-15 08:34:48 -05:00
Drew DeVault 1e0e73efaa Spawn views on last active output 2017-11-12 09:55:28 -05:00
emersion 882e620639
Always read state from wlr_keyboard in the seat 2017-11-08 19:02:56 +01:00
emersion 0df7a3c22d
Add wlr_seat_pointer_request_set_cursor_event.serial 2017-11-01 18:15:37 +01:00