Coder Social home page Coder Social logo

Comments (12)

rafaelmardojai avatar rafaelmardojai commented on June 11, 2024

I probably could add more hints to the error, but it basically means that the portal is rejecting the background permission request (or xdp-desktop-portal is not even installed).

Speaking technically, ff no error is print in CLI then it means that the portal simply returned a false for the request or an Gio.IOErrorEnum.CANCELLED error was raised (in this context it means that the user cancelled the request).

Could you try going to GNOME Settings > Applications > Forge Sparks and see if the background permission is active? If is disabled enabled it and try again in the app.

from forge-sparks.

fnune avatar fnune commented on June 11, 2024
=> sudo apt install xdg-desktop-portal
[sudo] password for fausto:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
xdg-desktop-portal is already the newest version (1.18.0-1).
xdg-desktop-portal set to manually installed.

It was installed, it seems.

Looks like the permission was enabled:

image

from forge-sparks.

rafaelmardojai avatar rafaelmardojai commented on June 11, 2024

Hmm, seems odd. I can reproduce the failure If I disable Run in Background in GNOME Settings and it works again after re-enabling.

If it fails for you, then something strange is happening. You could try using Flatseal and use its reset permission button in Forge Sparks to fix any possible weirdness.

from forge-sparks.

fnune avatar fnune commented on June 11, 2024

I installed Flatseal and reset the permissions for Forge Sparks, and then gave it back the Background permission. The problem persists.

Happy to provide more technical info, but I don't know where to look to for logs.

from forge-sparks.

rafaelmardojai avatar rafaelmardojai commented on June 11, 2024

Thanks, seems a hard thing to debug 😅.

Can you give me info about your system setup? So I can try to setup a virtual machine and see if the problem is reproducible from there.

from forge-sparks.

fnune avatar fnune commented on June 11, 2024

Debian sid:

=> uname -a
Linux melian 6.5.0-1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.3-1 (2023-09-13) x86_64 GNU/Linux

=> cat /etc/apt/sources.list
deb http://deb.debian.org/debian/ sid main non-free-firmware contrib
deb-src http://deb.debian.org/debian/ sid main non-free-firmware contrib

I installed Flatpak/Flathub like so:

sudo apt install -y flatpak gnome-software-plugin-flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

from forge-sparks.

fnune avatar fnune commented on June 11, 2024

Forgot about this:

=> echo $XDG_SESSION_TYPE
x11

from forge-sparks.

fnune avatar fnune commented on June 11, 2024

I'm sure you already have this in mind, but just to be on the same page:

forge-sparks/src/util.js

Lines 40 to 75 in 5e36767

export function requestBackground(window, autostart=false, hidden=false) {
/* Try getting parent from window */
let parent = null;
try {
/* parent = XdpGtk4.parent_new_gtk(window); */
/* FIXME: gdk_wayland_toplevel_export_handle: assertion 'GDK_IS_WAYLAND_TOPLEVEL (toplevel)' failed */
} catch (error) {
logError(error);
}
return new Promise((resolve) => {
let command = ['forge-sparks'];
if (autostart && hidden)
command.push('--hidden');
portal.request_background(
parent,
(autostart) ? _('Allow running Forge Sparks on background.') : _('Allow running Forge Sparks on startup.'),
command,
(autostart) ? Xdp.BackgroundFlags.AUTOSTART : Xdp.BackgroundFlags.NONE,
null,
(_portal, result) => {
try {
const success = portal.request_background_finish(result);
resolve(success);
} catch (e) {
if (e.code !== Gio.IOErrorEnum.CANCELLED) {
logError(e);
}
resolve(false);
}
}
)
});
}

Perhaps e.code === Gio.IOErrorEnum.CANCELLED but the message is still interesting.

from forge-sparks.

rafaelmardojai avatar rafaelmardojai commented on June 11, 2024

Well, installed Debian, flatpak and Forge Sparks and everything worked fine.

The only likely difference with your setup is that I updated to sid after testing because I totally forgot 😅. But things still worked.

So this is really weird... Do you have xdg-desktop-portal-gnome installed right? I'm out of ideas. Have you tried uninstalling and installing it back removing ~/.var/app/com.mardojai.ForgeSparks in the process?

from forge-sparks.

rafaelmardojai avatar rafaelmardojai commented on June 11, 2024

Btw, also tried in the X11 session and all was fine.

from forge-sparks.

fnune avatar fnune commented on June 11, 2024

Okay! Installing xdg-desktop-portal-gnome and restarting my computer fixed it!

To confirm, I uninstalled the package and rebooted again, and Forge Sparks was broken.

Now I'm wondering why this package wasn't part of my installation from the beginning. This computer's Gnome was installed using the system installer that ships with Debian...

from forge-sparks.

fnune avatar fnune commented on June 11, 2024

Thank you for helping me figure this out.

from forge-sparks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.