tcmd/rio: xshove: set geometry by window id - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 4241cae2a1ffe7a499ffd9d028e001fea7a678d6
 (DIR) parent d46053106d746260ce0ab39458332bc31ce6948b
 (HTM) Author: Nicola Girardi <nicola@aloc.in>
       Date:   Sat, 22 Jun 2019 11:44:24 +0100
       
       cmd/rio: xshove: set geometry by window id
       
       Diffstat:
         M src/cmd/rio/xshove.c                |       7 ++++++-
       
       1 file changed, 6 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/src/cmd/rio/xshove.c b/src/cmd/rio/xshove.c
       t@@ -27,6 +27,7 @@ struct Win
                int y;
                int dx;
                int dy;
       +        char *idstr;
                char *class;
                char *instance;
                char *name;
       t@@ -143,6 +144,9 @@ getinfo(void)
                        if(attr.width <= 0 || attr.override_redirect || attr.map_state != IsViewable)
                                continue;
                        ww->xw = xwin[i];
       +                char idstr[9];
       +                snprint(idstr, sizeof(idstr), "%08x", (uint)ww->xw);
       +                ww->idstr = strdup(idstr);
                        ww->x = attr.x;
                        ww->y = attr.y;
                        ww->dx = attr.width;
       t@@ -196,7 +200,8 @@ shove(char *name, char *geom)
                for(i=0; i<nw; i++){
                        Win *ww = &w[i];
                        if(ww->instance && strstr(ww->instance, name)
       -                   || ww->class && strstr(ww->class, name)){
       +                   || ww->class && strstr(ww->class, name)
       +                   || ww->idstr && strstr(ww->idstr, name)){
                                int value_mask;
                                XWindowChanges e;