flathub / org.electronjs.Electron2.BaseApp

7 stars 16 forks source link

Add libunity #55

Closed JakobDev closed 8 months ago

JakobDev commented 8 months ago

libunity is complete outdated, so it's a nightmare to build. It is needed by Electron for setProgressBar and setBadgeCount. You can use this example code to test it out.

The app need the --socket=session-bus permission for some reason. You actually just need to emit a DBus signal, which should work without any permission.

A big problem is, that this API uses the desktop file name. You need to set desktopName field in the package.json to the correct name, otherwise it uses the name if the App, which is not the Flatpak ID. So this will cause problems when repacking existing binaries. I ping @refi64. Maybe he has a Idea what to do about that.

Packagers should also set the StartupWMClass field in the desktop entry, otherwise the desktop file can't be connected to the App.

Another problem is, that Electron checks for some reason the current desktop. This is supported by more Desktops e.g. Mate as the ones Electron checks, so packages should overwrite the XDG_CURRENT_DESKTOP environment variable to make it work on every desktop.

This PR is heavily based on this PR here and the AUR packages of the used software.

For reference: flathub/com.discordapp.Discord#228 Heroic-Games-Launcher/HeroicGamesLauncher#3478

flathubbot commented 8 months ago

Started test build 96902

flathubbot commented 8 months ago

Build 96902 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/79664/org.electronjs.Electron2.BaseApp.flatpakref
Erick555 commented 8 months ago

The app need the --socket=session-bus permission for some reason.

Does it make sense then when flathub won't allow that?

JakobDev commented 8 months ago

Does it make sense then when flathub won't allow that?

You need to access a exception, if you want to use this Feature.

Erick555 commented 8 months ago

I don't think you'll be allowed for --socket=session-bus exception on flathub therefore this may be unusable.

bbhtt commented 8 months ago

Seems fine as long as it continues to build with newer runtimes and works with apps. If it fails to build at some point it has to be removed for obvious reasons.

But socket=session-bus just for notification badges makes no sense and won't be allowed on apps.

This does not make it completely useless just changes the default. (Or the specific permission needed should be investigated)

JakobDev commented 8 months ago

Turns out I'm dumb. While trying the Permissions out I occidentally used the System Bus instead of the Session Bus in Flatseal, so I couldn't get it to world. Looks like you just need --talk=com.canonical.Unity. Sorry for that.

Seems fine as long as it continues to build with newer runtimes and works with apps.

I would be far better, if Electron would just use the DBus Interface directly instead of relying n an outdated lib, but as building Electron also requires building Chromium, I'm not the one going to make the PR.

flathubbot commented 8 months ago

Started test build 98133

flathubbot commented 8 months ago

Build 98133 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/80911/org.electronjs.Electron2.BaseApp.flatpakref
JakobDev commented 8 months ago

@TingPing Can you merge this?

TingPing commented 8 months ago

I'll merge this but you do understand it will break every single runtime update. You're responsible for it now. It will just be removed if it blocks future versions.

flathubbot commented 8 months ago

Started test build 98178

flathubbot commented 8 months ago

Build 98178 failed

flathubbot commented 8 months ago

Started test build 98180

JakobDev commented 8 months ago

It will just be removed if it blocks future versions.

As this lib is optional and in a extra file, it can just be commented out until a solution is found

flathubbot commented 8 months ago

Build 98180 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/80958/org.electronjs.Electron2.BaseApp.flatpakref