Linux: SlateViewer crashes with X error

I successfully compiled UE 4.9.0-preview-4 under Gentoo.
When trying to run SlateViewer or UE4Editor the program crashes when trying to initialize the GL context:

./SlateViewer
Using binned.
[2015.08.24-19.45.01:891][  0]LogModuleManager:Warning: ModuleManager: Module 'PakFile' not found - its StaticallyLinkedModuleInitializers function is null.
[2015.08.24-19.45.01:891][  0]LogModuleManager:Warning: ModuleManager: Module 'SandboxFile' not found - its StaticallyLinkedModuleInitializers function is null.
[2015.08.24-19.45.01:891][  0]LogModuleManager:Warning: ModuleManager: Module 'StreamingFile' not found - its StaticallyLinkedModuleInitializers function is null.
[2015.08.24-19.45.01:891][  0]LogModuleManager:Warning: ModuleManager: Module 'NetworkFile' not found - its StaticallyLinkedModuleInitializers function is null.
[2015.08.24-19.45.01:891][  0]LogInit:Display: RandInit(940582365) SRandInit(940582368).
[2015.08.24-19.45.01:891][  0]LogTaskGraph: Started task graph with 3 named threads and 8 total threads.
[2015.08.24-19.45.01:891][  0]LogInit: Version: 4.9.0-0+++depot+UE4-Releases+4.9
[2015.08.24-19.45.01:891][  0]LogInit: API Version: 0
[2015.08.24-19.45.01:891][  0]LogInit: Compiled (64-bit): Aug 24 2015 21:36:26
[2015.08.24-19.45.01:891][  0]LogInit: Compiled with Clang: 3.5.0 (tags/RELEASE_350/final)
[2015.08.24-19.45.01:891][  0]LogInit: Build Configuration: Development
[2015.08.24-19.45.01:891][  0]LogInit: Branch Name: ++depot+UE4-Releases+4.9
[2015.08.24-19.45.01:891][  0]LogInit: Command line:  
[2015.08.24-19.45.01:891][  0]LogInit: Base directory: /somedir/UnrealEngine/Engine/Binaries/Linux/
[2015.08.24-19.45.01:891][  0]LogInit: Rocket: 0
[2015.08.24-19.45.01:893][  0]LogInit: Presizing for 0 objects not considered by GC, pre-allocating 0 bytes.
[2015.08.24-19.45.01:893][  0]LogInit: Object subsystem initialized
[2015.08.24-19.45.01:893][  0]LogInit: Linux hardware info:
[2015.08.24-19.45.01:893][  0]LogInit:  - this process' id (pid) is 12893, parent process' id (ppid) is 31799
[2015.08.24-19.45.01:894][  0]LogInit:  - we are not running under debugger
[2015.08.24-19.45.01:894][  0]LogInit:  - machine network name is 'somehostname'
[2015.08.24-19.45.01:894][  0]LogInit:  - we're logged in locally
[2015.08.24-19.45.01:894][  0]LogInit:  - Number of physical cores available for the process: 8
[2015.08.24-19.45.01:894][  0]LogInit:  - Number of logical cores available for the process: 8
[2015.08.24-19.45.01:894][  0]LogInit:  - Memory allocator used: binned
[2015.08.24-19.45.01:894][  0]LogInit: Linux-specific commandline switches:
[2015.08.24-19.45.01:894][  0]LogInit:  -nodwarf (currently OFF): suppress parsing of DWARF debug info (callstacks will be generated faster, but won't have line numbers)
[2015.08.24-19.45.01:894][  0]LogInit:  -ansimalloc - use malloc()/free() from libc (useful for tools like valgrind and electric fence)
[2015.08.24-19.45.01:894][  0]LogInit:  -jemalloc - use jemalloc for all memory allocation
[2015.08.24-19.45.01:894][  0]LogInit:  -binnedmalloc - use binned malloc  for all memory allocation
[2015.08.24-19.45.01:894][  0]LogInit:  -httpproxy=ADDRESS:PORT - redirects HTTP requests to a proxy (only supported if compiled with libcurl)
[2015.08.24-19.45.01:894][  0]LogInit:  -reuseconn - allow libcurl to reuse HTTP connections (only matters if compiled with libcurl)
[2015.08.24-19.45.01:894][  0]LogInit:  -virtmemkb=NUMBER - sets process virtual memory (address space) limit (overrides VirtualMemoryLimitInKB value from .ini)
[2015.08.24-19.45.01:894][  0]LogInit: Setting LC_NUMERIC to en_US
[2015.08.24-19.45.01:894][  0]LogInit:  - Physical RAM available (not considering process quota): 16 GB (16027 MB, 16411760 KB, 16805642240 bytes)
[2015.08.24-19.45.01:902][  0]LogTextLocalizationManager: No specific translations for ('en-US') exist, so ('en') translations will be used.
[2015.08.24-19.45.01:957][  0]LogInit: Initializing SDL.
[2015.08.24-19.45.02:380][  0]LogInit: Initialized SDL 2.0.4 (compiled against 2.0.4)
[2015.08.24-19.45.02:381][  0]LogInit: Display metrics:
[2015.08.24-19.45.02:381][  0]LogInit:   PrimaryDisplayWidth: 1920
[2015.08.24-19.45.02:381][  0]LogInit:   PrimaryDisplayHeight: 1080
[2015.08.24-19.45.02:381][  0]LogInit:   PrimaryDisplayWorkAreaRect:
[2015.08.24-19.45.02:381][  0]LogInit:     Left=0, Top=0, Right=1920, Bottom=1080
[2015.08.24-19.45.02:381][  0]LogInit:   VirtualDisplayRect:
[2015.08.24-19.45.02:381][  0]LogInit:     Left=0, Top=0, Right=3600, Bottom=1080
[2015.08.24-19.45.02:381][  0]LogInit:   TitleSafePaddingSize: X=0.000 Y=0.000
[2015.08.24-19.45.02:381][  0]LogInit:   ActionSafePaddingSize: X=0.000 Y=0.000
[2015.08.24-19.45.02:381][  0]LogInit:   Number of monitors: 2
[2015.08.24-19.45.02:381][  0]LogInit:     Monitor 0
[2015.08.24-19.45.02:381][  0]LogInit:       Name: SyncMaster 24"
[2015.08.24-19.45.02:381][  0]LogInit:       ID: display0
[2015.08.24-19.45.02:381][  0]LogInit:       NativeWidth: 1920
[2015.08.24-19.45.02:381][  0]LogInit:       NativeHeight: 1080
[2015.08.24-19.45.02:381][  0]LogInit:       bIsPrimary: true
[2015.08.24-19.45.02:381][  0]LogInit:     Monitor 1
[2015.08.24-19.45.02:381][  0]LogInit:       Name: SyncMaster 22"
[2015.08.24-19.45.02:381][  0]LogInit:       ID: display1
[2015.08.24-19.45.02:381][  0]LogInit:       NativeWidth: 1680
[2015.08.24-19.45.02:381][  0]LogInit:       NativeHeight: 1050
[2015.08.24-19.45.02:381][  0]LogInit:       bIsPrimary: false
[2015.08.24-19.45.02:382][  0]LogInput:Warning: Category Steam already has menu display info that is being replaced.
[2015.08.24-19.45.02:382][  0]LogInput:Warning: Category Steam already has menu display info that is being replaced.
[2015.08.24-19.45.02:386][  0]LogInit: FSlateOpenGLContext::Initialize - creating OpenGL 2.1 context
[2015.08.24-19.45.02:434][  0]LogHAL: Linux SourceCodeAccessSettings: NullSourceCodeAccessor
[2015.08.24-19.45.02:477][  0]LogInit: FSlateOpenGLContext::Initialize - creating OpenGL 2.1 context
[2015.08.24-19.45.02:788][  0]LogInit: FSlateOpenGLContext::Initialize - creating OpenGL 2.1 context
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  42 (X_SetInputFocus)
  Serial number of failed request:  429
  Current serial number in output stream:  431
[1]    12893 segmentation fault (core dumped)  ./SlateViewer

UE4Editor crashes when trying to create a new project.
Does anyone have an idea, what might be going wrong?

My environment:

CPU: AMD FX™-8320
GPU: NVidia GTX-460 (yea, I know…I should get a newer one)
RAM: 16GB
NVidia driver: 352.21
Window Manager: awesome
Linux Kernel 4.0.5

Thanks a lot for any help

EDIT

I just found out, that if I start SlateViewer with

strace ./SlateViewer

flooding the console and thus slow down program execution, the error does not occur.
UE4Editor unfortunately is not effected by that.
Nevertheless this seems to me like it some sort of timing issue rather than a X or GL problem?

I managed to solve the problem.
It was caused by a bug in SDL in conjunction with the awesome window manager (or Fluxbox).
Apparently Valve had the same problem with Dota 2 Reborn: [Linux] Reborn fails to launch on Awesome WM under Arch Linux · Issue #145 · ValveSoftware/Dota-2 · GitHub

I was following the workaround in the link above (the one with patching xorg-server) and this works. The bug seems to be fixed in the SDL master branch, so I figure upgrading to the latest SDL version once it is released would be wise: X11 never gets focus event without a Window Manager · Issue #1870 · libsdl-org/SDL · GitHub

I compiled and installed the development version of SDL2, but the error persisted. Patching xorg-server seemed to worked though (on Arch Linux with Awesome WM).