fix disable window resize (#2863)

* fix disable window resize

* change issue number in changelog

* change pull request number in changelog
This commit is contained in:
Zámbó, Levente
2023-08-28 08:40:28 +10:00
committed by GitHub
parent 72290a2d58
commit 427e41f190
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -110,7 +110,7 @@ func NewWindow(appoptions *options.App, debug bool, devtools bool) *Window {
// Setup window
result.SetKeepAbove(appoptions.AlwaysOnTop)
result.SetResizable(!appoptions.DisableResize)
result.SetSize(appoptions.Width, appoptions.Height)
result.SetDefaultSize(appoptions.Width, appoptions.Height)
result.SetDecorated(!appoptions.Frameless)
result.SetTitle(appoptions.Title)
result.SetMinSize(appoptions.MinWidth, appoptions.MinHeight)
@@ -315,6 +315,10 @@ func (w *Window) SetResizable(resizable bool) {
C.gtk_window_set_resizable(w.asGTKWindow(), gtkBool(resizable))
}
func (w *Window) SetDefaultSize(width int, height int) {
C.gtk_window_set_default_size(w.asGTKWindow(), C.int(width), C.int(height))
}
func (w *Window) SetSize(width int, height int) {
C.gtk_window_resize(w.asGTKWindow(), C.gint(width), C.gint(height))
}
+1 -1
View File
@@ -24,7 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix issue where app would exit before main() on linux if $DISPLAY env var was not set. Fixed by @phildrip in [PR](https://github.com/wailsapp/wails/pull/2841)
- Fixed a race condition when positioning the window on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2850)
- Fixed `SetBackgroundColour` so it sets the window's background color to reduce resize flickering on Linux. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2853)
- Fixed disable window resize option and wrong initial window size when its enabled. Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2863)
### Added