Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Drag & Drop from ksnip to apps stopped working after upgrade to kubuntu 22.04 #898

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

Closed
aseques opened this issue Aug 9, 2022 · 15 comments
Closed
Assignees
Labels

Comments

@aseques
Copy link
Contributor

aseques commented Aug 9, 2022

Describe the bug
Since upgrading from kubuntu 21.10 to LTS 22.04 the drag & drop feature to attach images is not working, while Copy & Paste still works fine.
I tried both the packaged version from ubuntu 1.9.2-1 and the snap version 1.10 with exactly same result

To Reproduce
Just try to drag & drop a screen capture any app (tried chrome, firefox and dolphin)

Expected behavior
Image is uploaded to the browser

Screenshots
If applicable, add screenshots to help explain your problem.
On chrome I get this error:
image

Desktop (please complete the following information):

  • OS: Linux
  • Distribution in case of Linux: Kubuntu
  • Window System in case of Linux: X11
  • ksnip version: 1.10
  • How did you install ksnip: snap

Additional context
There are no messages in the CLI when doing the action.

@aseques aseques added the bug label Aug 9, 2022
@DamirPorobic
Copy link
Member

Thanks for reporting. Usually I test something like this with LibreOffice, haven't tested with Browser to be honest.

@aseques
Copy link
Contributor Author

aseques commented Aug 26, 2022

Same case, when drag & drop it opens the "Insert Section" menu, no idea why
imatge
If I can collect any valuable information I'll be happy to contribute

@DamirPorobic
Copy link
Member

Thanks for checking, I'll try to find some time to investigate this.

@DamirPorobic
Copy link
Member

Just had a quick local test and for me dragging it LibreOffice Writer works but doesn't work dragging it to GitHub in the browser. I see the temp file is there but permissions seem to be restrictive and only allow the user read and write it.

@DamirPorobic
Copy link
Member

The permissions seem to make no difference but I've noticed that the browser does, when I open GitHub in Brave (Chromium based) it does not work but it works when I open GitHub in Firefox.

In your case the snap might also be making some problems as it's very restrictive. Could you try, just for testing purpose, the latest AppImage?

@DamirPorobic
Copy link
Member

Something just came to my mind, on my machine the Brave browser is installed as snap and the others apps that I've used are not. @aseques could it be that in your case the LibreOffice and browsers are also snaps?

@LyzardKing we save the temp file to /tmp, could it be that snaps are not allowed to access this directory?

@DamirPorobic
Copy link
Member

Yeah, that's it. Just changed the temporary store location to my home directory and I was able to drag and drop the file to by Brave browser.

@LyzardKing
Copy link
Contributor

Yes, snaps have their own /tmp directory, set (I think) with the TMPDIR env variable

@DamirPorobic
Copy link
Member

But looks like different snaps can't see each others tmp files https://forum.snapcraft.io/t/accessing-tmp-from-snaps/22384/6

Those snaps are just a big headache...

@LyzardKing
Copy link
Contributor

LyzardKing commented Aug 27, 2022

No, the tmp folder is confined as well. There are some workarounds, but mostly require extra permissions.
I think flatpaks may have the same problem, although it is easier to override the confinement.
It might be that the tmp folder for the snap is /tmp/snap.ksnip, but I'm not sure about the permissions on accessing that directory (and it doesn't solve the issue of shared /tmp)

@DamirPorobic
Copy link
Member

I'm thinking about adding some custom logic to handle tmp files and allow the user to set a custom tmp directory where we will store those files.

@DamirPorobic
Copy link
Member

Ok, pushed a change that allows now changing the location where temp images are store. In your case with the snap, try to change it to your home directory, after that the drag and drop should be working.

@DamirPorobic DamirPorobic self-assigned this Aug 28, 2022
@aseques
Copy link
Contributor Author

aseques commented Sep 2, 2022

Hi, I was testing the feature and it seems that the dialog is expecting a file instead of a path, if I set the path to a writable location the drag&drop works.
imatge

@DamirPorobic
Copy link
Member

I think I've fixed the directory selection, would be nice if you could test again. I have also added a section to the readme known issues section explaining the issue and the workaround. Closing this issue.

@aseques
Copy link
Contributor Author

aseques commented Nov 3, 2022

Hi @DamirPorobic sorry I took so long to test, I just downloaded the pre release version and it looks great.

@aseques aseques closed this as completed Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants