From eaeed7631848eb7885fcb2dc6772bd6a777f101b Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Mon, 22 Jun 2020 17:41:01 +0200 Subject: work --- src/linux/platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/linux/platform.c') diff --git a/src/linux/platform.c b/src/linux/platform.c index a075d48..f849a79 100644 --- a/src/linux/platform.c +++ b/src/linux/platform.c @@ -750,6 +750,15 @@ void platform_setup_renderer() } } +int _x11_error_handler(Display *display, XErrorEvent *event) +{ + char tmp[2000]; + XGetErrorText(display, event->error_code, tmp, 2000); + printf("X11 ERROR: %s\n", tmp); + + return 0; +} + platform_window platform_open_window_ex(char *name, u16 width, u16 height, u16 max_w, u16 max_h, u16 min_w, u16 min_h, s32 flags) { bool has_max_size = max_w || max_h; @@ -788,6 +797,8 @@ platform_window platform_open_window_ex(char *name, u16 width, u16 height, u16 m window.display = XOpenDisplay(NULL); + XSetErrorHandler(_x11_error_handler); + if(window.display == NULL) { return window; } @@ -846,6 +857,7 @@ platform_window platform_open_window_ex(char *name, u16 width, u16 height, u16 m window.window = XCreateWindow(window.display, window.parent, center_x, center_y, width, height, 0, window.visual_info->depth, InputOutput, window.visual_info->visual, CWColormap | CWEventMask | CWBorderPixel, &window_attributes); + XGCValues values; window.gc = XCreateGC(window.display, window.window, 0, &values); -- cgit v1.2.3-70-g09d2