Wails saves and restores in two different coordinate systems. WindowGetPosition
returns GetWindowRect — absolute. WindowSetPosition is winc's ControlBase.SetPos,
which adds the CURRENT monitor's work-area origin:
w32.SetWindowPos(hwnd, HWND_TOP, int(info.RcWork.Left)+x, ...)
On the primary monitor that origin is 0 and nothing shows. With a monitor to the
LEFT it compounds: a station with its left screen at x=-3840 saved -3844,
reopened there, had -3840 added, and stored -7684 — then -11524, one screen
further out at every launch, until the window was off the desktop entirely.
So the placement is done here, with SetWindowPos and no offset, falling back to
the toolkit when the handle cannot be found. Compact mode had the same pairing
and is fixed with it.
8 lines
240 B
Go
8 lines
240 B
Go
//go:build !windows
|
|
|
|
package main
|
|
|
|
// Placing a window at an absolute desktop coordinate is Windows-specific; every
|
|
// caller falls back to the toolkit's own call when this says no.
|
|
func setWindowPosAbsolute(x, y int) bool { return false }
|