James Van Buskirk
2017-02-28 02:12:41 UTC
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
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
All of these examples are quite old; is there a more contemporary
way to switch video modes on Linux that works?