PDA

View Full Version : new X11 and old XNextEvent



sababa.sababa
07-27-2010, 03:52 AM
Hi,

I try to adapt some good old code to the environment of today. Further I've found that XNextEvent blocks the program I'm trying to debug. I read that this function worked in another way in the 90's and the early 00's than it does in the recent versions of X11. So my question is -- Is there any good way to replace the old XNextEvent? I tried with adding XPending like this:



if (XPending(dis)){
XNextEvent(dis,&event);
}

...but that just put the CPU on 100%. I suppose it's because the code is in a loop.

Thanks in advance for help!

sababa.sababa
07-27-2010, 04:28 AM
...by the way, here is the entire source code for the program I'm trying to fix:
dfm sourcecode, main_8c-source.html, 0.99.9 (http://dfm.sourcearchive.com/lines/0.99.9/main_8c-source.html)

I really like this file manager, but it crashes after about a minute -- due to the XNextEvent I suppose...

sababa.sababa
07-27-2010, 01:47 PM
Yes!!! I solved it! The bug was in this file:
dfm sourcecode, timer_8c-source.html, 0.99.9 (http://dfm.sourcearchive.com/documentation/0.99.9/timer_8c-source.html)

...and this code caused the bug:
SendWindow(GetMoveWindow(),UPDATE_LIGHT);

The solution was to delete the lines. It works even though it's an ugly solution...

sababa.sababa
08-18-2010, 03:44 PM
Now I've debugged deeper. The bug could be deduced to this file:
dfm sourcecode, iwc_8c-source.html, 0.99.9 (http://dfm.sourcearchive.com/documentation/0.99.9/iwc_8c-source.html)
and the line that causes the bug is this:
//xcl.xclient.message_type=XInternAtom(GetDisplay(),"_DFMMESSAGE",False);

Does anyone know if this line contains old fashioned code that should be rewritten to fit the xlib of today???