Skip to content

Commit

Permalink
clamp window size
Browse files Browse the repository at this point in the history
  • Loading branch information
buck54321 committed May 9, 2023
1 parent 930a798 commit 56abb87
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion client/cmd/dexc-desktop/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,16 @@ func runWebview(url string) {
defer w.Destroy()
w.SetTitle("Decred DEX Client")
w.SetSize(600, 600, webview.HintMin)
w.SetSize(int(C.display_width()), int(C.display_height()), webview.HintNone)

width, height := int(C.display_width()), int(C.display_height())
if width <= 0 || width > 1920 {
width = 1920
}
if height <= 0 || height > 1080 {
height = 1080
}

w.SetSize(width, height, webview.HintNone)
w.Navigate(url)
w.Run()
}
Expand Down

0 comments on commit 56abb87

Please sign in to comment.