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 {
66
66
LONG l = 8 ;
67
67
LONG t = 8 ;
68
68
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);
70
75
if (monitor != NULL ) {
71
76
MONITORINFO monitorInfo;
72
77
monitorInfo.cbSize = sizeof (MONITORINFO);
You can’t perform that action at this time.
0 commit comments