smithay
smithay copied to clipboard
Add xx_input_method_v1 support.
Implements https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/407
~~Notably missing: repositioning, reactivity of the popup.~~
~~EDIT: this replaces the previous input method for now, so I made it a draft instead.~~
To test:
- stiwri from "popup" branch https://codeberg.org/dcz/stiwri/src/branch/popup
# in anvil
cargo run --release -- --winit &
WAYLAND_DISPLAY=wayland-1 yad &
# in stiwri
WAYLAND_DISPLAY=wayland-1 cargo run --release --bin im_popup
This is an implementation of https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/407
Lookng at CI failures, I need some help understanding what they are.
For example, this code wasn't even touched by my change.
error: fields `popup_geometry_callback`, `new_popup`, and `popup_repositioned` are never read
--> src/wayland/input_method/input_method_handle.rs:172:16
There's also the ack_configure callback which is for some reason exposed to the compositor, but I don't really understand why, so I couldn't come up with a sensible doc comment.
For example, this code wasn't even touched by my change.
I think that's a result of the earlier warning. Because certain methods are never used, the variables that are read only in those methods are never read.
Added repositioning:
WAYLAND_DISPLAY=wayland-1 cargo run --release --bin im_popup_reposition
I did some cleanups:
- lints, except the ack_configure which I don't understand
- both input methods are supported and working
Is there anything I can do to make reviewing this easier?
run these on your branch and correct them btw:
cargo clippy --features "test_all_features" -- -D warnings
cargo fmt --all -- --check
cargo hack check --each-feature --no-dev-deps --exclude-features use_bindgen
LGTM otherwise, someone that knows xdg positioner should probably have a look at the positioner and popup part
The only thing left that breaks ci is the ack_configure which I have no idea what to do with.
Just add documentation to this function:
error: missing documentation for a method
--> src/wayland/input_method_v3/mod.rs:131:5
|
131 | / fn popup_ack_configure(
132 | | &mut self,
133 | | _surface: &WlSurface,
134 | | _serial: Serial,
135 | | _client_state: PopupSurfaceState,
136 | | ) {
| |_____^
|
= note: `-D missing-docs` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(missing_docs)]`
Well that's the problem, I don't have a clue what it's meant to do :P I copy-pasted it without understanding and I hope a reviewer can enlighten me.
This now relies only on published protocols now that experimental is out.
Codecov Report
:x: Patch coverage is 2.17654% with 809 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 18.05%. Comparing base (ec35248) to head (5c40b3a).
:warning: Report is 7 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #1745 +/- ##
==========================================
- Coverage 18.89% 18.05% -0.85%
==========================================
Files 176 181 +5
Lines 27672 28543 +871
==========================================
- Hits 5230 5154 -76
- Misses 22442 23389 +947
| Flag | Coverage Δ | |
|---|---|---|
| wlcs-buffer | ? |
|
| wlcs-core | 15.70% <2.17%> (-0.43%) |
:arrow_down: |
| wlcs-output | 6.70% <2.17%> (-0.15%) |
:arrow_down: |
| wlcs-pointer-input | 17.38% <2.17%> (-0.47%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Rebased.
Rebased again.
Fixed the last problem, fixed conflict.