We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 986

Summary: Fullscreen window created with SDL_SetVideoMode() in X11 has no keyboard events
Product: SDL Reporter: slyffx
Component: eventsAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2 CC: eddie
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   

Description slyffx 2010-04-16 03:46:48 UTC
If a fullscreen window is created with SDL_Init() using SDL_FULLSCREEN.  The window will not have keyboard input events.  Program works as expected in sdl 1.2 (The program is not at fault).
Comment 1 slyffx 2010-04-16 03:55:48 UTC
(In reply to comment #0)
> If a fullscreen window is created with SDL_Init() using SDL_FULLSCREEN.  The
> window will not have keyboard input events.  Program works as expected in sdl
> 1.2 (The program is not at fault).

Correction, SDL_SetVideoMode() was used to create the window.
Comment 2 Eddie Ringle 2010-05-14 13:49:13 UTC
I started my application using the new SDL 1.3 method (SDL_VideoInit, SDL_CreateWindow, etc.) and I still am unable to accept input when in fullscreen. Windowed mode works fine.
One note, when I start in fullscreen, try to send keyboard input, and then Ctrl+C to close the app, the terminal is filled with character sequences like "^[[A^[[B" (hopefully you know what I'm talking about, I forget what they are called.) However, when in windowed mode, I press the arrow keys and my object moves as expected, with no characters outputted to the terminal.
Is my application getting focus when it is started or is it left at the terminal?
Comment 3 Eddie Ringle 2010-05-14 13:55:51 UTC
Yup, confirmation that the window isn't getting focus. I tried adding a call to SDL_RaiseWindow() but that doesn't seem to help. I was able to get input working in fullscreen by Alt-Tabbing away from the terminal, but then I had to drop to text-only mode to kill the app (my fault for not adding a quit key, heh).
Comment 4 Eddie Ringle 2010-05-14 14:17:54 UTC
(In reply to comment #3)
> Yup, confirmation that the window isn't getting focus. I tried adding a call to
> SDL_RaiseWindow() but that doesn't seem to help. I was able to get input
> working in fullscreen by Alt-Tabbing away from the terminal, but then I had to
> drop to text-only mode to kill the app (my fault for not adding a quit key,
> heh).

Correction, just Alt-Tabbing in general (and then the window appears and input works after I stop Alt-Tabbing).
Comment 5 Sam Lantinga 2010-07-17 19:00:34 UTC
This should be fixed with the latest snapshot.  It correctly uses the _NET_WM_STATE_FULLSCREEN protocol and lets the window manager handle the input focus.