Event handling on Linux

I’ve been developing a game engine using SDL2 and Ogre on Mac, and I recently ported it to Windows and Linux. Event handling works fine on Mac and Windows, but on Linux SDL_PollEvent doesn’t pick up keyboard, mouse, or window events - only joystick events seem to work.

I let Ogre create the window, and then use SDL_CreateWindowFrom. Relevant setup code:


Ogre::RenderWindow * window = _root->createRenderWindow(title, width, height, fullscreen, &misc);

void * nativeWindow;
_window->getCustomAttribute(“WINDOW”, &nativeWindow);
_sdl_window = SDL_CreateWindowFrom(nativeWindow);

Then every frame:


while (SDL_PollEvent(&ev))
// handle events

As I said, on Linux I never get keyboard, mouse, or window events. What am I doing wrong?