-
-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wayland backend #535
base: master
Are you sure you want to change the base?
Wayland backend #535
Conversation
…, but there's a segfault when the text is replaced (cancelled). Reading the clipboard data just hangs so it's commented out for now.
- Implement Wayland key repeat - Implement Wayland clipboard and drag_n_drop - Rename `Platform::linux_x11_wm_class` to `linux_wm_class` for both X11 and Wayland usage - Use `eglSwapInterval`
Remove `event_handler` from the payload and add `EVENTS` to the payload. Essentially we now maintain our own event queue.
- Make the event handlers of listeners not `Option` anymore. - Let `wl_listener` macro write all the dummy event handlers - High-dpi support - Construct all the `wl_proxy` in `registry_add_object` (except the `wl_data_device`)
- Add new struct `PointerContext` - Support cursor shape and cursor grab - Move the `wl_request` macros to `libwayland_client.rs`
- Make `wayland_use_fallback_decorations` deprecated
- There is no reason to normalize the mouse wheel value to {-1,0,1}: it's not done on other platforms, and this just makes the input very imprecise
/// When using Wayland, this controls whether to draw the default window decorations. | ||
/// On Wayland, the decorations are either drawn by the server or via `libdecor`. If neither is | ||
/// available then no decorations will be drawn. | ||
#[deprecated] | ||
pub wayland_use_fallback_decorations: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep this configurable. Maybe as an enum with options for no csd, ugly csd and libdecor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I restored the old fallback decorations so this flag still applies if libdecor
is not found.
Wow, what a PR, great work! I do not have much to add, looks super good to me. This is correct, this code was basically maintained by @narodnik, so I would wait for their feedback too. |
We now have
libdecor
, which is what xwayland uses (I removed the old fallback decorations: it looks bad but more importantly it also messes up the cursor positioning, and I don't want to manually fix the offset)Probably some tests are needed before merging, especially under different compositors and on different machines (I tested on
mutter
,hyprland
, andsway
, and I've had the same code working under one but not another...)Also I did modify the code structure quite a bit. Probably gonna be bad for others who worked/are working on it (@narodnik maybe? btw I rebased upon your clipboard implementation; it got me started so your work is not in vain :)
There's still some code that's a bit messy; also it'd probably be nice for the X11 and Wayland implementations to share more common patterns, which I didn't pay enough attention. But at least it works now :)