Skip to content
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

[socketapi] Replace QClipboard with KSystemClipboard when available #6515

Merged

Conversation

er-vin
Copy link
Member

@er-vin er-vin commented Mar 6, 2024

This is necessary in Wayland sessions for the clipboard related actions of the socketapi to work. Indeed, QClipboard does its job only if we got a window with the focus in such session.

In the case of the socketapi, it is generally the file manager asking the desktop client to put something in the clipboard. At this point in time no window of the client have the focus, so nothing gets added to the clipboard.

KSystemClipboard on the other hand, uses the wlr data control protocol under wayland sessions ensuring something ends up in the clipboard as expected. When not in a wayland session it falls back to QClipboard so no behavior is lost.

@er-vin er-vin force-pushed the work/ervin/socketapi-use-ksystemclipboard-when-available branch from 7cb68ee to 26fdcf2 Compare March 6, 2024 19:36
@er-vin
Copy link
Member Author

er-vin commented Mar 6, 2024

Again it looks like we're having false positives on the macOS and Windows build. Also the issues sonar is pointing are unrelated to the code introduced here.

er-vin added 2 commits March 7, 2024 08:18
This will be needed to replace QClipboard in some places.

Signed-off-by: Kevin Ottens <[email protected]>
This is necessary in Wayland sessions for the clipboard related actions
of the socketapi to work. Indeed, QClipboard does its job only if we got
a window with the focus in such session.

In the case of the socketapi, it is generally the file manager asking
the desktop client to put something in the clipboard. At this point in
time no window of the client have the focus, so nothing gets added to
the clipboard.

KSystemClipboard on the other hand, uses the wlr data control protocol
under wayland sessions ensuring something ends up in the clipboard as
expected. When not in a wayland session it falls back to QClipboard so
no behavior is lost.

Signed-off-by: Kevin Ottens <[email protected]>
@er-vin er-vin force-pushed the work/ervin/socketapi-use-ksystemclipboard-when-available branch from 26fdcf2 to 526ab05 Compare March 7, 2024 07:18
@nextcloud-desktop-bot
Copy link

AppImage file: nextcloud-PR-6515-526ab056d67b2f3220365e709b6f753d0dcb0979-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

Copy link

sonarqubecloud bot commented Mar 7, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
3 New Code Smells (required ≤ 0)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@mgallien mgallien merged commit ffffc89 into master Mar 7, 2024
10 of 13 checks passed
@mgallien mgallien deleted the work/ervin/socketapi-use-ksystemclipboard-when-available branch March 7, 2024 07:51
@mgallien mgallien added this to the 3.13.0 milestone Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants