aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-02-18 17:46:51 -0500
committerGitHub <noreply@github.com>2018-02-18 17:46:51 -0500
commit566c98846a92300d29e9fb4b408fd7e51898d42c (patch)
tree8ca9ddd9cd218b6e2c9c93f69ac5f18849dab054 /backend
parent088028c570dd5b52f81069654166f0117667fac0 (diff)
parent15afef6cbc1cbac3557c9626b2f8eb3ec1752c96 (diff)
Merge pull request #645 from agx/x11-window-title
x11 backend: set window title
Diffstat (limited to 'backend')
-rw-r--r--backend/x11/backend.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index 28a4fcac..65eb0094 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -221,11 +221,21 @@ static bool wlr_x11_backend_start(struct wlr_backend *backend) {
init_atom(x11, &x11->atoms.wm_protocols, 1, "WM_PROTOCOLS");
init_atom(x11, &x11->atoms.wm_delete_window, 0, "WM_DELETE_WINDOW");
+ init_atom(x11, &x11->atoms.net_wm_name, 1, "_NET_WM_NAME");
+ init_atom(x11, &x11->atoms.utf8_string, 0, "UTF8_STRING");
xcb_change_property(x11->xcb_conn, XCB_PROP_MODE_REPLACE, output->win,
x11->atoms.wm_protocols.reply->atom, XCB_ATOM_ATOM, 32, 1,
&x11->atoms.wm_delete_window.reply->atom);
+ char title[32];
+ if (snprintf(title, sizeof(title), "wlroots - %s", output->wlr_output.name)) {
+ xcb_change_property(x11->xcb_conn, XCB_PROP_MODE_REPLACE, output->win,
+ x11->atoms.net_wm_name.reply->atom,
+ x11->atoms.utf8_string.reply->atom, 8,
+ strlen(title), title);
+ }
+
xcb_map_window(x11->xcb_conn, output->win);
xcb_flush(x11->xcb_conn);
wlr_output_update_enabled(&output->wlr_output, true);