# SDL_PollEvent very slow on SDL2, but works fine on SDL1.2

I have this simple app that displays a screen and handles the quit event:

while( SDL_PollEvent( &e ) != 0 )
{
//User requests quit
if( e.type == SDL_QUIT )
{
quit = true;
}
}


If I compile this with SDL1.2 it runs fine, the quit event is handled immediately. However if I compile it for SDL2, then it takes ~5 seconds to get that event. And not just quit, but other events also, like mouse.

With sdl2 it takes ~95% of the cpu, while with sdl1.2 it's ~30-40%. The cpu is dual core, 1.2 ghz (pandaboard).

I suspect something, but I'm not 100% sure: I'm running this on ubuntu 12.04 which natively supports only sdl1.2. So I had to compile sdl2 from source code, as it's not available in that ubuntu.

Could this be the reason? Or any other clues what might be wrong? Thanks!

• I have seen this behavior on SDL2 on Mac when my display window is completely hidden (by, in my case Xcode). For what it is worth. – david van brink Feb 1 '15 at 23:50
• Hmm in my case the window is not hidden, also tried both full screen and window mode - still the same. I'm upgrading some drivers now to see if that will make any difference. – Lacho Tomov Feb 1 '15 at 23:56