nwg-piotr / nwg-drawer

Application drawer for wlroots-based Wayland compositors
MIT License
256 stars 27 forks source link

Cannot launch chrome apps #11

Closed gouvinb closed 3 years ago

gouvinb commented 3 years ago

Description

When I launch a chrome app like Stadia or Youtube Music via nwg-drawer, I get a panic error.

System informations

OS: Arch Linux x86_64
Host: 20HFCTO1WW ThinkPad T470s
Kernel: 5.13.9-arch1-1
Shell: zsh 5.8
Resolution: 1920x1080
WM: sway
Terminal: alacritty
CPU: Intel i7-7500U (4) @ 3.500GHz
GPU: Intel HD Graphics 620
Memory: 15901MiB

Step to reproduce

Preparation

  1. Launch Chrome
  2. Install an PWA like Stadia or Youtube Music

Reproduce error

  1. Run nwg-drawer (I tested with these 2 commands: nwg-drawer and nwg-drawer -o 1 -fm nautilus -ovl)
  2. Select a chrome app

Log

lang: fr_FR
Found 0 pinned items
Found 221 desktop files
Skipped 49 duplicates; 63 .desktop entries hidden by "NoDisplay=true"

UI created in 444 ms. Thank you for your patience.
panic: runtime error: slice bounds out of range [4:3] [recovered]
    panic: closure error: unexpected panic caught: runtime error: slice bounds out of range [4:3]

Closure added at:
    main.flowBoxButton at command-line-arguments/uicomponents.go:254
    main.setUpAppsFlowBox at command-line-arguments/uicomponents.go:202
    main.main at command-line-arguments/main.go:326

goroutine 1 [running]:
github.com/gotk3/gotk3/internal/closure.FuncStack.Panicf(0x557c20bad580, 0xc0001443c0, 0x13, 0xc000121de8, 0x3, 0x3, 0x557c20b265fd, 0x1b, 0xc00021f260, 0x1, ...)
    github.com/gotk3/gotk3@v0.6.0/internal/closure/funcstack.go:116 +0xb1f
github.com/gotk3/gotk3/internal/closure.FuncStack.TryRepanic(0x557c20bad580, 0xc0001443c0, 0x13, 0xc000121de8, 0x3, 0x3)
    github.com/gotk3/gotk3@v0.6.0/internal/closure/funcstack.go:134 +0xfb
panic(0x557c20bcf4c0, 0xc000148150)
    runtime/panic.go:965 +0x1b9
main.launch(0xc0002aa06c, 0x66, 0x0)
    command-line-arguments/tools.go:599 +0x80a
main.flowBoxButton.func1(0xc000119290, 0xc00014a5f8, 0x0)
    command-line-arguments/uicomponents.go:257 +0xb0
reflect.Value.call(0x557c20bad580, 0xc0001443c0, 0x13, 0x557c20b20223, 0x4, 0xc000144b10, 0x2, 0x2, 0x16, 0x7f331effc678, ...)
    reflect/value.go:476 +0x8e7
reflect.Value.Call(0x557c20bad580, 0xc0001443c0, 0x13, 0xc000144b10, 0x2, 0x2, 0xc00014a5f8, 0x16, 0x0)
    reflect/value.go:337 +0xb9
github.com/gotk3/gotk3/glib.goMarshal(0x7f3314e49350, 0x7f331effc600, 0x2, 0x7f331effc660, 0x7f331effc5e0, 0x0)
    github.com/gotk3/gotk3@v0.6.0/glib/glib.go:271 +0xb71
github.com/gotk3/gotk3/gtk._Cfunc_gtk_main()
    _cgo_gotypes.go:17413 +0x3e
github.com/gotk3/gotk3/gtk.Main(...)
    github.com/gotk3/gotk3@v0.6.0/gtk/gtk.go:1241
main.main()
    command-line-arguments/main.go:363 +0x1330
nwg-piotr commented 3 years ago

Thank you for reporting. I'll take a look at the issue as soon as I'm back home (this weekend).

nwg-piotr commented 3 years ago

Could you build from the chrome branch and check if it works for you?

gouvinb commented 3 years ago

Could you build from the chrome branch and check if it works for you?

It's good for me, thank you

nwg-piotr commented 3 years ago

Thanks!

Hikandy commented 3 years ago

facing the same issue here, not able to open prospect-mail which a chrome app of outlook. Using archlinux

nwg-piotr commented 3 years ago

Please run nwg-drawer from the terminal, click the icon of the program that does not start, and provide the output from the terminal. Also please paste the content of the prospect-mail's .desktop file, if you can.

nwg-piotr commented 3 years ago

Alright, I installed ProspectMail form AUR. The Exec line includes a space in path:

Exec="/opt/Prospect Mail/prospect-mail" %U

In go we can not just execute a whole command as is. It must be parsed to:

  1. array containing environment variables,
  2. the command itself,
  3. array with arguments.

This line is being parsed to /opt/Prospect (command) and Mail/prospect-mail (argument). I see no easy way for the program to guess all the possible packagers' intentions. However, there's a symlink /usr/local/bin/prospect-mail that we can use.

Steps:

  1. Copy /usr/share/applications/prospect-mail.desktop to ~/.local/share/applications/
  2. edit the Exec= line for it to look like this:
Exec="/usr/local/bin/prospect-mail" %U
  1. save the file.