Skip to content

Commit

Permalink
TinyWL Server: Nil check xdgSurface in topLevelAt
Browse files Browse the repository at this point in the history
This can be Nil, To reproduce, run tinywl -s foot, then:

- Mouse over foot
- Mouse to the title bar decorations
- crash
jwijenbergh committed Mar 26, 2024
1 parent a5c17f7 commit 6ed0e6f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/tinywl/server.go
Original file line number Diff line number Diff line change
@@ -217,7 +217,11 @@ func (s *Server) topLevelAt(lx float64, ly float64) (*wlroots.XDGTopLevel, *wlro
/* Find the node corresponding to the tinywl_toplevel at the root of this
* surface tree, it is the only one for which we set the data field. */

topLevel := surface.XDGSurface().TopLevel()
xdgSurface := surface.XDGSurface()
if xdgSurface.Nil() {
return nil, nil, 0, 0
}
topLevel := xdgSurface.TopLevel()
slog.Debug("topLevelAt", "topLevel", topLevel)
slog.Debug("topLevelAt", "s.topLevelList.Len()", s.topLevelList.Len())

0 comments on commit 6ed0e6f

Please sign in to comment.