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

Support screen capture from [other apps] #710

Closed
squalou opened this issue Aug 11, 2024 · 4 comments
Closed

Support screen capture from [other apps] #710

squalou opened this issue Aug 11, 2024 · 4 comments

Comments

@squalou
Copy link

squalou commented Aug 11, 2024

Hi,

this is probably a known limitation, I didn't find a matching issue, sorry if it's a duplicate.

Currently using for instance flameshot as a screenshot tool does not work. Did not try others. (native one works)

I get this error :

flameshot: error: Unable to capture screen
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
flameshot: info: Screenshot aborted.

There's a "well known" Wayland trick behind this, and using Gnome for instance requires a user launching flameshot to allow screen capture every time. (Which in turn is a Gnome very annoying limitation, let people allow apps once and for all ;) )

BTW : As much as I appreciate a DE coming with decent default apps ... there will always be other apps with 'better' or different features, and I don't think there should be a race to make native cosmic screenshot tool do whatever more than what it already does. That's not the point.

@hojjatabdollahi
Copy link

Flameshot has different config for different DEs. By default it doesn't recognize Cosmic. You can set an environmental variable to trick it into thinking it's on KDE or Gnome. At that point screen shot works*.

It only screen shots one display, and has trouble with fractional scaling.

I don't know if Cosmic need to do anything to support Flameshot, or Flameshot needs to support cosmic.

@Quackdoc
Copy link
Contributor

Quackdoc commented Aug 11, 2024

flameshot supports xdg more or less fine, @hojjatabdollahi if you export sway instead of kde or gnome it works at least on my system, my display settings are below, captures both displays. XDG_SESSION_DESKTOP=sway XDG_CURRENT_DESKTOP=sway flameshot gui

so flameshot needs to support cosmic, not the other way around

➜  ~ cosmic-randr list
DP-1 (enabled)
  Model:
  Physical Size: 600 x 340 mm
  Position: 1280,0
  Scale: 150%
  Transform: normal
  Adaptive Sync: false

  Modes:
    3840x2160 @  60.000 Hz (current)
    3840x2160 @  59.997 Hz (preferred)

EDIT: also iirc the "generic wayland" support is done via grim, so once grim lands support for the new wayland capture protocols and #365 lands, there might not even be a need for flameshot to do anything different.

@squalou
Copy link
Author

squalou commented Aug 12, 2024

Thank you !

@squalou squalou closed this as completed Aug 12, 2024
@squalou
Copy link
Author

squalou commented Aug 13, 2024

Last word if anyone wonders : I still have issues with flameshot but indeed it's on flameshot side to fix I think.

When performing a screenshot, I can then paste it on, say, gimp.
But, I cannot copy to an electron chat app, for whatever reason.

the image is not published to the right wayland buffer I'd say. (the image is not present in this clipboard manager : https://github.com/wiiznokes/clipboard-manager whereas native scrennshot taken are there)

Will open an issue on flameshot.

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

No branches or pull requests

3 participants