Commit graph

42 commits

Author SHA1 Message Date
Kirill Chibisov
f807e133c0 Bump 'smithay-client-toolkit' to v0.15
This also bumps 'wayland-rs' to 'v0.29'.
2021-08-14 10:54:59 +02:00
Benjamin Bouvier
fe44fead1c Bump smithay-client-toolkit to latest version 2021-06-25 15:59:32 +02:00
Christian Duerr
02f60b9884 Fix typo in normalize_to_lf function name
It took me a bit to figure out why I couldn't find this function when
searching for it in the repository. Turns out this time it wasn't me
spelled it wrong.
2021-02-24 20:42:07 +01:00
Christian Duerr
8ea0580829 Fix serial ID tracking
The serial ID tracking was incorrectly reinserting any previously used
seats without updating the serial information, leading to consecutive
clipboard stores being dropped by the compositor.

Fixes #33.
2021-02-04 11:01:01 +01:00
Kirill Chibisov
f6f5b98235
Fix segfault in multithreaded context
Dropping libwayland-client's queue in multithreaded context is safe if
and only if there're no alive proxies on it, otherwise it could result
in use-after-free. For more see [1] and [2].

[1] - https://gitlab.freedesktop.org/wayland/wayland/-/issues/13
[2] - https://github.com/Smithay/wayland-rs/issues/359
2020-12-12 18:28:29 +03:00
Kirill Chibisov
276aa84cf5
Fix comment about CRLF normalization 2020-11-12 19:05:17 +03:00
Kirill Chibisov
da2637af29
Fix crash when failing to write to a clipboard (#29)
Fix crash when failing to write to a clipboard
2020-10-13 15:25:36 +02:00
Kirill Chibisov
0577a468c3
Mark 'Clipboard::new' as 'unsafe'
Since this call takes raw pointer it's generally unsafe.
2020-09-30 19:13:15 +03:00
Kirill Chibisov
eef2ca9f2e Update SCTK to 0.12 2020-09-30 18:30:51 +03:00
Kirill Chibisov
8a81be7c0a
Avoid panic on dispatch failure (#23)
Prevent crash when calling unwrap on either sync_roundtrip
or dispatch_pending, and handle such case by replying downstream
that clipboard is dead.
2020-08-27 13:08:26 +02:00
Kirill Chibisov
2aea170962 Fix fd leak from keymap updates 2020-08-27 12:43:38 +02:00
Kirill Chibisov
d688c33f23 Advertise UTF8_STRING mimetype
Certain applications only accept UTF8_STRING mimetype like Geany
even so they are Wayland native.
2020-08-10 13:18:40 +02:00
Kirill Chibisov
597086c42c Add rustfmt.toml
Add rustfmt.toml that is being used by projects under smithay's
umbrella.
2020-08-06 09:38:46 +02:00
Kirill Chibisov
7fc533d55f Fix the crash when there's no focus on a seat
If the user asks for clipboard data with neither wl_keyboard
nor wl_pointer focus being presented on a seat, we should ignore the
request and reply with error, instead of crashing.
2020-08-05 22:37:54 +02:00
Kirill Chibisov
f4abc24f11 Fix clipboard not working when seat has empty name 2020-07-10 20:42:26 +02:00
Kirill Chibisov
bb652c775b
Update smithay-clipboard to SCTK 0.9.1 (#16)
This commit entirely reworks the internal structure of the entire crate,
as well as some of its APIs. This crate only accepts a C pointer to a
Wayland display object, since the target audience of this crate are
libraries without a wayland-client types. Also since seat information is
not presented in such clients most of the time, the clipboard entirely
relies on its seat tracking.
2020-05-10 15:40:03 +02:00
Kirill Chibisov
87ac92595b Check version before release 2020-03-09 02:10:07 +03:00
Kirill Chibisov
b783b2250c Fix clipboard dying after TTY switch 2020-03-09 01:34:12 +03:00
Kirill Chibisov
2971386aea Fix crash when receiving non-utf8 data
This commit also changes return type of `load` and `load_primary`
to propagate errors during reading and parsing clipboard contents.
2020-03-05 11:27:12 +03:00
Victor Berger
715a926d1b Only bind wl_seat up to version 6 2020-02-27 15:59:48 +01:00
Kirill Chibisov
7b1651a2c1 Dynamically change thread sleeping time to increase throughput during high load
Previously we were always blocking for 50ms no matter what, but now
we'll be dynamically adjust our block ratio depending on the current
clipboard load. In the worst case scenario when user used the clipboard only
once will go with the next sequence: 0 1(16 times) 1 2 4 8 16 32 50 50
50 and so on, until the next user request.
2019-11-21 00:19:28 +08:00
Kirill Chibisov
e10bbfac70 Normalize loaded content for text/plain;charset=utf-8 mime type (#9)
Normalize \r\n and \r into \n
2019-10-30 08:03:25 +08:00
Kirill Chibisov
705939b3bf Only update serial on PtrEvent::Enter/Button when seat is already presented (#8)
Fixes primary selection storing, when mouse button was pressed inside surface
and then released outside.
2019-09-03 21:38:28 +08:00
trimental
be98d3917b Use cloned method 2019-08-14 00:10:02 +08:00
Kirill Chibisov
29b2884442 Implement gtk-primary-selection protocol (#7)
Add fallback to gtk primary selection, when zwp primary selection is not available
2019-08-13 23:58:12 +08:00
Christian Duerr
817340fa14 Update smithay-client-toolkit version (#5)
* Update smithay-client-toolkit version

* Fix formatting issues
2019-06-13 07:19:39 +08:00
Lucas Timmins
18e49392ca Fix primary clipboard storing and release 0.3.1 2019-06-08 12:08:01 +08:00
Lucas Timmins
a42fd69ee1 Specify crate:: for pre rust 1.32 compatibility 2019-06-07 10:46:22 +08:00
Lucas Timmins
60e77cd2b0 Add primary selection support 2019-06-07 10:46:22 +08:00
Lucas Timmins
1fa455ab6f Refactor thread code into threaded.rs 2019-06-07 10:46:22 +08:00
Lucas Timmins
f56bb85124 Remove dbg! macro 2019-04-27 23:35:33 +08:00
Lucas Timmins
4eecc726c0 Sync with server to get seat name 2019-04-27 22:04:41 +08:00
Lucas Timmins
f84c9be419 Update documentation 2019-04-27 19:01:41 +08:00
Lucas Timmins
61ac558555 Take an option of a seat name or use name of latest seat event 2019-04-27 18:52:15 +08:00
Lucas Timmins
2a0cd44962 Cleanup 2019-04-24 01:27:50 +08:00
Lucas Timmins
4f4908166a Sync roundtrip to register seat 2019-04-24 01:20:59 +08:00
Lucas Timmins
ba9de4e1d8 Get serials from key and pointer events 2019-04-23 20:47:06 +08:00
Lucas Timmins
d2e552405b Return empty string for load requests with no seat 2019-04-23 18:48:55 +08:00
Lucas Timmins
0ad92d3a0c Fix docs 2019-02-14 18:01:57 +08:00
trimental
a36d3e3e8e
Multiple seat support and api refactor (#2)
* Multiple seat support and api refractor

* Remove the need for two GlobalManagers

* Remove unnecessary `Arc<Mutex<_>>` and `if let`s with `unwrap()`

* Use cloned display to create eventloop in `new_threaded()`

* Update docs

* Wrap display to event queue
2019-02-13 23:48:50 +08:00
Lucas Timmins
0e959c7673 Rename to smithay-clipboard 2019-02-10 19:05:47 +08:00
Lucas Timmins
17011ea9f7 Initial commit 2019-02-10 01:28:53 +08:00