mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-10 20:45:38 +02:00
#356, matching window title has higher priority than matching window position when inherit from killed window
This commit is contained in:
parent
c8575c1b03
commit
df594f6045
1 changed files with 7 additions and 3 deletions
|
@ -1349,17 +1349,21 @@ namespace PersistentWindows.Common
|
|||
if (!procName.Equals(appPos.ProcessName))
|
||||
continue;
|
||||
|
||||
// match position first
|
||||
RECT r = appPos.ScreenPosition;
|
||||
RECT rect = new RECT();
|
||||
User32.GetWindowRect(hwnd, ref rect);
|
||||
if (rect.Equals(r))
|
||||
// find exact match first
|
||||
if (rect.Equals(r) && title.Equals(appPos.Title))
|
||||
return kid;
|
||||
|
||||
// lastly match title
|
||||
// match title second
|
||||
if (title.Equals(appPos.Title))
|
||||
return kid;
|
||||
|
||||
// match position last
|
||||
if (rect.Equals(r))
|
||||
return kid;
|
||||
|
||||
if (dflt_kid == IntPtr.Zero)
|
||||
dflt_kid = kid;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue