Skip to content

Commit

Permalink
Fix possible nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Oct 9, 2024
1 parent 0c0006b commit 7652c1c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/x11/win/frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,10 @@ func (f *frame) topRightPixelWidth() uint16 {
screen := fynedesk.Instance().Screens().ScreenForWindow(f.client)
scale := screen.CanvasScale()

iconPix := x11.ButtonWidth(x11.XWin(f.client))
iconPix := uint16(0)
if f.client.Properties().Icon() != nil {
iconPix = x11.ButtonWidth(x11.XWin(f.client))
}
iconAndBorderPix := iconPix + x11.BorderWidth(x11.XWin(f.client))*2 + uint16(theme.Padding()*scale)
if fynedesk.Instance().Settings().BorderButtonPosition() == "Right" {
iconAndBorderPix = 3*iconAndBorderPix - uint16(theme.Padding()*scale)
Expand Down

0 comments on commit 7652c1c

Please sign in to comment.