diff --git a/lcl/include/windowmagnet.inc b/lcl/include/windowmagnet.inc index 8bb6cab728..a849d92494 100644 --- a/lcl/include/windowmagnet.inc +++ b/lcl/include/windowmagnet.inc @@ -202,6 +202,9 @@ begin for fi:= 0 to Screen.CustomFormCount - 1 do begin frm:= Screen.CustomForms[fi]; + if not frm.Visible then continue; + if frm.WindowState=wsMinimized then continue; + if frm.HandleAllocated then continue; if frm.Handle = WindowPos.hwnd then continue; if not frm.SnapOptions.SnapFormTarget then continue; if GetWindowRect(frm.Handle, br) = 0 then continue;