added nonblocking mode for windows imeplementation

This commit is contained in:
Serge A. Zaitsev
2017-01-09 15:51:06 +02:00
parent 00651bb416
commit 8a49d742e3

15
tray.h
View File

@@ -236,12 +236,17 @@ static int tray_init(struct tray *tray) {
static int tray_loop(int blocking) {
MSG msg;
if (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
return 0;
if (blocking) {
GetMessage(&msg, NULL, 0, 0);
} else {
PeekMessage(&msg, NULL, 0, 0, PM_REMOVE);
}
return -1;
if (msg.message == WM_QUIT) {
return -1;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
return 0;
}
static void tray_update(struct tray *tray) {