Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nwg-dock crashes if a floating window is split in sway; references compile-time directory #35

Closed
lilacpixel opened this issue May 15, 2023 · 5 comments

Comments

@lilacpixel
Copy link

Describe the bug
If a floating window is split horizontally or vertically, nwg-dock crashes with the following output:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5ebcb9]

goroutine 35 [running]:
main.createTask(...)
	/home/cari/Downloads/nwg-dock/tools.go:235
main.listTasks()
	/home/cari/Downloads/nwg-dock/tools.go:209 +0xc79
main.getTaskChangesChannel.func2()
	/home/cari/Downloads/nwg-dock/tools.go:98 +0x4c
created by main.getTaskChangesChannel
	/home/cari/Downloads/nwg-dock/tools.go:95 +0x125

It's referencing the folder where I compiled the application, which, of course, no longer exists. I'm not sure why it might still be trying to access anything in this folder after compiling and installing.

The same crash occurs when attempting to launch nwg-dock when a split floating window already exists.

To Reproduce

  1. Launch nwg-dock.
  2. Open a floating window in sway.
  3. Split the window either horizontally or vertically.
  4. nwg-dock crashes.

Expected behavior
nwg-dock should not crash, nor should it attempt to access the compile-time directory after being compiled and installed.

Desktop (please complete the following information):

  • Fedora Linux 38
  • go 1.20.3
  • gtk-layer-shell 0.8.1-1

Thanks for taking a look! ☺️

nwg-piotr added a commit that referenced this issue May 15, 2023
@nwg-piotr
Copy link
Owner

nwg-piotr commented May 15, 2023

It looks like a bug in the go-sway library. A floating node treated this way (at least viewed through go-sway) no longer has AppID or PID, and my code was not ready for this. I added a workaround, that skips such tasks while crating the task list. They will be invisible to the dock, however.

@nwg-piotr
Copy link
Owner

Could you build and install from the fix35 branch, and tell me how it behaves on your side?

@lilacpixel
Copy link
Author

fix35 branch is working perfectly! I don't use floating windows in this way very often—just a weird edge case that I thought was worth reporting, but it's awesome to have it fixed so quickly! Thank you so much! As a macOS switcher, I couldn't be more thrilled to have a beautiful dock like this for sway 😸

@nwg-piotr
Copy link
Owner

Haha! I admit it gave me a headache. But I fixed 2 more issues by the way.

As a macOS switcher, I couldn't be more thrilled to have a beautiful dock like this for sway

There's also a Hyprland version. After years on sway, I finally find Hyprland more flexible. All my stuff is currently being ported to Hyprland, most part is ready to use.

@nwg-piotr
Copy link
Owner

BTW: pull the latest commits, just in case you're out of date. I'm not merging tonight, it needs some more testing.

@nwg-piotr nwg-piotr mentioned this issue May 16, 2023
nwg-piotr added a commit that referenced this issue May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants