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

[BUG] Cosmic Screenshot does not work with the Cosmic Desktop with Arch Linux #42

Open
TheKamboy opened this issue Aug 9, 2024 · 16 comments
Milestone

Comments

@TheKamboy
Copy link

TheKamboy commented Aug 9, 2024

Thought I would make a new issue here since commenting under an inactive one doesn't do anything.

Log:

~
 RUST_BACKTRACE=full cosmic-screenshot
thread 'main' panicked at src/main.rs:71:10:
failed to receive screenshot response: Response(Other)
stack backtrace:
   0:     0x5606f6eb06e5 - <unknown>
   1:     0x5606f6ed824b - <unknown>
   2:     0x5606f6eacdef - <unknown>
   3:     0x5606f6eb04be - <unknown>
   4:     0x5606f6eb1859 - <unknown>
   5:     0x5606f6eb15fa - <unknown>
   6:     0x5606f6eb1d63 - <unknown>
   7:     0x5606f6eb1c44 - <unknown>
   8:     0x5606f6eb0ba9 - <unknown>
   9:     0x5606f6eb1977 - <unknown>
  10:     0x5606f6ed6713 - <unknown>
  11:     0x5606f6ed6c06 - <unknown>
  12:     0x5606f6c21ad4 - <unknown>
  13:     0x5606f6d0e890 - <unknown>
  14:     0x5606f6ce0011 - <unknown>
  15:     0x5606f6cbfc3c - <unknown>
  16:     0x5606f6ccc478 - <unknown>
  17:     0x5606f6ceb553 - <unknown>
  18:     0x5606f6cb99e9 - <unknown>
  19:     0x5606f6ea7c2d - <unknown>
  20:     0x5606f6ccc545 - <unknown>
  21:     0x766df481fe08 - <unknown>
  22:     0x766df481fecc - __libc_start_main
  23:     0x5606f6bfd475 - <unknown>
  24:                0x0 - <unknown>
@TheKamboy
Copy link
Author

Also, putting XDG_DESKTOP_PORTAL=cosmic in /etc/enviroment doesn't work.

@kekkoudesu
Copy link

Same result on Fedora Silverblue.

@TheKamboy
Copy link
Author

Something I find odd is that if I use Cosmic Screenshot with a different wayland based enviroment (ex. Hyprland) it works.

@soloturn
Copy link

soloturn commented Aug 11, 2024

for me cosmic-screenshot on cosmic desktop works. it looses focus sometimes so one cannot click the capture button.

what i find weird that gnome screenshot does not work with cosmic desktop.

@asjur
Copy link

asjur commented Aug 19, 2024

Same here, unable to launch it.

@pauljako
Copy link

Same Issue on fedora 40 arm64

@drazil100
Copy link

me too. While I have seen a panic previously, mine just hangs now with no interface.

@WatchMkr WatchMkr moved this to Post-Current-Alpha ToDo in COSMIC Epoch 1 Sep 12, 2024
@WatchMkr WatchMkr added this to the alpha 3 milestone Sep 12, 2024
@joshuamegnauth54
Copy link
Contributor

@TheKamboy To clarify, cosmic-screenshot works on Hyprland and other DEs/WMs because this program simply calls into an interface that's implemented across different desktop environments.

@drazil100 Hi again!! Your original issue had an interesting bit of information that I'll copy here for anyone attempting this issue.

$ cosmic-screenshot
thread 'main' panicked at src/main.rs:69:10:
failed to send screenshot request: Zbus(MethodError(OwnedErrorName(ErrorName(Str(Owned("org.freedesktop.DBus.Error.UnknownMethod")))), Some("No such interface “org.freedesktop.portal.Screenshot” on object at path /org/freedesktop/portal/desktop"), Msg { type: Error, sender: UniqueName(Str(Borrowed(":1.58"))), reply-serial: 17, body: Signature("s") }))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It seems like the screenshot interface isn't being exposed or doesn't exist for some reason.

For those of you experiencing this issue, can you try getting some logs? Try:

journalctl --user -ef

And then look for logs related to xdg-desktop-portal-cosmic or maybe even the compositor.

@joshuamegnauth54
Copy link
Contributor

Interestingly, #56 is experiencing the same problem but on Pop so it doesn't seem to be directly related to Arch or other distros.

@drazil100
Copy link

drazil100 commented Sep 17, 2024

I noticed I have issues when I try to use it when I launch with start-cosmic but not always. When I log in through cosmic-greeter it works though.

Edit: I worded that so poorly... Fixed

@joshuamegnauth54
Copy link
Contributor

I can't reproduce this yet. 😭 I may need log excerpts from some of you.

