aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-03-31 17:21:01 +0200
committerdec05eba <dec05eba@protonmail.com>2022-03-31 17:21:01 +0200
commitd89e3d1a1cf432210361d1b0aafad8308d8ac961 (patch)
tree9f9155ede708c705cb72d8e061ca4692d5f562d9 /src
parent956c86fe4728e6e5239202f1402fd65260ece7c8 (diff)
Add override redirect option to window create
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);