From 98e4aea831eddb8b065c19622b09cc522d77fb0e Mon Sep 17 00:00:00 2001 From: koekeishiya Date: Mon, 15 Jun 2020 20:11:30 +0200 Subject: [PATCH] #545 properly populate window location when synthesizing autofocus event --- src/window_manager.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/window_manager.c b/src/window_manager.c index d76593e9..f1369972 100644 --- a/src/window_manager.c +++ b/src/window_manager.c @@ -749,21 +749,28 @@ static void window_manager_defer_window_raise(ProcessSerialNumber *window_psn, u static void window_manager_make_key_window(ProcessSerialNumber *window_psn, uint32_t window_id) { uint8_t bytes1[0xf8] = { - [0x04] = 0xF8, + [0x04] = 0xf8, [0x08] = 0x01, - [0x3a] = 0x10 + [0x3a] = 0x10, + [0x26] = 0xf0, + [0x27] = 0xbf, + [0x2e] = 0xf0, + [0x2f] = 0xbf }; uint8_t bytes2[0xf8] = { - [0x04] = 0xF8, + [0x04] = 0xf8, [0x08] = 0x02, - [0x3a] = 0x10 + [0x3a] = 0x10, + [0x26] = 0xf0, + [0x27] = 0xbf, + [0x2e] = 0xf0, + [0x2f] = 0xbf }; memcpy(bytes1 + 0x3c, &window_id, sizeof(uint32_t)); - memset(bytes1 + 0x20, 0xFF, 0x10); memcpy(bytes2 + 0x3c, &window_id, sizeof(uint32_t)); - memset(bytes2 + 0x20, 0xFF, 0x10); + SLPSPostEventRecordTo(window_psn, bytes1); SLPSPostEventRecordTo(window_psn, bytes2); }