File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,12 @@ class WindowManagerPlugin : public flutter::Plugin {
6666 LONG l = 8 ;
6767 LONG t = 8 ;
6868
69- HMONITOR monitor = MonitorFromWindow (hwnd, MONITOR_DEFAULTTONEAREST);
69+ // 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);
7075 if (monitor != NULL ) {
7176 MONITORINFO monitorInfo;
7277 monitorInfo.cbSize = sizeof (MONITORINFO);
You can’t perform that action at this time.
0 commit comments