Suppress input during screenshot selection#385
Conversation
…g and layout refreshes during screenshot selection When macOS screenshot selection (Cmd+Shift+4) is active, OmniWM's CGEventTap continues intercepting all mouse events system-wide. Dragging the screenshot selection rectangle near tiled window edges causes windows to shift or resize, making screenshot capture unusable. Add screencapture process detection (com.apple.screencaptureui, com.apple.Screenshot) following the existing lock screen suppression pattern: - MouseEventHandler.isInputSuppressed now checks for frontmost screencapture app - LayoutRefreshController suppresses relayout/visibility refreshes during capture This prevents any OmniWM mouse-driven or layout-driven window management while the screenshot selection overlay is active. Fixes BarutSRB#254 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR adds screen-capture detection to prevent OmniWM from refreshing layouts or dispatching mouse events during screenshot operations. A new helper method checks if the frontmost app is screen-capturing, and this check is applied consistently across layout refresh paths and input handling to avoid window shifts during screenshot selection. ChangesScreen-capture operation suppression
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Note: This fix assumes Happy to investigate the CGS event path if this fix alone doesn't resolve the issue during testing. |
Summary
isInputSuppressedinMouseEventHandlerand lock screen guards inLayoutRefreshControllercom.apple.screencaptureuiandcom.apple.Screenshotbundle IDsFixes #254
Details
When screenshot selection is active, OmniWM's session-level CGEventTap continues intercepting all mouse events. Dragging the selection rectangle near tiled window edges causes windows to shift or resize. By detecting the screencapture process as the frontmost app and suppressing input handling + layout refreshes (the same approach used for lock screen), the windows remain stable during screenshot capture.
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes