From 8bb7b5cceaaf96a5dd6321d35aae28748896d87b Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 22 Aug 2020 19:44:49 +0200 Subject: Added *very* basic polling ipc --- apps/wm.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'apps/wm.c') diff --git a/apps/wm.c b/apps/wm.c index f3ac901..5896e92 100644 --- a/apps/wm.c +++ b/apps/wm.c @@ -34,9 +34,21 @@ int main(int argc, char **argv) gui_init("/font/spleen-16x32.psfu"); gui_write(vbe, 50, 50, text, "hallo"); - event_map(EVENT_KEYBOARD, onkey); - - while (1) { + //event_map(EVENT_KEYBOARD, onkey); // TODO: Fix events + + struct message *msg; + while (1) { // TODO: Remove continuous polling? + if (!(msg = msg_receive())) + continue; + + switch (msg->type) { + case MSG_NEW_WINDOW: + printf("New window for pid %d\n", msg->src); + break; + default: + printf("Unknown WM request!"); + } }; + return 0; } -- cgit v1.2.3