all repos — openbox @ 1741bddecb23bfc401397222c9961233bb30a87a

openbox fork - make it a bit more like ryudo

only return as many as was requested
Dana Jansens danakj@orodu.net
commit

1741bddecb23bfc401397222c9961233bb30a87a

parent

956ada0725aa15b22bd9c8c9261625fdf9a84c84

1 files changed, 3 insertions(+), 4 deletions(-)

jump to
M otk/property.ccotk/property.cc

@@ -242,13 +242,12 @@ XFree(c_val);

// 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