diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-11-27 16:25:10 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-11-27 16:25:10 +0100 |
commit | 3101f4bf13b0f2129c24c6b35f75b040502baaa2 (patch) | |
tree | 19abd2590b8a5789bd7413a0e212d9877aff1f6b /src | |
parent | 25a962a8bf74b5a2484531e2095a219ab8ae7fe7 (diff) |
Add mgl_window_inject_x11_event, add flush after mgl_window_set_visible
Diffstat (limited to 'src')
-rw-r--r-- | src/window/window.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/window/window.c b/src/window/window.c index d3ec04e..5fcd466 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -1602,6 +1602,13 @@ bool mgl_window_poll_event(mgl_window *self, mgl_event *event) { } } +bool mgl_window_inject_x11_event(mgl_window *self, XEvent *xev, mgl_event *event) { + mgl_context *context = mgl_get_context(); + event->type = MGL_EVENT_UNKNOWN; + mgl_window_on_receive_event(self, xev, event, context); + return event->type != MGL_EVENT_UNKNOWN; +} + void mgl_window_display(mgl_window *self) { mgl_context *context = mgl_get_context(); x11_context_swap_buffers(self->context, self->window); @@ -1654,6 +1661,7 @@ void mgl_window_set_visible(mgl_window *self, bool visible) { XMapWindow(context->connection, self->window); else XUnmapWindow(context->connection, self->window); + XFlush(context->connection); } bool mgl_window_is_open(const mgl_window *self) { |