I'll likely spin up an Arch VM since it seems more reproducible there.

@drazil100
Copy link

austin@msi:~$ RUST_BACKTRACE=1 cosmic-screenshot
thread 'main' panicked at src/main.rs:69:10:
failed to send screenshot request: Zbus(MethodError(OwnedErrorName(ErrorName(Str(Owned("org.freedesktop.DBus.Error.UnknownMethod")))), Some("No such interface “org.freedesktop.portal.Screenshot” on object at path /org/freedesktop/portal/desktop"), Msg { type: Error, sender: UniqueName(Str(Borrowed(":1.8"))), reply-serial: 17, body: Signature("s") }))
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
austin@msi:~$ RUST_BACKTRACE=full cosmic-screenshot
thread 'main' panicked at src/main.rs:69:10:
failed to send screenshot request: Zbus(MethodError(OwnedErrorName(ErrorName(Str(Owned("org.freedesktop.DBus.Error.UnknownMethod")))), Some("No such interface “org.freedesktop.portal.Screenshot” on object at path /org/freedesktop/portal/desktop"), Msg { type: Error, sender: UniqueName(Str(Borrowed(":1.8"))), reply-serial: 17, body: Signature("s") }))
stack backtrace:
   0:     0x556bb54c0645 - <unknown>
   1:     0x556bb54e81ab - <unknown>
   2:     0x556bb54bcd4f - <unknown>
   3:     0x556bb54c041e - <unknown>
   4:     0x556bb54c17b9 - <unknown>
   5:     0x556bb54c155a - <unknown>
   6:     0x556bb54c1cc3 - <unknown>
   7:     0x556bb54c1ba4 - <unknown>
   8:     0x556bb54c0b09 - <unknown>
   9:     0x556bb54c18d7 - <unknown>
  10:     0x556bb54e6673 - <unknown>
  11:     0x556bb54e6b66 - <unknown>
  12:     0x556bb5231a17 - <unknown>
  13:     0x556bb531e850 - <unknown>
  14:     0x556bb52f01f1 - <unknown>
  15:     0x556bb52cfbfc - <unknown>
  16:     0x556bb52dc438 - <unknown>
  17:     0x556bb52fb513 - <unknown>
  18:     0x556bb52c99a9 - <unknown>
  19:     0x556bb54b7b8d - <unknown>
  20:     0x556bb52dc505 - <unknown>
  21:     0x7fa1fb37ee08 - <unknown>
  22:     0x7fa1fb37eecc - __libc_start_main
  23:     0x556bb520d435 - <unknown>
  24:                0x0 - <unknown>

@TheKamboy
Copy link
Author

I haven't commented in a while since I had moved on from using cosmic (for now) but it seems like cosmic screenshot doesn't work with certain distributions of Arch Linux. I recently switched to Arch Craft, and cosmic screenshot works in cosmic there. I'm not sure if I should rename the issue to something like Cosmic Screenshot panics in certain Arch Distributions, or something else.

@drazil100
Copy link

For me it seems like it's intermittent on manjaro. It definitely wasn't working when I was using start-cosmic as opposed to cosmic-greeter, but now that I'm on cosmic-greeter it usually works. It depends on the day though. I have to reboot to fix it. Idk what's causing it.

@drazil100
Copy link

I got it! I figured out a reproduction case that works on the Pop!_OS 24.04 alpha!

  1. Boot up your system until you get to the cosmic-greeter login screen
  2. Switch to a tty
  3. Run a graphical program with cage (in my case cage alacritty)
  4. Close the program and log out of the tty entirely (doubt this step is required)
  5. Switch back to the cosmic-greeter login screen and log in normally
  6. Try to take a screenshot.

cosmic-screenshot will panic any time you try to run it until you reboot.

I assume this is some sort of weird race condition where if something manages to insert itself inbetween boot and logging into cosmic cosmic-screenshot can't hook in properly. This would explain why there haven't really been reports of issues with it in the Pop alpha. My guess is that some session managers actually interfere with cosmic-screenshot.

It appears from what I can tell that cosmic-screenshot is highly sensitive to how you log into cosmic and what runs before logging into cosmic. Once you are in and cosmic-screenshot runs once it will continue working for the remainder of the session, but if it doesn't run it will continue not to run for the remainder of the session.

@ctrldemi
Copy link

Just experienced this issue on archlinux. It only shows up when starting cosmic from the tty with cosmic-session. When using cosmic-comp, cosmic-greeter or any other display manager to log in it initializes correctly and does not panic.

@WatchMkr WatchMkr modified the milestones: alpha 3, alpha 6 Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Post-Current-Alpha ToDo
Development

No branches or pull requests

9 participants