• SetTimer vs. setitimer and XF86VidModeGetAllModeLines

    From James Van Buskirk@21:1/5 to All on Mon Feb 27 19:12:41 2017
    I seem to have two problems. The first involves finding an equivalent to SetTimer in Linux. I tried setitimer and then sending an XExposeEvent
    from the SIGALRM handler but the program freezes up after a while
    because, I assume, that such usage is just not at all thread safe.

    I read that XCB is thread safe, but you still need some Xlib to set up
    a rendering context. If I changed some of my code to XCB, would it
    avoid the conflict that is currently making it hang? What is the usual
    idiom in Linux to replace SetTimer/WM_TIMER?

    The other thing is that all the NeHe examples use
    XF86VidModGetAllModeLines as a starting point to set the video mode.
    In another thread where I have coaxed some readers to try out my
    example, https://software.intel.com/sites/default/files/managed/b2/de/lesson01.f90
    I have received the discouraging news that the function either fails
    outright with error status, or none of the mode lines obtained pass XF86VidModeValidateModeLine although you are still allowed to
    switch to them. Problems ensue after switching in that any window
    that was active during the switch maximizes the first time you click
    on it and often the mouse driver forgets that the desktop is double
    buffered and leaves trails of phantom pointers in alternating buffers
    creating an effect like a movie marquee, see https://www.youtube.com/watch?v=XD7thJVRKmQ
    All of these examples are quite old; is there a more contemporary
    way to switch video modes on Linux that works?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alberto Luaces@21:1/5 to James Van Buskirk on Tue Feb 28 12:11:23 2017
    "James Van Buskirk" writes:

    I seem to have two problems. The first involves finding an equivalent to SetTimer in Linux. I tried setitimer and then sending an XExposeEvent
    from the SIGALRM handler but the program freezes up after a while
    because, I assume, that such usage is just not at all thread safe.

    I read that XCB is thread safe, but you still need some Xlib to set up
    a rendering context. If I changed some of my code to XCB, would it
    avoid the conflict that is currently making it hang? What is the usual
    idiom in Linux to replace SetTimer/WM_TIMER?

    The other thing is that all the NeHe examples use
    XF86VidModGetAllModeLines as a starting point to set the video mode.
    In another thread where I have coaxed some readers to try out my
    example, https://software.intel.com/sites/default/files/managed/b2/de/lesson01.f90
    I have received the discouraging news that the function either fails
    outright with error status, or none of the mode lines obtained pass XF86VidModeValidateModeLine although you are still allowed to
    switch to them. Problems ensue after switching in that any window
    that was active during the switch maximizes the first time you click
    on it and often the mouse driver forgets that the desktop is double
    buffered and leaves trails of phantom pointers in alternating buffers creating an effect like a movie marquee, see https://www.youtube.com/watch?v=XD7thJVRKmQ
    All of these examples are quite old; is there a more contemporary
    way to switch video modes on Linux that works?

    I guess this is not what you expect to hear, but I would begin by
    studying how they made it in SDL for both problems.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)