From baaaa072d25ec188eca255436809f1c553ef850b Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 4 Nov 2023 19:13:28 +0000 Subject: [PATCH] client: don't null-terminate WM_CLASS --- src/browser/client.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/browser/client.cxx b/src/browser/client.cxx index 65f02c1..32cd2fb 100644 --- a/src/browser/client.cxx +++ b/src/browser/client.cxx @@ -80,9 +80,11 @@ void Browser::Client::OnWindowCreated(CefRefPtr window) { window->SetWindowAppIcon(image_big); #if defined(CEF_X11) + // note: the wm_class array includes a '\0' at the end, which should not be included in the actual WM_CLASS constexpr char wm_class[] = "BoltLauncher\0BoltLauncher"; + constexpr size_t wm_class_size = sizeof(wm_class) - 1; const unsigned long handle = window->GetWindowHandle(); - xcb_change_property(this->xcb, XCB_PROP_MODE_REPLACE, handle, XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 8, sizeof(wm_class), wm_class); + xcb_change_property(this->xcb, XCB_PROP_MODE_REPLACE, handle, XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 8, wm_class_size, wm_class); xcb_flush(this->xcb); #endif }