Add Steam patch - dwm - my version of dwm (frankenstein's monster)
 (HTM) git clone https://git.drkhsh.at/dwm.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 55ca9e23cb079c617874a0fa55466c467b1a9c13
 (DIR) parent 77f1fe9aaaa7b483f1cc5c05f51a468e43b478e9
 (HTM) Author: drkhsh <me@drkhsh.at>
       Date:   Mon, 10 Jan 2022 13:42:45 +0100
       
       Add Steam patch
       
       Steam, and steam windows (games), trigger a ConfigureNotify request every
       time the window gets focus. More so, the configure event passed along from
       Steam tends to have the wrong x and y co-ordinates which can make the window,
       if floating, jump around the screen.
       
       This patch works around this age-old issue by ignoring the x and y co-ordinates
       for ConfigureNotify requests relating to Steam windows.
       
       https://dwm.suckless.org/patches/steam/
       
       Diffstat:
         M dwm.c                               |      22 +++++++++++++++-------
       
       1 file changed, 15 insertions(+), 7 deletions(-)
       ---
 (DIR) diff --git a/dwm.c b/dwm.c
       @@ -115,6 +115,7 @@ struct Client {
                int bw, oldbw;
                unsigned int tags;
                int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
       +        int issteam;
                Client *next;
                Client *snext;
                Monitor *mon;
       @@ -368,6 +369,9 @@ applyrules(Client *c)
                class    = ch.res_class ? ch.res_class : broken;
                instance = ch.res_name  ? ch.res_name  : broken;
        
       +        if (strstr(class, "Steam") || strstr(class, "steam_app_"))
       +                c->issteam = 1;
       +
                for (i = 0; i < LENGTH(rules); i++) {
                        r = &rules[i];
                        if ((!r->title || strstr(c->name, r->title))
       @@ -722,13 +726,15 @@ configurerequest(XEvent *e)
                                c->bw = ev->border_width;
                        else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) {
                                m = c->mon;
       -                        if (ev->value_mask & CWX) {
       -                                c->oldx = c->x;
       -                                c->x = m->mx + ev->x;
       -                        }
       -                        if (ev->value_mask & CWY) {
       -                                c->oldy = c->y;
       -                                c->y = m->my + ev->y;
       +                        if (!c->issteam) {
       +                                if (ev->value_mask & CWX) {
       +                                        c->oldx = c->x;
       +                                        c->x = m->mx + ev->x;
       +                                }
       +                                if (ev->value_mask & CWY) {
       +                                        c->oldy = c->y;
       +                                        c->y = m->my + ev->y;
       +                                }
                                }
                                if (ev->value_mask & CWWidth) {
                                        c->oldw = c->w;
       @@ -1830,6 +1836,8 @@ setfocus(Client *c)
                                XA_WINDOW, 32, PropModeReplace,
                                (unsigned char *) &(c->win), 1);
                }
       +        if (c->issteam)
       +                setclientstate(c, NormalState);
                sendevent(c->win, wmatom[WMTakeFocus], NoEventMask, wmatom[WMTakeFocus], CurrentTime, 0, 0, 0);
        }