summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--reduced_system_layer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/reduced_system_layer.c b/reduced_system_layer.c
index 2a04a22..088a8a5 100644
--- a/reduced_system_layer.c
+++ b/reduced_system_layer.c
@@ -2032,6 +2032,7 @@ static Atom _dnd_action_copy = 0;
static Atom _dnd_selection = 0;
static Atom _text_uri_list = 0;
static Window _dnd_source = 0;
+static b8 _mapped = 0;
static i16 _key_table [MAX_NUM_KEYS] = {0};
static b8 _key_repeat [MAX_NUM_KEYS] = {0};
@@ -2266,10 +2267,10 @@ void p_init(void) {
XChangeProperty(_display, _window, _dnd_aware, 4, 32, PropModeReplace, &(u8) {5}, 1);
- XMapWindow(_display, _window);
-
XPutImage(_display, _window, _gc, &_image, 0, 0, 0, 0, _image.width, _image.height);
XFlush(_display);
+
+ _mapped = 0;
}
void p_cleanup(void) {
@@ -2760,6 +2761,11 @@ void p_render_frame(void) {
if (g_platform.done)
return;
+ if (!_mapped) {
+ XMapWindow(_display, _window);
+ _mapped = 1;
+ }
+
if (g_platform.frame_width == _image.width && g_platform.frame_height == _image.height) {
i64 size = g_platform.frame_width * g_platform.frame_height;
for (i64 i = 0; i < size; ++i)