Repository navigation
native/macos: moving the window doesn't send window_minimized_event - #708
nivaldomcj wants to merge 1 commit into
Conversation
window_did_move sent window_minimized_event, but nothing on that path sends window_restored_event: only window_did_become_key does, and a moved window never stops being the key window. Dragging the window therefore left apps that pause on window_minimized_event paused until the window lost and regained focus. Real focus loss is still reported by window_did_resign_key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hi! If you are asking about the PR it was a building block to fix a sticky key bug in macroquad. If the window lost focus while a key was held, the app would consider the key held down until you gave the window the focus back and pressed it again. I don't remember working with any "on move" events or anything like that |
|
Thanks for the quick answer! It did come in with #552, though: the The sticky-key fix doesn't depend on it. Focus loss and regain still come from |
window_did_movesendswindow_minimized_event, but nothing on that path sendswindow_restored_event: onlywindow_did_become_keydoes, and a window that was just dragged is still the key window. So after a plain drag, or a move to another display, an app that pauses onwindow_minimized_eventstays paused until the window loses focus and gets it back. I hit this in a game that stops its timer on minimize.This PR removes the event from
window_did_moveand keeps thegl_contextupdate. Focus loss is still reported bywindow_did_resign_key, and minimizing the window also resigns key, so that's still reported too.I tested it on macOS with a small program that logs both events while it runs these steps:
setFrameOrigin:(still the key window)miniaturize:, thendeminiaturize:Tested on macOS 27.2.1 (26B131), Apple M3 Max (arm64), Rust 1.100.0.
cargo build --all-targetspasses for aarch64-apple-darwin and x86_64-apple-darwin, andcargo check --all-targetsfor aarch64-apple-ios and x86_64-apple-ios.The move case came in with #552, which made these events mean focus lost and gained on macOS. @InnocentusLime, was there a reason to send it on move as well? If there's a case I'm missing, I'm happy to rework this.