diff --git a/panda/src/tform/mouseWatcher.cxx b/panda/src/tform/mouseWatcher.cxx index 9344d51d7d..74cb7692d3 100644 --- a/panda/src/tform/mouseWatcher.cxx +++ b/panda/src/tform/mouseWatcher.cxx @@ -726,6 +726,9 @@ clear_current_regions() { MouseWatcherRegion *old_region = (*old_ri); old_region->exit_region(param); throw_event_pattern(_leave_pattern, old_region, ButtonHandle::none()); + if (_preferred_region == old_region) { + _preferred_region = nullptr; + } ++old_ri; }