client: don't null-terminate WM_CLASS

This commit is contained in:
Adam
2023-11-04 19:13:28 +00:00
parent 7de40f8fd7
commit baaaa072d2

View File

@@ -80,9 +80,11 @@ void Browser::Client::OnWindowCreated(CefRefPtr<CefWindow> 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
}