From 8974be43a3c7f672a34291049bb543d01960de28 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 17 Oct 2021 00:33:37 +0200 Subject: Parent window = 0 = root window --- src/window.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index 5e09261..8042ad3 100644 --- a/src/window.c +++ b/src/window.c @@ -1,4 +1,4 @@ -#include "../include/mgl/window.h" +#include "../include/mgl/window/window.h" #include "../include/mgl/mgl.h" #include #include @@ -38,7 +38,7 @@ static void mgl_window_on_resize(mgl_window *self, int width, int height) { } int mgl_window_create(mgl_window *self, const char *title, int width, int height, mgl_window_callback *callback) { - return mgl_window_create_with_params(self, title, width, height, DefaultRootWindow(mgl_get_context()->connection), callback); + return mgl_window_create_with_params(self, title, width, height, 0, callback); } int mgl_window_create_with_params(mgl_window *self, const char *title, int width, int height, unsigned long parent_window, mgl_window_callback *callback) { @@ -47,6 +47,9 @@ int mgl_window_create_with_params(mgl_window *self, const char *title, int width mgl_context *context = mgl_get_context(); + if(parent_window == 0) + parent_window = DefaultRootWindow(context->connection); + Colormap color_map = XCreateColormap(context->connection, DefaultRootWindow(context->connection), ((XVisualInfo*)context->visual_info)->visual, AllocNone); if(!color_map) { fprintf(stderr, "XCreateColormap failed\n"); -- cgit v1.2.3