mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-10 20:45:38 +02:00
refix live/dead window handle conflict, assuming hwnd handle only uses 3 bytes
This commit is contained in:
parent
bcd23a31f2
commit
4fc6f7ad40
1 changed files with 7 additions and 7 deletions
|
@ -1176,7 +1176,9 @@ namespace PersistentWindows.Common
|
|||
{
|
||||
found_conflict = true;
|
||||
|
||||
IntPtr fake_hwnd = (IntPtr)(((ulong)fakeHwnd << 32) + (ulong)hwnd);
|
||||
IntPtr fake_hwnd = (IntPtr)((fakeHwnd << 24) | (uint)hwnd);
|
||||
if (fake_hwnd == hwnd)
|
||||
continue;
|
||||
|
||||
//replace prev zorder reference of dead hwnd with new fake_hwnd in monitorApplication
|
||||
foreach (var hw in monitorApplications[display_key].Keys)
|
||||
|
@ -1188,6 +1190,10 @@ namespace PersistentWindows.Common
|
|||
}
|
||||
}
|
||||
|
||||
//reindex
|
||||
deadApps[display_key][fake_hwnd] = deadApps[display_key][hwnd];
|
||||
deadApps[display_key].Remove(hwnd);
|
||||
|
||||
//replace prev zorder reference in deadApps as well
|
||||
foreach (var kd in deadApps[display_key].Keys)
|
||||
{
|
||||
|
@ -1196,12 +1202,6 @@ namespace PersistentWindows.Common
|
|||
if (deadApps[display_key][kd][i].PrevZorderWindow == hwnd)
|
||||
deadApps[display_key][kd][i].PrevZorderWindow = fake_hwnd;
|
||||
}
|
||||
|
||||
if (kd == hwnd)
|
||||
{
|
||||
deadApps[display_key][fake_hwnd] = deadApps[display_key][hwnd];
|
||||
deadApps[display_key].Remove(hwnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue