Commit graph

37 commits

Author SHA1 Message Date
emersion
556bf3ac31
data-device: destroy previous source when starting drag
This supersedes f24e17259e and
04c9ca4198. These commits were manually removing
wlr_data_source destroy handlers when starting a new drag. This is error-prone.

Instead, this commit destroys the previous source whenever we start a new drag.
2019-02-05 18:43:06 +01:00
John Chen
f24e17259e Fix swaywm/sway#3545. 2019-02-02 14:05:31 +01:00
Drew DeVault
28f11aec31
Merge pull request #1523 from emersion/set-same-selection-crash
data-device: fix crash when setting the same selection twice
2019-02-01 09:41:02 +01:00
emersion
f1d3aeff9a
data-device: fix crash when setting the same selection twice 2019-01-31 20:33:48 +01:00
emersion
790f0c52a1
De-duplicate data source MIME types 2019-01-30 22:10:52 +01:00
emersion
29952dee19
data-device: only allow one drag at a time 2019-01-30 15:24:18 +01:00
emersion
c505ce3019
data-device: fix use-after-free on drop 2019-01-30 15:24:14 +01:00
emersion
a1f9d7ad9e
data-device: keep track of wlr_data_offer in wlr_seat lists 2019-01-24 12:18:41 +01:00
emersion
909b3b16f3
data-device: add wlr_data_offer.type 2019-01-24 12:18:40 +01:00
emersion
3f82eb1853
data-device: make device inert when seat is destroyed 2019-01-24 12:18:39 +01:00
emersion
c20d413f8a
data-device: fix missing listener removal 2019-01-24 12:18:00 +01:00
emersion
0040f7089f
data-device: unexport wlr_seat_client_send_selection 2019-01-24 12:15:18 +01:00
emersion
1a2727cc38
data-device: send offer on get_data_device 2019-01-24 12:12:55 +01:00
emersion
84f278eca1
data-device: remove data_source_send_offer 2019-01-24 12:12:55 +01:00
emersion
1150ff13ce
data-device: make sources inert, rename cancel to destroy 2019-01-24 12:12:55 +01:00
emersion
4cb0697e57 data-device, primary-selection: add request_set_selection
This makes compositors able to block and/or customize set_selection requests
coming from clients. For instance, it's possible for a compositor to disable
rich selection content (by removing all MIME types except text/plain). This
commit implements the design proposed in [1].

Two new events are added to wlr_seat: request_set_selection and
request_set_primary_selection. Compositors need to listen to these events and
either destroy the source or effectively set the selection.

Fixes https://github.com/swaywm/wlroots/issues/1138

[1]: https://github.com/swaywm/wlroots/issues/1367#issuecomment-442403454
2019-01-24 11:38:23 +01:00
emersion
ae1dd635b1
data-device: fix dangling listener in seat_client_selection_source_destroy 2018-12-30 02:48:03 +01:00
emersion
4423f88fac
data-device: never cancel the source when offer is destroyed
The source could be used in another offer.
2018-11-26 12:35:49 +01:00
emersion
5d26da9d15
data-device: allow multiple devices for the same seat
This commit makes it possible for a single client to have multiple data devices
for the same seat. This fixes issues with Firefox.

This mainly removes wlr_data_source.offer. We make sure we create one data
offer per device. We now make the offer inert when the source is destroyed.

Fixes the second half of https://github.com/swaywm/wlroots/issues/1041
2018-11-26 12:35:48 +01:00
Julio Galvan
a31fa678e5
Fix compilation error on musl
_XOPEN_SOURCE is needed for the strings.h ffs function on the musl libc implementation
2018-11-09 04:27:06 +00:00
emersion
2d0c5ec78e
Use _POSIX_C_SOURCE, use shm_open 2018-11-06 08:29:23 +01:00
emersion
f44003f04b data-device: remove wlr_data_source.seat_client
Since the source doesn't always come from a client, this field
doesn't make sense. It is replaced by a new "finalized" field in
wlr_client_data_source. This is used to make sure set_actions is
not sent after start_drag has been sent.

A check in data_offer_choose_action has been removed: if an offer
has been sent then start_drag has been called, no need to check.

I also wanted to add a check for wl_data_source.offer, but it
turns out (1) this isn't in the spec (2) it breaks GTK+.

This is some preliminary work for Firefox on Wayland compatibility.
2018-10-07 16:01:57 +02:00
nyorain
f6168c2afe Fix #1129 and remove sx, sy from wlr_drag_icon
sx, sy used to store the buffer offset of the drag surface which was
then be added (by rootston) to the drag icon position.
Buffer offsets are handled already in surface_intersect_output
(output.c) so they were added twice for dnd surfaces.
2018-09-07 14:48:28 +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
7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01: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
emersion
adf0423f7c
surface: better buffer position handling 2018-07-04 19:12:17 +01:00
emersion
3c0d672ebd
surface: make pending and current embedded structs 2018-07-04 19:12:17 +01:00
Tony Crisci
7c888a39c6 update drag position at the right times 2018-06-05 23:45:03 -04:00
Tony Crisci
319ebdf476 add back map event 2018-06-05 22:50:29 -04:00
Tony Crisci
1c75d4e54a rename drag-icon map to unmap 2018-06-05 18:17:42 -04: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
5d37b14116
data-device: make sure resources are correctly destroyed 2018-05-03 20:22:51 +01:00
emersion
1e563e7ecf
data-device: split into multiple files 2018-05-02 18:04:10 +01:00