diff --git a/plugin/gui/gui.v b/plugin/gui/gui.v index 1529307..4ae49a3 100644 --- a/plugin/gui/gui.v +++ b/plugin/gui/gui.v @@ -92,6 +92,11 @@ pub fn (g &GUI) on_posix_fd() { } t := event.response_type & ~0x80 match t { + // Error + 0 { + error_ev := &C.xcb_request_error_t(event) + eprintln('Received X11 error: ${error_ev.error_code}') + } u8(C.XCB_EXPOSE) { expose_ev := &C.xcb_expose_event_t(event) if expose_ev.window == g.window { diff --git a/plugin/gui/xcb.v b/plugin/gui/xcb.v index 24b3e5e..fece731 100644 --- a/plugin/gui/xcb.v +++ b/plugin/gui/xcb.v @@ -50,6 +50,15 @@ struct C.xcb_expose_event_t { window C.xcb_window_t } +@[typedef] +struct C.xcb_request_error_t { + error_code u8 + sequence u16 + bad_value u32 + minor_opcode u16 + major_opcode u16 +} + fn C.xcb_connect(&char, &int) &C.xcb_connection_t fn C.xcb_disconnect(&C.xcb_connection_t) fn C.xcb_flush(&C.xcb_connection_t)