diff options
| author | Aldrik Ramaekers <aldrik.ramaekers@protonmail.com> | 2020-06-22 17:41:01 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik.ramaekers@protonmail.com> | 2020-06-22 17:41:01 +0200 |
| commit | eaeed7631848eb7885fcb2dc6772bd6a777f101b (patch) | |
| tree | ec79dd7dcadea7cd8d02d4bf5f164de57d2f6b53 /src/linux | |
| parent | 09d17ee1cf95913715b9d96cc14a4ba4ac751947 (diff) | |
work
Diffstat (limited to 'src/linux')
| -rw-r--r-- | src/linux/platform.c | 12 |
1 files changed, 12 insertions, 0 deletions
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); |
