added nonblocking mode for windows imeplementation
This commit is contained in:
15
tray.h
15
tray.h
@@ -236,12 +236,17 @@ static int tray_init(struct tray *tray) {
|
|||||||
|
|
||||||
static int tray_loop(int blocking) {
|
static int tray_loop(int blocking) {
|
||||||
MSG msg;
|
MSG msg;
|
||||||
if (GetMessage(&msg, NULL, 0, 0)) {
|
if (blocking) {
|
||||||
TranslateMessage(&msg);
|
GetMessage(&msg, NULL, 0, 0);
|
||||||
DispatchMessage(&msg);
|
} else {
|
||||||
return 0;
|
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) {
|
static void tray_update(struct tray *tray) {
|
||||||
|
|||||||
Reference in New Issue
Block a user