aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mgl.c1
-rw-r--r--src/window.c7
2 files changed, 5 insertions, 3 deletions
diff --git a/src/mgl.c b/src/mgl.c
index cbdfb41..549121f 100644
--- a/src/mgl.c
+++ b/src/mgl.c
@@ -89,7 +89,6 @@ void mgl_deinit(void) {
if(init_count == 1) {
glx_context_deinit();
mgl_gl_unload(&context.gl);
- mgl_gl_unload(&context.gl);
XSetErrorHandler(prev_xerror);
if(context.connection) {
XCloseDisplay(context.connection);
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 <X11/Xutil.h>
#include <errno.h>
@@ -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");