Repository navigation
Conversation
3 of 4 tasks
|
Preview available at https://egui-pr-preview.github.io/pr/8657-egui-winit-wayland-clipboard View snapshot changes at kitdiff |
Once winit binds a data device per seat (for file drops), smithay-clipboard binds a second one on the same connection. Hyprland sends the selection only to a client's first data device, so smithay-clipboard never sees it and paste fails in every text field. When the display handle belongs to a winit event loop, read and write text through winit::platform::wayland::Clipboard, which uses winit's own data device, and don't start smithay-clipboard. Other displays keep smithay-clipboard, and arboard still handles images.
Remove before merging, once a winit 0.30 release has winit::platform::wayland::Clipboard.
crmne
force-pushed
the
egui-winit-wayland-clipboard
branch
from
October 14, 2026 21:18
ee84f32 to
14135f0
Compare
Contributor
Author
|
Rebased onto main. |
This was referenced Oct 22, 2026
bmh129
added a commit
to bmh129/gridcraft
that referenced
this pull request
Oct 25, 2026
winit 0.30.13 reports dropped files only on X11, so on a Wayland session a workbook dragged from Files showed a "no" cursor. Rather than running through XWayland, pin winit to rust-windowing/winit#4729 (the 0.30 backport of Wayland file drops, which also moves the clipboard onto winit's own data device). egui's clipboard would otherwise bind a second data device through smithay-clipboard, and Hyprland serves the selection only to a client's first one, so paste would break there. patches/egui-winit is the published egui-winit 0.36.2 with emilk/egui#8657 ported (it was written against egui main), so egui reads and writes text through winit's clipboard when the display belongs to a winit event loop. Licence files from egui 0.36.2 are included. Both patches go away once winit and egui release these changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JxSbmEZZDKrHjsmEDM34SY
bmh129
added a commit
to bmh129/cadcraft
that referenced
this pull request
Oct 25, 2026
winit 0.30.13 reports dropped files only on X11, so on a Wayland session a drawing dragged from Files showed a "no" cursor unless CADCRAFT_X11=1 ran the app through XWayland. Pin winit to rust-windowing/winit#4729 (the 0.30 backport of Wayland file drops, which also moves the clipboard onto winit's own data device). egui's clipboard would otherwise bind a second data device through smithay-clipboard, and Hyprland serves the selection only to a client's first one, so paste would break there. patches/egui-winit is the published egui-winit 0.36.2 with emilk/egui#8657 ported, so egui reads and writes text through winit's clipboard when the display belongs to a winit event loop. Licence files from egui 0.36.2 are included. Both patches go away once winit and egui release these changes. Ported from GridCraft (storytold/gridcraft#2222). Co-Authored-By: Claude Opus 5.5 <[email protected]>
richerfu
pushed a commit
to richerfu/egui
that referenced
this pull request
Nov 2, 2026
…board when available Port of emilk#8657 (draft) to 0.36.2, the companion of W15 (rust-windowing/winit#4729): winit now binds a wl_data_device per seat for file drops, and a second device from smithay-clipboard loses the selection on compositors that serve only the first device per client (Hyprland). With winit's clipboard available, smithay-clipboard is not started. Only the clipboard.rs change is taken; the PR's temporary [patch] of egui's own winit is not. On 0.37, `Clipboard::new` stays `unsafe`. While winit's clipboard is in use, the PRIMARY selection goes through arboard: W15 offers only the regular selection.
richerfu
pushed a commit
to richerfu/egui
that referenced
this pull request
Nov 2, 2026
…board when available Port of emilk#8657 (draft) to 0.36.2, the companion of W15 (rust-windowing/winit#4729): winit now binds a wl_data_device per seat for file drops, and a second device from smithay-clipboard loses the selection on compositors that serve only the first device per client (Hyprland). With winit's clipboard available, smithay-clipboard is not started. Only the clipboard.rs change is taken; the PR's temporary [patch] of egui's own winit is not.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on rust-windowing/winit#4729, which is not in a winit release yet, so this is a draft. The second commit points
winitat that branch so CI can build; it must be dropped before merging (cargo-deny rejects the git source).winit#4729 adds Wayland file drops to winit 0.30 (the winit side of #1563), which means winit binds a
wl_data_deviceper seat. smithay-clipboard then binds a second device on the same connection, and Hyprland sends the selection only to a client's first data device (dataDeviceForClient), so paste fails in every text field. To avoid that, the winit PR also offers text copy and paste on its own device aswinit::platform::wayland::Clipboard.With this change,
egui_winit::Clipboard::newasks winit for the clipboard of the event loop behind the Wayland display handle (Clipboard::for_display). If there is one, text goes through it and smithay-clipboard is never started. Otherwise nothing changes. arboard still handles images, and an empty or non-text Wayland clipboard falls through to arboard as the smithay path does.Tested in an egui app on headless Hyprland 0.56.2 and mutter 50.5: paste in, copy out, pasting our own copy, and paste after a file drop all work. Without this change, the same Hyprland setup with winit#4729 fails to paste.
cargo clippy(all features, debug and release),cargo test -p egui-winit, and theegui-winit/eframefeature checks fromscripts/check.shpass on 1.95.