diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-07-31 19:58:20 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-07-31 19:58:20 +0200 |
commit | f3e5b69d33f47dece7e3bc8c133f65ad7169cc18 (patch) | |
tree | 030b1a94e3bb7faacbf50d7306e5b66f89c575b6 | |
parent | bff9b4c0ee5c943d3729006c8303bbde1e96742e (diff) |
Flush after window move/resize
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | src/window/window.c | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -8,4 +8,5 @@ Right now mgl only supports x11. `libglvnd (libGL.so)` # Notes Every window _get_ function is cached from the last event poll, no calls to x11 is made.\ -Only one window can be created and used at once. +Only one window can be created and used at once.\ +mgl needs to be initialized first and then a window created, before other functions are called. diff --git a/src/window/window.c b/src/window/window.c index 7c28d8a..586719d 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -1478,10 +1478,12 @@ bool mgl_window_is_low_latency_enabled(const mgl_window *self) { void mgl_window_set_position(mgl_window *self, mgl_vec2i position) { XMoveWindow(mgl_get_context()->connection, self->window, position.x, position.y); + XFlush(mgl_get_context()->connection); } void mgl_window_set_size(mgl_window *self, mgl_vec2i size) { XResizeWindow(mgl_get_context()->connection, self->window, size.x, size.y); + XFlush(mgl_get_context()->connection); } void mgl_window_set_size_limits(mgl_window *self, mgl_vec2i minimum, mgl_vec2i maximum) { |