]> Dogcows Code - chaz/openbox/commitdiff
only return as many as was requested
authorDana Jansens <danakj@orodu.net>
Mon, 17 Feb 2003 21:06:39 +0000 (21:06 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 17 Feb 2003 21:06:39 +0000 (21:06 +0000)
otk/property.cc

index a284c17eed4b42c482711d5c1f64600ba2c90560..436507fc8dfb701407068a04b7e2a70ec704b36c 100644 (file)
@@ -242,13 +242,12 @@ bool Property::get(Window win, Atom atom, Atom type, unsigned long *nelements,
       // the number of longs that need to be retreived to get the property's
       // entire value. The last + 1 is the first long that we retrieved above.
       int remain = (ret_bytes - 1)/sizeof(long) + 1 + 1;
-      if (remain > size/8 * (signed)maxread) // dont get more than the max
-        remain = size/8 * (signed)maxread;
+      if (remain > size * (signed)maxread / 32) // dont get more than the max
+        remain = size * (signed)maxread / 32;
       result = XGetWindowProperty(**display, win, atom, 0l,
                                   remain, false, type, &ret_type, &ret_size,
                                   nelements, &ret_bytes, &c_val);
-      ret = (result == Success && ret_type == type && ret_size == size &&
-             ret_bytes == 0);
+      ret = (result == Success && ret_type == type && ret_size == size);
       /*
         If the property has changed type/size, or has grown since our first
         read of it, then stop here and try again. If it shrank, then this will
This page took 0.026203 seconds and 4 git commands to generate.