aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-12-04 01:01:50 +0100
committerdec05eba <dec05eba@protonmail.com>2024-12-04 01:01:50 +0100
commit407c87d4fe49876ebdc827682aec0928400409df (patch)
treedbb36f46f4c6975b676006feabc22a60b571cf7d
parent5c562ff95b92a9458605e69fe3a4506abbd501b7 (diff)
Fix mgl_window_set_size stuck if size is < 0HEADmaster
-rw-r--r--src/window/window.c4
1 files changed, 4 insertions, 0 deletions
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);
}