aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-12-08 18:31:01 +0100
committerdec05eba <dec05eba@protonmail.com>2023-12-08 18:31:01 +0100
commit10ca6eb57024a7042cc6201c6287e1a3d01c7e23 (patch)
treea75dea8e87880d7c52aac442f88a2a4fb443c569
parent00c790172f939586328735cc583dfdcfbe1d1d9d (diff)
Transient for window option
-rw-r--r--include/mgl/window/window.h17
-rw-r--r--src/window/window.c4
2 files changed, 13 insertions, 8 deletions
diff --git a/include/mgl/window/window.h b/include/mgl/window/window.h
index 12a7aef..4adf531 100644
--- a/include/mgl/window/window.h
+++ b/include/mgl/window/window.h
@@ -69,15 +69,16 @@ typedef enum {
typedef struct {
mgl_vec2i position;
mgl_vec2i size;
- mgl_vec2i min_size; /* (0, 0) = no limit */
- mgl_vec2i max_size; /* (0, 0) = no limit */
- mgl_window_handle parent_window; /* 0 = root window */
- bool hidden; /* false by default */
- bool override_redirect; /* false by default */
- bool support_alpha; /* support alpha for the window, false by default */
- mgl_color background_color; /* default: black */
+ mgl_vec2i min_size; /* (0, 0) = no limit */
+ mgl_vec2i max_size; /* (0, 0) = no limit */
+ mgl_window_handle parent_window; /* 0 = root window */
+ bool hidden; /* false by default */
+ bool override_redirect; /* false by default */
+ bool support_alpha; /* support alpha for the window, false by default */
+ mgl_color background_color; /* default: black */
const char *class_name;
- mgl_window_type window_type; /* default: normal */
+ mgl_window_type window_type; /* default: normal */
+ mgl_window_handle transient_for_window;
} mgl_window_create_params;
typedef enum {
diff --git a/src/window/window.c b/src/window/window.c
index 6882bcd..b0d1235 100644
--- a/src/window/window.c
+++ b/src/window/window.c
@@ -636,6 +636,10 @@ static int mgl_window_init(mgl_window *self, const char *title, const mgl_window
XSetClassHint(context->connection, self->window, &class_hint);
}
+ if(params && params->transient_for_window) {
+ XSetTransientForHint(context->connection, self->window, params->transient_for_window);
+ }
+
mgl_window_type window_type = params ? params->window_type : MGL_WINDOW_TYPE_NORMAL;
mgl_set_window_type(self, window_type);