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) {