-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add clipboard support #906
Conversation
That sounds like a bug somewhere. Sway should update the X11 clipboard when an X11 window is focused. |
@emersion Just found out it's a bug in SDL. Looks SDL doesn't send CLIPBOARDUPDATE if the videodriver is x11. I can move |
We can just fix it in SDL maybe? |
Works for me. I'll look into that. In the meantime, is there anything stopping us from merging this PR? |
Fixes the following error: error: control reaches end of non-void function [-Werror=return-type]
SDL PR: libsdl-org/SDL#7951 |
The fix has been merged into SDL2. Let me know if there's anything else you need from me |
@emersion @Joshua-Ashton Bump |
On Holiday until Wednesday |
Any updates on this @Joshua-Ashton? |
With the SDL bug fixed, do we really need the keyboard shortcut to synchronize? |
Really your call. I don't mind either way. I'm not super familiar with distro release schedules, but the only reason I can think of to keep it around is if this change gets picked up by distros before the SDL fix. Again, your call. Let me know and I'll do what I need to do |
This change properly syncs the primary selection and clipboard across all xwayland instances, even in embedded mode
@emersion I went ahead and removed the keybind now that SDL has been fixed to properly report clipboard updates. I also added support for clipboard synchronization across xwayland instances, including in embedded mode. I was going to wait until this PR got merged before introducing the change, but it was a pretty simple so I just included it in this PR. That commit should also fix #916. |
When a client becomes the selection owner, and sets the selection, an XFixes event is raised, and gamescope responds by retrieving the contents of the selection, and re-setting ourWindow as the owner of the selection. We don't need to call XChangeProperty when syncing across Xwayland instances, as that gets called when a client makes a SelectionRequest.
Bump @Joshua-Ashton |
Bump @Joshua-Ashton |
Thought I merged this already, oops! |
No worries. Thank you! |
This PR has been merged, however, I don't see this functionality neither in readme of current codebase, nor in help message of a built-from source executable. Has this been reverted for some reason? If not, what are the steps to enable basic clipboard functionality? |
@Preposterone the easiest way to get this working is to set |
Unfortunately, this doesn't work for me on Arch and Hyprland. Has anyone got this to work? |
Tested with
gamescope gvim
. This PR adds support for copying/pasting utf-8 text for both the clipboard and the primary selection. In the event that SDL_CLIPBOARDUPDATE doesn't get triggered (for example, when running gamescope as XWayland under sway), I've implemented the keybindingSuper + C
to sync both the clipboard and primary selection with gamescope. As of now, this PR only supports Xwayland application windows under gamescope. I don't have much experience with Xlib, so any feedback is appreciated.Closes #303