Skip to content

Inputcapture clipboard integration#9431

Draft
whot wants to merge 3 commits intodeskflow:masterfrom
whot:wip/inputcapture-clipboard
Draft

Inputcapture clipboard integration#9431
whot wants to merge 3 commits intodeskflow:masterfrom
whot:wip/inputcapture-clipboard

Conversation

@whot
Copy link
Copy Markdown
Contributor

@whot whot commented Feb 6, 2026

Description

This adds (a very much in draft state) integration for clipboards via the inputcapture portal, making copy/paste from server to client work OOTB on wayland.

It's based on top of #9415 and will require xdg-desktop-portal, xdg-desktop-portal-gnome, and libportal to run (see flatpak/xdg-desktop-portal#1898). Additionally in the gnome case you will need mutter, other compositors will need similar changes.

It removes the current WlClipboard bits which is probably not ideal but that was yet another layer on top to figure out.

Disclosure of AI use

The second commit was purely written by Claude after I stared at this for too long without seeing any hope of getting started. Turns out Claude wrote something that at least looks correct and it does work. It needs review but also needs knowledge of deskflow's internals that I don't have...

How Has This Been Tested?

I've tested this against a Ubuntu 24.04LTS Xorg GNOME session (vanilla with only deskflow installed as extra package). And whoooah, I can copy on the server and paste on the client. It's like the future!

As of 2026-02-06 the other direction (client->server) does not yet work.

Anyway, I'm filing this so it's at least visible, backed up, and maybe someone really wants to take this and run with it so I don't have to :)

Edit: sithlord48

TODO:

  • Client -> Server Clipboard (remote desktop) support is not included
  • Check type support
  • Make sure we are using the proper clipboard max size in this impl

@sithlord48

This comment was marked as outdated.

@nbolton
Copy link
Copy Markdown
Member

nbolton commented Feb 6, 2026

Exciting! Working on testing this, need to build a few libs... :)

@sithlord48

This comment was marked as outdated.

@sithlord48 sithlord48 force-pushed the wip/inputcapture-clipboard branch 2 times, most recently from 0e3a035 to 3d317c1 Compare February 7, 2026 05:25
@deskflow deskflow deleted a comment from github-actions bot Feb 7, 2026
@sithlord48 sithlord48 force-pushed the wip/inputcapture-clipboard branch from 3d317c1 to 730d627 Compare February 10, 2026 20:11
@sithlord48
Copy link
Copy Markdown
Member

sithlord48 commented Feb 13, 2026

@whot I started looking into using libportal to access the clipboard via remote desktop but i do not seam to see any methods related to the clipboard.( landed or in a pr) Does such support exist or for remote desktop do we need to use the clipboard portal directly ?

@whot
Copy link
Copy Markdown
Contributor Author

whot commented Feb 13, 2026

You need the libportal branch with Jonas' rework for this which adds a clipboard.h and then the entry point is xdp_session_request_clipboard() where you pass in the RD session. Then the rest is identical to the InputCapture support bits.

@sithlord48
Copy link
Copy Markdown
Member

Do you have a link to this branch / pr ?

@whot
Copy link
Copy Markdown
Contributor Author

whot commented Feb 14, 2026

You can use my branch from flatpak/libportal#214 which has both the session persistence and the clipboard changes. I don't think there's a branch just yet for just the clipboard support.

@sithlord48 sithlord48 force-pushed the wip/inputcapture-clipboard branch from 7b6f084 to c4ba355 Compare February 25, 2026 03:48
@whot
Copy link
Copy Markdown
Contributor Author

whot commented Feb 26, 2026

@sithlord48 are you happy if I leave this PR to you?

@sithlord48
Copy link
Copy Markdown
Member

Yes but it maybe a bit before i can get the needed libs to update / test . and im sure ill ask something dumb about the remote desktop side too .

whot added 3 commits February 26, 2026 16:13
Use the new libportal API to start a CreateSession2, then set the
session persistence and read/write the tokens as required. This allows
us to start a server without a permission dialog - provided the portal
supports it and the user is ok with that.
guard this based on if we have detected the inputcapture portal has clipboard support
@cdvankammen
Copy link
Copy Markdown

I am not sure whats happening but on debian linux this is not working correctly with the newest version i find that Linux to mac is broken. Unable to get it to work. that same connection mac to linux works fine. previous versions of this it just worked with no problem. Save version of linux same mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ enhancement A suggested change to improve functionality wayland This issues effects Wayland on Linux

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clipboard support via input capture / remote desktop portal

4 participants