aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/window/window.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/window/window.c b/src/window/window.c
index 1b15558..08c4585 100644
--- a/src/window/window.c
+++ b/src/window/window.c
@@ -247,8 +247,8 @@ static int mgl_window_init(mgl_window *self, const char *title, const mgl_window
mgl_vec2i window_size = params ? params->size : (mgl_vec2i){ 0, 0 };
if(window_size.x <= 0 || window_size.y <= 0) {
- window_size.x = 1;
- window_size.y = 1;
+ window_size.x = 640;
+ window_size.y = 480;
}
self->size = window_size;
@@ -286,6 +286,7 @@ static int mgl_window_init(mgl_window *self, const char *title, const mgl_window
}
XSetWindowAttributes window_attr;
+ window_attr.override_redirect = params ? params->override_redirect : false;
window_attr.colormap = x11_context->color_map;
window_attr.event_mask =
KeyPressMask | KeyReleaseMask |
@@ -296,7 +297,7 @@ static int mgl_window_init(mgl_window *self, const char *title, const mgl_window
const bool hide_window = params ? params->hidden : false;
if(existing_window) {
- if(!XChangeWindowAttributes(context->connection, existing_window, CWColormap | CWEventMask, &window_attr)) {
+ if(!XChangeWindowAttributes(context->connection, existing_window, CWColormap | CWEventMask | CWOverrideRedirect, &window_attr)) {
fprintf(stderr, "XChangeWindowAttributes failed\n");
mgl_window_deinit(self);
return -1;
@@ -309,7 +310,7 @@ static int mgl_window_init(mgl_window *self, const char *title, const mgl_window
self->window = XCreateWindow(context->connection, parent_window, params->position.x, params->position.y,
window_size.x, window_size.y, 0,
((XVisualInfo*)context->visual_info)->depth, InputOutput, ((XVisualInfo*)context->visual_info)->visual,
- CWColormap | CWEventMask, &window_attr);
+ CWColormap | CWEventMask | CWOverrideRedirect, &window_attr);
if(!self->window) {
fprintf(stderr, "XCreateWindow failed\n");
mgl_window_deinit(self);