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

[Screencopy] value NotPresent #67

Open
SergioRibera opened this issue Jul 23, 2024 · 5 comments
Open

[Screencopy] value NotPresent #67

SergioRibera opened this issue Jul 23, 2024 · 5 comments

Comments

@SergioRibera
Copy link

I am trying to use the cosmic portal and I get this interesting error. Maybe I should open a similar issue in the cosmic protocol repository? 🤔

[2024-07-23T19:11:28Z DEBUG i18n_embed] Attempting to load language file: "en/xdg_desktop_portal_cosmic.ftl"
[2024-07-23T19:11:28Z DEBUG i18n_embed::fluent] Loaded language file: "en/xdg_desktop_portal_cosmic.ftl" for language: "en"
[2024-07-23T19:11:28Z INFO  i18n_embed::requester] Current Locale: [LanguageIdentifier { language: Language(Some("en")), script: None, region: Some(Region("US")), variants: None }]
[2024-07-23T19:11:28Z DEBUG i18n_embed] Selecting translations for domain "xdg_desktop_portal_cosmic"
[2024-07-23T19:11:28Z DEBUG i18n_embed] Searching for available languages, found language file: "en/xdg_desktop_portal_cosmic.ftl"
[2024-07-23T19:11:28Z DEBUG i18n_embed] Searching for available languages, found language file: "it/xdg_desktop_portal_cosmic.ftl"
[2024-07-23T19:11:28Z DEBUG i18n_embed] Searching for available languages, found language file: "pl/xdg_desktop_portal_cosmic.ftl"
[2024-07-23T19:11:28Z DEBUG i18n_embed] Searching for available languages, found language file: "ru/xdg_desktop_portal_cosmic.ftl"
[2024-07-23T19:11:28Z DEBUG i18n_embed] Searching for available languages, found language file: "sr-Cyrl/xdg_desktop_portal_cosmic.ftl"
[2024-07-23T19:11:28Z DEBUG i18n_embed] Searching for available languages, found language file: "sr-Latn/xdg_desktop_portal_cosmic.ftl"
[2024-07-23T19:11:28Z DEBUG i18n_embed] Searching for available languages, found language file: "tr/xdg_desktop_portal_cosmic.ftl"
[2024-07-23T19:11:28Z DEBUG i18n_embed] Requested Languages: [LanguageIdentifier { language: Language(Some("en")), script: None, region: Some(Region("US")), variants: None }]
[2024-07-23T19:11:28Z DEBUG i18n_embed] Available Languages: [LanguageIdentifier { language: Language(Some("en")), script: None, region: None, variants: None }, LanguageIdentifier { language: Language(Some("it")), script: None, region: None, variants: None }, LanguageIdentifier { language: Language(Some("pl")), script: None, region: None, variants: None }, LanguageIdentifier { language: Language(Some("ru")), script: None, region: None, variants: None }, LanguageIdentifier { language: Language(Some("sr")), script: Some(Script("Cyrl")), region: None, variants: None }, LanguageIdentifier { language: Language(Some("sr")), script: Some(Script("Latn")), region: None, variants: None }, LanguageIdentifier { language: Language(Some("tr")), script: None, region: None, variants: None }]
[2024-07-23T19:11:28Z DEBUG i18n_embed] Supported Languages: [LanguageIdentifier { language: Language(Some("en")), script: None, region: None, variants: None }]
[2024-07-23T19:11:28Z DEBUG i18n_embed] Attempting to load language file: "en/xdg_desktop_portal_cosmic.ftl"
[2024-07-23T19:11:28Z DEBUG i18n_embed::fluent] Loaded language file: "en/xdg_desktop_portal_cosmic.ftl" for language: "en"
[2024-07-23T19:11:28Z TRACE calloop::loop_logic] [calloop] Inserting new source #0
[2024-07-23T19:11:28Z TRACE calloop::loop_logic] [calloop] Inserting new source #1
[2024-07-23T19:11:28Z TRACE calloop::loop_logic] [calloop] Inserting new source #2
[2024-07-23T19:11:28Z DEBUG sctk] Bound new global [32] wl_seat v7
[2024-07-23T19:11:28Z DEBUG sctk] Bound new global [37] wl_output v4
[2024-07-23T19:11:28Z DEBUG sctk] Bound new global [38] wl_output v4
[2024-07-23T19:11:28Z DEBUG sctk] Bound new global [9] zxdg_output_manager_v1 v3
[2024-07-23T19:11:28Z TRACE mio::poll] registering event source with poller: token=Token(1), interests=READABLE
[2024-07-23T19:11:28Z TRACE mio::poll] registering event source with poller: token=Token(94064979040768), interests=READABLE | WRITABLE
[2024-07-23T19:11:28Z WARN  xdg_desktop_portal_cosmic::wayland] Failed to find `PORTAL_WAYLAND_SOCKET`; trying default Wayland display
thread 'main' panicked at /build/cargo-vendor-dir/cosmic-client-toolkit-0.1.0/src/screencopy.rs:106:62:
called `Result::unwrap()` on an `Err` value: NotPresent
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2024-07-23T19:11:28Z TRACE mio::poll] deregistering event source from poller

Note

I have to say that it is probably my fault as I am running it in an environment without the session being managed by cosmic.

Details of my operating system:

OS: NixOs unstable ( nixpkgs commit )
WM: Niri - Wayland
Cosmic XDG Portal: commit 016af6
Cosmic xdg portal pkg: my custom pkg from nixos-cosmic

Important

Let me know if I can help with any other information.

@Drakulix
Copy link
Member

This error indicates the required protocols aren't available.

I have to say that it is probably my fault as I am running it in an environment without the session being managed by cosmic.

The screencopy-protocol is considered privileged by cosmic-comp, as such it is only available for binaries launched through cosmic-session. So whatever you exactly referring to as "not being managed by cosmic", that is very likely to cause this issue.

@SergioRibera
Copy link
Author

This error indicates the required protocols aren't available.

What protocol do you need?

The screencopy-protocol is considered privileged by cosmic-comp, as such it is only available for binaries launched through cosmic-session. So whatever you exactly referring to as "not being managed by cosmic", that is very likely to cause this issue.

It makes sense, it's a pity because the cosmic portal is very nice and I wanted to use it.

@Drakulix
Copy link
Member

Drakulix commented Jul 25, 2024

This error indicates the required protocols aren't available.

What protocol do you need?

cosmic-screencopy atm. We are working on the upstream draft for ext-screencopy. Once that is merged and we updated our compositor and portal, it should start working on non-cosmic environments that implement it.

@SergioRibera
Copy link
Author

cosmic-screencopy atm. We are working on the upstream draft for ext-screencopy. Once that is merged and we updated our compositor and portal, it should start working on non-cosmic environments that implement it.

Ooooh, this is great, do you have a source or a task list, where I can check how to help?

@Drakulix
Copy link
Member

There isn't really anything to do at the moment.

The upstream process is almost done, with very few open discussion points. There aren't any further contributions needed nor endorsement for the idea. Merge should happen soon-ish and then we will need to wait for another wayland-protocol release. There are no fixed time-frames for this as this simply depends on specific contributors having enough time to handle these processes.

On COSMIC's side there is already a draft-implementation of the protocol. That will need to be updated, once all the naming of the upstream protocol is set in stone (so... once it is merged).

Then we will also need to update other cosmic-components to actually use the new protocol, though cosmic-screencopy and ext-screencopy will likely both exist in COSMIC for some time, so this will likely be a bit slower of a process as we don't have to update everything at once. At this point xdg-desktop-portal-cosmic can be updated as well to the new protocol.

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

2 participants