From b032fc8baf684bd06e7f46fb2bd393fe3caf12d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Isager=20Dalsgar=C3=B0?= Date: Wed, 21 Oct 2026 12:22:47 +0200 Subject: [PATCH] Post macOS events with `atStart = true` --- lib/darwin.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/darwin.js b/lib/darwin.js index c7c1820..c0d94a3 100644 --- a/lib/darwin.js +++ b/lib/darwin.js @@ -65,8 +65,10 @@ module.exports = class DarwinPointer { const window = view.window const point = view.convertPointToView(x, y, null) - AppKitApplication.postEvent(this._event(TYPE.LEFT_MOUSE_DOWN, window, point)) - AppKitApplication.postEvent(this._event(TYPE.LEFT_MOUSE_UP, window, point)) + // Ahead of anything already queued that could take the window off key, as + // the first press in a window that is not key only makes it key. + AppKitApplication.postEvent(this._event(TYPE.LEFT_MOUSE_UP, window, point), true) + AppKitApplication.postEvent(this._event(TYPE.LEFT_MOUSE_DOWN, window, point), true) } pending(view) {