aboutsummaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/window.c b/src/window.c
index b71bc07..de22814 100644
--- a/src/window.c
+++ b/src/window.c
@@ -61,13 +61,13 @@ static void wm_set_struts(window_t *window)
log_trace("EWMH struts updated");
}
-static void wm_setup(window_t *window)
+static void wm_setup(window_t *window, const char *name, bool struts)
{
- const char *title = "comet";
+ const char *title = name != NULL ? name : "comet";
xcb_icccm_set_wm_name(window->display->connection, window->window, XCB_ATOM_STRING, 8, strlen(title), title);
const char class[] = "comet\0Comet";
- xcb_icccm_set_wm_class(window->display->connection, window->window, strlen(class), class);
+ xcb_icccm_set_wm_class(window->display->connection, window->window, sizeof(class), class);
log_value_debug("Updated window information",
"s:title", title,
@@ -85,7 +85,9 @@ static void wm_setup(window_t *window)
// TODO: These should be updated depdending on the situation!
wm_set_size(window);
- wm_set_struts(window);
+
+ if (struts)
+ wm_set_struts(window);
}
void window_init(window_t *window, display_t *display, config_t *config)
@@ -133,7 +135,7 @@ void window_init(window_t *window, display_t *display, config_t *config)
log_value_debug("Created window",
"u:id", window->window);
- wm_setup(window);
+ wm_setup(window, config->wm_name, config->wm_struts);
log_trace("Updated window WM options");
xcb_map_window(display->connection, window->window);