hatliff / wmii

Automatically exported from code.google.com/p/wmii
MIT License
0 stars 0 forks source link

wmii is decrementing color tuples #206

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use wmii-hg2743 which introduced the new bar-file format.
2. Write the strings below to a temporary bar file (/rbar/hello).
3. Read the bar file and observe that what you wrote isn't what you read.

What is the expected output? What do you see instead?

When I write out colors with 1 2 3, I get back 0 1 2:

>> b.write "colors #a1a2a3 #b1b2b3 #c1c2c3\nlabel hello world!!!"
=> nil
>> b.read
=> "colors #a0a1a2 #b0b1b2 #c0c1c2\nlabel hello world!!!\n"

When I write out colors with 7 8 9, I get back 6 7 8:

>> b.write "colors #a7a8a9 #b7b8b9 #c7c8c9\nlabel hello world!!!"
=> nil
>> b.read
=> "colors #a6a7a8 #b6b7b8 #c6c7c8\nlabel hello world!!!\n"

I should get back the same colors I write out.

Original issue reported on code.google.com by sun...@gmail.com on 11 Jul 2010 at 7:27

GoogleCodeExporter commented 9 years ago
I know. It's rather irritating, but it happens in the bowels of Xlib. Since 
wmii has taken to allowing any color format supported by xlib, it now 
regenerates the color string from the resulting pixel values. Unfortunately, 
libxrender does a calculation that overflows and then underflows the pixel 
values causing an off-by-one error. Really, my only option is to bypass 
libxrender and parse rgba pixel values myself, which I'd rather not do, but may 
have to.

Original comment by maglion...@gmail.com on 12 Jul 2010 at 1:18

GoogleCodeExporter commented 9 years ago
Perhaps you could store written color values as-is and return them upon reads?  
For example, to work-around this problem, I tried changing the failing 
assertion in my unit tests to use X11 color names:  "colors black white red" 
but they came back as RGB tuples when I read them.

If that isn't feasible, then please document this problem as a known issue in 
the man page.  I agree that correcting xlib is not worthwhile and I'd rather 
have you coding something you enjoy instead of managing the X11 insane asylum. 
:)

Original comment by sun...@gmail.com on 12 Jul 2010 at 2:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by sun...@gmail.com on 20 Sep 2011 at 12:08