njsmith / partiwm

[defunct] Experiments with window managers in Python + GTK+, including the original version of xpra
GNU General Public License v2.0
23 stars 3 forks source link

wimpiggy: overflow error breaks WM_TAKE_FOCUS #43

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In send_wm_take_focus() in lowlevel/__init__.py, we pass "time" into the pyrex 
code where it gets used to initialize a signed 32-bit XClientMessageEvent data. 
 This value comes from the X server time, which is 32-bit unsigned.  On my 
system (xvfb from X.org 1.9.0 on a 32-bit system) my server time is a value 
that does not fit in a 32-bit signed quantity and so Python raises an overflow 
error.

The ICCCM documentation glosses over this problem.  I poked around for other C 
implementations and I _think_ that people just usually cast the uint32 to the 
long.   The attached patch does that in python (which isn't easy, but this is a 
known idiom) and fixes the problem.  Perhaps this should be in pyx code....

Original issue reported on code.google.com by mefisk@gmail.com on 18 Jun 2011 at 4:21

Attachments: