fix class name from changing on resize

This commit is contained in:
Sam 2024-10-14 15:40:35 +01:00
parent 31e0ba8cb2
commit cf67a6fd4e
2 changed files with 38 additions and 28 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ st
*.o
*.orig
*.rej
.ccls-cache

11
x.c
View File

@ -887,9 +887,18 @@ void
xhints(void)
{
XClassHint class = {opt_name ? opt_name : "st",
opt_class ? opt_class : "St"};
opt_class ? opt_class : "St-class"};
XWMHints wm = {.flags = InputHint, .input = 1};
XSizeHints *sizeh;
XClassHint current_class;
Status status;
status = XGetClassHint(xw.dpy, xw.win, &current_class);
if (status == True) {
if (strcmp(current_class.res_class, class.res_class) != 0) {
class.res_class = current_class.res_class; /* current_class.res_class; */
}
}
sizeh = XAllocSizeHints();