reduce cpu load on non-window object

This commit is contained in:
Kang Yu 2025-04-27 14:56:03 -07:00
parent 9224d62191
commit d36bf0c56c

View file

@ -1861,6 +1861,10 @@ namespace PersistentWindows.Common
if (hwnd == IntPtr.Zero) if (hwnd == IntPtr.Zero)
return; return;
if (idObject != 0)
// ignore non-window object (caret etc)
return;
{ {
switch (eventType) switch (eventType)
{ {
@ -1882,12 +1886,6 @@ namespace PersistentWindows.Common
if (eventType == User32Events.EVENT_OBJECT_DESTROY) if (eventType == User32Events.EVENT_OBJECT_DESTROY)
{ {
if (idObject != 0)
{
// ignore non-window object (caret etc)
return;
}
noRestoreWindows.Remove(hwnd); noRestoreWindows.Remove(hwnd);
debugWindows.Remove(hwnd); debugWindows.Remove(hwnd);
if (fullScreenGamingWindows.Contains(hwnd)) if (fullScreenGamingWindows.Contains(hwnd))