From 407c87d4fe49876ebdc827682aec0928400409df Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 4 Dec 2024 01:01:50 +0100 Subject: Fix mgl_window_set_size stuck if size is < 0 --- src/window/window.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/window/window.c b/src/window/window.c index 097ad76..dd91110 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -1815,6 +1815,10 @@ void mgl_window_set_position(mgl_window *self, mgl_vec2i position) { } void mgl_window_set_size(mgl_window *self, mgl_vec2i size) { + if(size.x < 0) + size.x = 0; + if(size.y < 0) + size.y = 0; XResizeWindow(mgl_get_context()->connection, self->window, size.x, size.y); XFlush(mgl_get_context()->connection); } -- cgit v1.2.3