Adding sizehints patch

This commit is contained in:
bakkeby
2020-06-15 21:01:05 +02:00
parent 920c58421b
commit 5e0a9c49f8
7 changed files with 67 additions and 0 deletions

View File

@@ -117,6 +117,9 @@
#if SHIFTVIEW_CLIENTS_PATCH
#include "shiftviewclients.c"
#endif
#if SIZEHINTS_RULED_PATCH
#include "sizehints_ruled.c"
#endif
#if SORTSCREENS_PATCH
#ifdef XINERAMA
#include "sortscreens.c"

View File

@@ -120,6 +120,9 @@
#if SHIFTVIEW_CLIENTS_PATCH
#include "shiftviewclients.h"
#endif
#if SIZEHINTS_RULED_PATCH
#include "sizehints_ruled.h"
#endif
#if SORTSCREENS_PATCH
#ifdef XINERAMA
#include "sortscreens.h"

24
patch/sizehints_ruled.c Normal file
View File

@@ -0,0 +1,24 @@
void
checkfloatingrules(Client *c)
{
const char *class, *instance;
unsigned int i;
const Rule *r;
XClassHint ch = { NULL, NULL };
XGetClassHint(dpy, c->win, &ch);
class = ch.res_class ? ch.res_class : broken;
instance = ch.res_name ? ch.res_name : broken;
for (i = 0; i < LENGTH(rules); i++) {
r = &rules[i];
if ((!r->title || strstr(c->name, r->title))
&& (!r->class || strstr(class, r->class))
&& (!r->instance || strstr(instance, r->instance)))
c->isfloating = r->isfloating;
}
if (ch.res_class)
XFree(ch.res_class);
if (ch.res_name)
XFree(ch.res_name);
}

1
patch/sizehints_ruled.h Normal file
View File

@@ -0,0 +1 @@
static void checkfloatingrules(Client *c);