new X11 and old XNextEvent

This is a discussion on new X11 and old XNextEvent within the Linux Programming forums, part of the Platform Specific Boards category; Hi, I try to adapt some good old code to the environment of today. Further I've found that XNextEvent blocks ...

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    61

    new X11 and old XNextEvent

    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:

    Code:
    	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!

  2. #2
    Registered User
    Join Date
    Sep 2009
    Posts
    61
    ...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

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

  3. #3
    Registered User
    Join Date
    Sep 2009
    Posts
    61
    Yes!!! I solved it! The bug was in this file:
    dfm sourcecode, timer_8c-source.html, 0.99.9

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

  4. #4
    Registered User
    Join Date
    Sep 2009
    Posts
    61
    Now I've debugged deeper. The bug could be deduced to this file:
    dfm sourcecode, iwc_8c-source.html, 0.99.9
    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???
    Last edited by sababa.sababa; 08-19-2010 at 02:15 AM.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21