From 1952897a8cb411d9b10d75ac6a8c223924c07e09 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 16 Oct 2021 07:34:47 +0200 Subject: Fix resize event sometimes not triggered (set window gravity) --- src/window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index 818805d..62f7e88 100644 --- a/src/window.c +++ b/src/window.c @@ -56,8 +56,9 @@ int mgl_window_create_with_params(mgl_window *self, const char *title, int width XSetWindowAttributes window_attr; window_attr.colormap = color_map; window_attr.event_mask = KeyPressMask | StructureNotifyMask; + window_attr.bit_gravity = NorthWestGravity; - self->window = XCreateWindow(context->connection, parent_window, 0, 0, width, height, 0, ((XVisualInfo*)context->visual_info)->depth, InputOutput, ((XVisualInfo*)context->visual_info)->visual, CWColormap | CWEventMask, &window_attr); + self->window = XCreateWindow(context->connection, parent_window, 0, 0, width, height, 0, ((XVisualInfo*)context->visual_info)->depth, InputOutput, ((XVisualInfo*)context->visual_info)->visual, CWColormap | CWEventMask | CWBitGravity, &window_attr); XFreeColormap(context->connection, color_map); if(!self->window) { fprintf(stderr, "XCreateWindow failed\n"); -- cgit v1.2.3