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

Fix crash when no displays are detected #259

Merged

Conversation

msrd0
Copy link
Contributor

@msrd0 msrd0 commented Oct 22, 2024

Fixes #258

I have no idea why no displays are detected and whether this is the correct fix or just a workaround. But it works for me and I don't know anything about Go so this is about the best fix I can provide.

@mircearoata
Copy link
Member

Does this not result in the window constantly recentering itself, as it isn't overlapping the (0,0,0,0) range?

@msrd0
Copy link
Contributor Author

msrd0 commented Oct 22, 2024

@mircearoata I wouldn't know because windows don't get to choose their position and/or size. That's what tiling window managers do.

@msrd0
Copy link
Contributor Author

msrd0 commented Oct 22, 2024

Actually there's a bunch of warnings on the command line looking like

2024-10-22T15:49:36+02:00 WRN app/window.go:44 no displays found, cannot check if window is reachable

@mircearoata
Copy link
Member

Oh, I missed that bit in your issue. I couldn't reproduce this issue, but since getting the displays uses XGB (go equivalent of XCB), I'm guessing that in your particular setup XGB somehow fails to connect to XWayland.

Please fix the lint issues and then I can merge this.

@msrd0
Copy link
Contributor Author

msrd0 commented Oct 22, 2024

I'm guessing that in your particular setup XGB somehow fails to connect to XWayland.

Well, xrandr correctly identifies the screens, so I think it should work.

Please fix the lint issues and then I can merge this.

CI says

Error: File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/satisfactorymodding/SatisfactoryModManager) -s blank -s dot --custom-order (gci)

I have absolutely 0 idea what that means and what you want me to do.

@mircearoata
Copy link
Member

Run golangci-lint run --fix. But if you don't have golangci-lint installed, the issue is the indentation. It should be 2 tabs, but it's one tab and 3 spaces

@msrd0
Copy link
Contributor Author

msrd0 commented Oct 22, 2024

Yeah I don't have any editor with go integration, and emacs defaults to indent up to the first space when it doesn't know the language. I fixed the indentation.

@mircearoata mircearoata merged commit 56a7ee7 into satisfactorymodding:master Oct 22, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

SMM Crash on first launch: panic: runtime error: index out of range [0] with length 0
2 participants