aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-12-11 01:00:32 +0100
committerdec05eba <dec05eba@protonmail.com>2023-12-11 01:00:32 +0100
commit5490e519cfb52d1cbb63752cee277ae01cd9e3fb (patch)
tree611cf5215f6ce2884e66fe018f67769f3c6c70d4
parent10ca6eb57024a7042cc6201c6287e1a3d01c7e23 (diff)
add window flush function
-rw-r--r--include/mgl/window/window.h2
-rw-r--r--src/window/window.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/include/mgl/window/window.h b/include/mgl/window/window.h
index 4adf531..90bbd3d 100644
--- a/include/mgl/window/window.h
+++ b/include/mgl/window/window.h
@@ -164,4 +164,6 @@ bool mgl_window_get_clipboard(mgl_window *self, mgl_clipboard_callback callback,
bool mgl_window_get_clipboard_string(mgl_window *self, char **str, size_t *size);
void mgl_window_set_key_repeat_enabled(mgl_window *self, bool enabled);
+void mgl_window_flush(mgl_window *self);
+
#endif /* MGL_WINDOW_H */
diff --git a/src/window/window.c b/src/window/window.c
index b0d1235..05d643d 100644
--- a/src/window/window.c
+++ b/src/window/window.c
@@ -1736,3 +1736,8 @@ bool mgl_window_get_clipboard_string(mgl_window *self, char **str, size_t *size)
void mgl_window_set_key_repeat_enabled(mgl_window *self, bool enabled) {
self->key_repeat_enabled = enabled;
}
+
+void mgl_window_flush(mgl_window *self) {
+ mgl_context *context = mgl_get_context();
+ XFlush(context->connection);
+}