FyshOS / fynedesk

A full desktop environment for Linux/Unix using Fyne
https://fyne.io/fynedesk/
Other
1.02k stars 47 forks source link

Clicking on Firefox app does not start firefox #232

Open belkale opened 1 year ago

belkale commented 1 year ago

Describe the bug:

Unable to start firefox by clicking on firefox app in app drawer

To Reproduce:

Steps to reproduce the behaviour:

  1. Click on username in bottom right
  2. Click on network to expand the dropdown
  3. Click on Firefox Web Browser
  4. Firefox does not start
  5. Following error is seen in ~/.cache/fyne/io.fyne.fynedesk/fynedesk.log

2022/12/23 14:54:56 At: /home/xxx/src/fynedesk/internal/x11/win/frame.go:282 2022/12/23 14:54:56 Fyne error: Put image error 2022/12/23 14:54:56 Cause: BadDrawable {NiceName: Drawable, Sequence: 6551, BadValue: 10497468, MinorOpcode: 0, MajorOpcode: 72} 2022/12/23 14:54:56 At: /home/xxx/src/fynedesk/internal/x11/win/frame.go:282 2022/12/23 14:54:56 Fyne error: X11 Error: 2022/12/23 14:54:56 Cause: BadGContext {NiceName: GContext, Sequence: 6558, BadValue: 10497470, MinorOpcode: 0, MajorOpcode: 62} 2022/12/23 14:54:56 At: /home/xxx/src/fynedesk/internal/x11/wm/desk.go:340

Device (please complete the following information):

belkale commented 1 year ago

Firefox is installed as snap in my Ubuntu distribution.

belkale commented 1 year ago

Same problem with Rhythmbox. Does not start from app launcher.

Jacalz commented 1 year ago

You mention that the applications are installed as snap packages (at least for the former)? Does this happen with apt or Flatpak packages too?

belkale commented 1 year ago

I havent tried with apt or Flatpak packages. Both Firefox and Rhythmbox came by default in my Ubuntu distribution and both dont seem to work with Fynedesk. However, if I run from a terminal both work even in Fynedesk.

Jacalz commented 1 year ago

It would be useful if you could try other package formats. That way we can narrow it down to see if it is snap specific.

belkale commented 1 year ago

I could locate the firefox desktop file. The exec path there is

Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/firefox_firefox.desktop /snap/bin/firefox -new-window

and based on

func (data *fdoApplicationData) Run(env []string) error

command would be first argument which is env. Could that be causing the problem?

belkale commented 1 year ago

Verified that having env in the beginning is the problem. Changed firefox desktop file and changed Exec to keep just /snap/bin/firefox and it worked fine.

It would be useful to add a debug level to fyne desktop and as part of debug print the current command being run.

belkale commented 1 year ago

In case of Rhythmbox, there are multiple Exec within desktop. First one is for starting Rhythmbox but the rest are for play/pause etc. But while reading we pick the last Exec and this makes the exec use the wrong command. Instead of rhythmbox, we use rhythmbox-client.

Exec=rhythmbox %U Exec=rhythmbox-client --play-pause Exec=rhythmbox-client --next Exec=rhythmbox-client --previous Exec=rhythmbox-client --quit

belkale commented 1 year ago

Desktop Spec file https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

Implementation in C https://stackoverflow.com/questions/2795309/how-do-you-parse-the-xdg-gnome-kde-menu-desktop-item-structure-in-c

belkale commented 1 year ago

Looks like there is a Go implementation https://code.rocketnine.space/tslocum/desktop

mwelwankuta commented 1 year ago

has this issue been resolved?

Jacalz commented 1 year ago

has this issue been resolved?

Not yet. The issue was opened just two days ago and there are no PRs or commits that mention fixing this yet.

mwelwankuta commented 1 year ago

alright thank's will try to fix it

andydotxyz commented 1 year ago

Thanks. The code should be limited to the xdg code, as we have "app launcher" abstraction and this just refers to the .desktop spec. Do jump on to #fynedesk on Gophers Slack if you wish to chat further.