Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
592 B

  1. void
  2. checkfloatingrules(Client *c)
  3. {
  4. const char *class, *instance;
  5. unsigned int i;
  6. const Rule *r;
  7. XClassHint ch = { NULL, NULL };
  8. XGetClassHint(dpy, c->win, &ch);
  9. class = ch.res_class ? ch.res_class : broken;
  10. instance = ch.res_name ? ch.res_name : broken;
  11. for (i = 0; i < LENGTH(rules); i++) {
  12. r = &rules[i];
  13. if ((!r->title || strstr(c->name, r->title))
  14. && (!r->class || strstr(class, r->class))
  15. && (!r->instance || strstr(instance, r->instance)))
  16. c->isfloating = r->isfloating;
  17. }
  18. if (ch.res_class)
  19. XFree(ch.res_class);
  20. if (ch.res_name)
  21. XFree(ch.res_name);
  22. }