File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
IntelPresentMon/Core/source/kernel Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ namespace p2c::kern
112112 void OverlayContainer::RegisterWindowSpawn (DWORD pid, HWND hWnd, const RECT& r)
113113 {
114114 p2cvlog (procwatch).note (std::format (L" register-win-spawn-entry | hwn:{:8x}" , (uintptr_t )hWnd)).commit ();
115+ // update "main" window in ancestor map for related process
115116 // no need for mtx here since the window event listener runs on kernel thread (msg pump)
116117 if (auto i = ancestorMap.find (pid); i != ancestorMap.end ()) {
117118 const auto prevHwnd = i->second .hWnd ;
@@ -137,8 +138,9 @@ namespace p2c::kern
137138 // if an update occurred, consider retargetting process
138139 if (i->second .hWnd == hWnd) {
139140 // case when we are in root and hit a child spawn window of interest
140- if (pid != rootPid && curPid == rootPid) {
141- p2cvlog (procwatch).note (std::format (L" register-win-spawn-upg-root-to-child | hwn: {:5} => {:5}" , rootPid, pid)).commit ();
141+ // only migrate to child if window area is greater than 640x480
142+ if (pid != rootPid && curPid == rootPid && win::RectToDims (r).GetArea () >= (640 * 480 )) {
143+ p2cvlog (procwatch).note (std::format (L" register-win-spawn-upg-root-to-child | pid: {:5} => {:5}" , rootPid, pid)).commit ();
142144 curPid = pid;
143145 pOverlay = pOverlay->RetargetPidClone (i->second );
144146 }
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ namespace p2c::kern
1111{
1212 WindowSpawnHandler::WindowSpawnHandler (DWORD pid, OverlayContainer* pOverlay) : pid{ pid }, pOverlay{ pOverlay }
1313 {
14- p2cvlog (procwatch).note (std::format (L" win spawn handler ctor | pid:{:5x }" , pid)).commit ();
14+ p2cvlog (procwatch).note (std::format (L" win spawn handler ctor | pid:{:5 }" , pid)).commit ();
1515 }
1616
1717 win::EventHookHandler::Filter WindowSpawnHandler::GetFilter () const
You can’t perform that action at this time.
0 commit comments