diff options
author | Alexander Neumann <alexander.neumann@picos-software.com> | 2021-01-12 09:55:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 09:55:37 +0100 |
commit | c389da54e794a411ec9c9bfda01f2a0eb1b5a9b4 (patch) | |
tree | e7d55556fee9ad87a34fb41cd5eac768c6009df0 | |
parent | Merge branch 'zx2c4-forks-jd/recreate-tray' (diff) | |
parent | Adding name to AUTHORS (diff) | |
download | wireguard-windows-c389da54e794a411ec9c9bfda01f2a0eb1b5a9b4.tar.xz wireguard-windows-c389da54e794a411ec9c9bfda01f2a0eb1b5a9b4.zip |
Merge pull request #747 from evangwt/master
MainWindow: fix ignore WM_SIZE causes statusbar invisible when created
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | mainwindow.go | 21 |
2 files changed, 15 insertions, 7 deletions
@@ -36,3 +36,4 @@ Simon Rozman <simon@rozman.si> Tim Dufrane <tim.dufrane@gmail.com> Vincent Vanackere <vincent.vanackere@gmail.com> xoviat <xoviat@gmail.com> +evangwt <evangwt@gmail.com> diff --git a/mainwindow.go b/mainwindow.go index 2007ef34..4ac3a884 100644 --- a/mainwindow.go +++ b/mainwindow.go @@ -220,20 +220,27 @@ func (mw *MainWindow) SetFullscreen(fullscreen bool) error { func (mw *MainWindow) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr { switch msg { - case win.WM_WINDOWPOSCHANGED: - wp := (*win.WINDOWPOS)(unsafe.Pointer(lParam)) - - if wp.Flags&win.SWP_NOSIZE != 0 { - break + case win.WM_WINDOWPOSCHANGED, win.WM_SIZE: + if win.WM_WINDOWPOSCHANGED == msg { + wp := (*win.WINDOWPOS)(unsafe.Pointer(lParam)) + if wp.Flags&win.SWP_NOSIZE != 0 { + break + } } cb := mw.ClientBoundsPixels() if mw.toolBar != nil { - mw.toolBar.SetBoundsPixels(Rectangle{0, 0, cb.Width, mw.toolBar.HeightPixels()}) + bounds := Rectangle{0, 0, cb.Width, mw.toolBar.HeightPixels()} + if mw.toolBar.BoundsPixels() != bounds { + mw.toolBar.SetBoundsPixels(bounds) + } } - mw.statusBar.SetBoundsPixels(Rectangle{0, cb.Y + cb.Height, cb.Width, mw.statusBar.HeightPixels()}) + bounds := Rectangle{0, cb.Y + cb.Height, cb.Width, mw.statusBar.HeightPixels()} + if mw.statusBar.BoundsPixels() != bounds { + mw.statusBar.SetBoundsPixels(bounds) + } case win.WM_INITMENUPOPUP: mw.menu.updateItemsWithImageForWindow(mw) |