Basic, non-working handling. GLHF
This commit is contained in:
parent
2e10b17c8e
commit
3e6eb120ed
2 changed files with 45 additions and 0 deletions
|
@ -127,6 +127,8 @@ main(int argc, char *argv[])
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handle_xcb_event(event);
|
||||||
|
|
||||||
free(event);
|
free(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,10 @@
|
||||||
|
|
||||||
#define ROOT_MASK ( XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT )
|
#define ROOT_MASK ( XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT )
|
||||||
|
|
||||||
|
static void handle_create_notify_event(xcb_create_notify_event_t *event);
|
||||||
|
static void handle_destroy_notify_event(xcb_destroy_notify_event_t *event);
|
||||||
|
static void handle_map_request_event(xcb_map_request_event_t *event);
|
||||||
|
|
||||||
int g_dpy_fd;
|
int g_dpy_fd;
|
||||||
xcb_connection_t *g_dpy;
|
xcb_connection_t *g_dpy;
|
||||||
|
|
||||||
|
@ -55,3 +59,42 @@ init_xcb(void)
|
||||||
|
|
||||||
g_dpy_fd = xcb_get_file_descriptor(g_dpy);
|
g_dpy_fd = xcb_get_file_descriptor(g_dpy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
handle_xcb_event(xcb_generic_event_t *event)
|
||||||
|
{
|
||||||
|
switch (event->response_type & ~0x80) {
|
||||||
|
case XCB_CREATE_NOTIFY:
|
||||||
|
handle_create_notify_event((xcb_create_notify_event_t *)event);
|
||||||
|
break;
|
||||||
|
case XCB_DESTROY_NOTIFY:
|
||||||
|
handle_destroy_notify_event((xcb_destroy_notify_event_t *)event);
|
||||||
|
break;
|
||||||
|
case XCB_MAP_REQUEST:
|
||||||
|
handle_map_request_event((xcb_map_request_event_t *)event);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
handle_create_notify_event(xcb_create_notify_event_t *event)
|
||||||
|
{
|
||||||
|
warn("create_nofify\n");
|
||||||
|
|
||||||
|
// TODO: handle
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
handle_destroy_notify_event(xcb_destroy_notify_event_t *event)
|
||||||
|
{
|
||||||
|
// TODO: handle
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
handle_map_request_event(xcb_map_request_event_t *event)
|
||||||
|
{
|
||||||
|
warn("map_request\n");
|
||||||
|
|
||||||
|
// TODO: handle properly
|
||||||
|
xcb_map_window(g_dpy, event->window);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue