1
0
forked from Yadciel/c_tray

Only process messages coming from the tray window. This avoids potential bugs where the tray loop would steal messages from other windows.

This commit is contained in:
Nicolas Burrus
2021-10-07 11:14:18 +02:00
committed by Dmitry Mikushin
parent 8dd1358b92
commit 08ac69e02a

4
tray.h
View File

@@ -319,9 +319,9 @@ static int tray_init(struct tray *tray) {
static int tray_loop(int blocking) { static int tray_loop(int blocking) {
MSG msg; MSG msg;
if (blocking) { if (blocking) {
GetMessage(&msg, NULL, 0, 0); GetMessage(&msg, hwnd, 0, 0);
} else { } else {
PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE);
} }
if (msg.message == WM_QUIT) { if (msg.message == WM_QUIT) {
return -1; return -1;