app: [Windows] simplify GetWindowRect, delete old workaround

Go issue #34474 was fixed in 1.14 and backported to 1.13.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-02-13 18:03:14 +00:00
parent 3eeb08b4a1
commit cffa748c6a
2 changed files with 6 additions and 22 deletions
+2 -4
View File
@@ -190,8 +190,7 @@ func createNativeWindow() (*window, error) {
// If anything has changed it emits a ConfigEvent to notify the application.
func (w *window) update() {
var triggerEvent bool
var r windows.Rect
windows.GetWindowRect(w.hwnd, &r)
r := windows.GetWindowRect(w.hwnd)
size := image.Point{
X: int(r.Right - r.Left - w.deltas.width),
Y: int(r.Bottom - r.Top - w.deltas.height),
@@ -607,8 +606,7 @@ func (w *window) Configure(options []Option) {
width := int32(w.config.Size.X)
height := int32(w.config.Size.Y)
// Get the current window size and position.
var wr windows.Rect
windows.GetWindowRect(w.hwnd, &wr)
wr := windows.GetWindowRect(w.hwnd)
// Set desired window size.
wr.Right = wr.Left + width
wr.Bottom = wr.Top + height