PoC: feat(platform): add system clipboard integration - #88
Conversation
Provide an isolated XCB clipboard owner that serves UTF-8 text without consuming application events. Connect it to ImGui's platform clipboard callback and leave the private fallback in place when no X11 or Xwayland display is available.
|
Sorry to post here but don't know if there's a better place. I'm curious if this will in some form give a game running in gamescope with vkShade running access to/from the system clipboard? I currently run a hack in Faugus to allow copy/paste (pre-launch: I could see a lot of value add if vkShade were the solution to that? Maybe using vkShade as a bridge between clipboards in Gamescope and Linux. Since it's already running (even if effects are toggled off, vkShade would need to be running to check for toggles). Might be considered scope creep but if it's doable without massive extra effort I really see it being useful. Maybe a setting in the .ini to enable it and have it off by default. |
Most likely not, I think rather gamescope would need to bridge the clipboard between the system and its nested compositor. So maybe you should report an issue in the gamescope project? Also, vkShade has no business in creating such workarounds. If even possible, it would be very hacky, not just scope creep. Your hack already shows that it is a problem bridging different compositor technologies (Xorg and Wayland) for the clipboard, and it's probably just a missing implementation in gamescope. |
Summary
Motivation
ImGui's default Linux fallback only stores clipboard contents inside the current process. Consequently, GUI Copy controls cannot place text in the desktop clipboard.
X11 clipboard ownership also requires the owner to keep responding to selection requests. The implementation therefore uses a private XCB connection and a bounded background event loop, avoiding interference with application-owned displays and event queues.
This provides the infrastructure needed by follow-up Copy controls for the live log and developer diagnostics.
Scope
This PR implements setting clipboard text on X11 and Xwayland. It does not add any Copy buttons itself.
Native Wayland sessions without an Xwayland
DISPLAYremain unsupported and will require a separatewl_data_deviceprovider.Verification
xclipclient:TARGETS,UTF8_STRING,TEXT, andSTRINGwere advertised