tCheck for changed window size after window creation. - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit ab5efca82f34bf17a46bd6d87cc5fa887a7095a7
parent e39b8b19286e7c6054953a88935442ec29a68eec
Author: rsc 
Date:   Tue,  2 Dec 2003 03:50:06 +0000

Check for changed window size after window creation.

Diffstat:
  M src/libdraw/x11-init.c              |       9 +++++++++

1 file changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/libdraw/x11-init.c b/src/libdraw/x11-init.c
t@@ -155,6 +155,7 @@ xattach(char *label)
         XTextProperty name;
         XVisualInfo xvi;
         XWindow xrootwin;
+        XWindowAttributes wattr;
         XWMHints hint;
 
         /*
t@@ -303,6 +304,14 @@ xattach(char *label)
                 &attr                /* attributes (the above aren't?!) */
         );
 
+        if(!XGetWindowAttributes(_x.display, _x.drawable, &wattr))
+                fprint(2, "XGetWindowAttributes failed\n");
+        else if(wattr.width && wattr.height){
+                r.max.x = wattr.width;
+                r.max.y = wattr.height;
+                if(0) fprint(2, "new rect %dx%d\n", r.max.x, r.max.y);
+        }
+
         /*
          * Label and other properties required by ICCCCM.
          */