From 08ac69e02a5731d13ac17958b54bb945d5a95aae Mon Sep 17 00:00:00 2001 From: Nicolas Burrus Date: Thu, 7 Oct 2021 11:14:18 +0200 Subject: [PATCH] Only process messages coming from the tray window. This avoids potential bugs where the tray loop would steal messages from other windows. --- tray.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tray.h b/tray.h index 4ba47ea..86356db 100644 --- a/tray.h +++ b/tray.h @@ -319,9 +319,9 @@ static int tray_init(struct tray *tray) { static int tray_loop(int blocking) { MSG msg; if (blocking) { - GetMessage(&msg, NULL, 0, 0); + GetMessage(&msg, hwnd, 0, 0); } else { - PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); + PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE); } if (msg.message == WM_QUIT) { return -1;