fynedesk icon indicating copy to clipboard operation
fynedesk copied to clipboard

Clicking on Firefox app does not start firefox

Open belkale opened this issue 3 years ago • 14 comments

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):

  • OS: Ubuntu Linux
  • Version: 22.04.1 LTS
  • Go version: 1.19.4
  • FyneDesk version: b6e12b57e7d4cd32303a7ec165a7451d33016636

belkale avatar Dec 23 '22 09:12 belkale

Firefox is installed as snap in my Ubuntu distribution.

belkale avatar Dec 23 '22 09:12 belkale

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

belkale avatar Dec 23 '22 11:12 belkale

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

Jacalz avatar Dec 23 '22 20:12 Jacalz

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.

belkale avatar Dec 24 '22 09:12 belkale

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.

Jacalz avatar Dec 24 '22 10:12 Jacalz

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 avatar Dec 26 '22 04:12 belkale

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 avatar Dec 26 '22 04:12 belkale

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 avatar Dec 26 '22 04:12 belkale

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 avatar Dec 26 '22 05:12 belkale

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

belkale avatar Dec 26 '22 05:12 belkale

has this issue been resolved?

mwenku avatar Dec 28 '22 17:12 mwenku

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.

Jacalz avatar Dec 28 '22 17:12 Jacalz

alright thank's will try to fix it

mwenku avatar Dec 28 '22 19:12 mwenku

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.

andydotxyz avatar Dec 30 '22 16:12 andydotxyz