We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent db6e067 commit 42dcf64Copy full SHA for 42dcf64
windows/window_manager_plugin.cpp
@@ -66,7 +66,12 @@ class WindowManagerPlugin : public flutter::Plugin {
66
LONG l = 8;
67
LONG t = 8;
68
69
- HMONITOR monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
+ // HMONITOR monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
70
+ // Don't use `MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST)` above.
71
+ // Because if the window is restored from minimized state, the window is not in the correct monitor.
72
+ // The monitor is always the left-most monitor.
73
+ // https://github.com/leanflutter/window_manager/issues/489
74
+ HMONITOR monitor = MonitorFromRect(&sz->rgrc[0], MONITOR_DEFAULTTONEAREST);
75
if (monitor != NULL) {
76
MONITORINFO monitorInfo;
77
monitorInfo.cbSize = sizeof(MONITORINFO);
0 commit comments