Repository navigation
Remove system-wide EVENT_OBJECT_LOCATIONCHANGE occlusion hook and install occlusion hooks lazily - #97
Merged
Conversation
…tall occlusion hooks lazily
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the Windows drag-resize cursor lag reported in libnativeapi/nativeapi#40:
EVENT_OBJECT_LOCATIONCHANGEWinEvent hook (src/platform/windows/window_manager_windows.cpp):EVENT_OBJECT_LOCATIONCHANGEon every cursor move (OBJID_CURSOR) and every window move across all processes, flooding Flutter's platform/UI thread during the modal resize loop.EVENT_SYSTEM_MOVESIZEEND(fires once when another process's window finishes an interactive move/resize, never on cursor moves) plusScheduleOcclusionRefresh()fromOnWindowChangedwhen our own process's windows move or resize programmatically.WindowManager():WindowManager::Impl::SetOcclusionTrackingEnabled(bool)called fromStartEventListening()(0→1 listener transition) andStopEventListening()(1→0 listener transition), marshaled to the observation thread.WindowManager::GetCurrent()/ command-channel setters without listeners no longer install any system-wide occlusion WinEvent hooks;Window::GetOcclusionState()computes occlusion on demand and is unaffected.Related to libnativeapi/nativeapi#40.
Verification
window_occlusion_test: 10/10 PASS (showing, covering, moving cover away/back, hiding cover, minimizing, restoring, hiding).window_cross_thread_dialog_windows_test,window_startup_maximize_windows_test,window_property_changed_test,window_close_windows_test,window_manager_ui_thread_windows_test).