desktop icon indicating copy to clipboard operation
desktop copied to clipboard

[Bug]: nautilus context menu "copy public/private link" not working while Sharing Options is working

Open Ventusfahrer opened this issue 1 year ago • 2 comments

⚠️ Before submitting, please verify the following: ⚠️

Bug description

Right clicking on a file or folder in an local synced nextcloud folder shows the context menu as expected. When right clicking on: Copy Internal Link and pasting it to a linux destop application (gnome terminal, Signal app, Chrome Browser Window) nothing is pasted into the Window. The paste buffer obviously contains NO content (or a previous content, but not the expected one from Nextcloud)

Copy Public Link: same behavior as "Copy Internal Link": an empty paste buffer. After a small amount of time the Nextcloud Symbol behind the Filename in the Nautilus browser indicating the Nextcloud Status of the file changes to include the "Shared Symbol", in the webbrowser Window to the nextcloud server I can also see, that the File now contains the public link symbol

Sharing Options: a small (maybe nautilus-client app based, the style looks identical to the one in Nextcloud-MainWindow ) Windows openes. If I create the Link within this Dialog the Paste Buffer is filled correctly with the URL.

It looks very much that the first two operations are happening within the nautilus code, which is not working.

The third operation is probably happing in the nextcloud-client code and working. But using this Window is annoying because additional clicks an mouse movements.

How can I fix this?

Thanks for any help!

Steps to reproduce

See Bug description.

The problem happens on a desktop computer and a second notebook. Both freshly installed in August 2024 with Ubuntu 24.04, which was upgraded to 24.10 at the end of October. The problem did alread happen in 24.04.

Expected behavior

When clicking on the share dialog, share by e-mail should be an option. ...

Which files are affected by this bug

all files and directories to be shared by nautilus right click

Operating system

Linux

Which version of the operating system you are running.

Ubuntu 24.10 -

Package

Distro package manager

Nextcloud Server version

29.0.8

Nextcloud Desktop Client version

3.13.2-2

Is this bug present after an update or on a fresh install?

Fresh desktop client install

Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

Are you using an external user-backend?

  • [ ] Default internal user-backend
  • [ ] LDAP/ Active Directory
  • [ ] SSO - SAML
  • [ ] Other

Nextcloud Server logs

No response

Additional info

No response

Ventusfahrer avatar Nov 06 '24 11:11 Ventusfahrer

I can confirm this with version 3.14.2daily on Fedora 41.

PatrickJosh avatar Nov 06 '24 15:11 PatrickJosh

I'm suspecting this is due to Wayland (see #5614)

tcitworld avatar Apr 23 '25 09:04 tcitworld

We use the KSystemClipboard class to copy text to the clipboard: https://github.com/nextcloud/desktop/blob/d3a6d2e8f9c6e5967f41f9306b6b1ae4b9216974/src/gui/socketapi/socketapi.cpp#L195-L199

From what I've seen so far it looks like KSystemClipboard fails to initialise on Gnome+Wayland and falls back to using QtClipboard which will only change the contents if there's an active app window (which is why copying from the share dialogue works fine). At the moment KSystemClipboard tries to use Wayland protocols that aren't implemented by Mutter (ext_data_control_manager_v1, zwlr_data_control_manager_v1). Maybe there's some Gnome extensions that provides one of those protocols, but I don't know.

I'm not sure what the preferred way of copying data to the clipboard without an active app window would be on Gnome. Maybe a XDG portal, or trying to let the Nautilus plug-in do that on its own?

nilsding avatar Sep 19 '25 08:09 nilsding