x11: set window class and name

class is always bemenu, name is whatever is the title of the menu
This commit is contained in:
Jari Vetoniemi 2020-02-07 23:31:41 +02:00
parent f8d025b350
commit 9110c7c42e

View File

@ -4,6 +4,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <X11/Xutil.h>
static void
render(const struct bm_menu *menu)
@ -230,6 +231,8 @@ constructor(struct bm_menu *menu)
if (!bm_x11_window_create(&x11->window, x11->display))
goto fail;
XSetClassHint(x11->window.display, x11->window.drawable, (XClassHint[]){{.res_name = (menu->title ? menu->title : "bemenu"), .res_class = "bemenu"}});
x11->window.bottom = menu->bottom;
bm_x11_window_set_monitor(&x11->window, menu->monitor);