diff options
author | Andrey Nazarov <skuller@skuller.net> | 2010-08-01 18:17:12 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2010-08-01 18:17:12 +0000 |
commit | e018d5c313cd33ee08a72205b4c17fc0052f8c0b (patch) | |
tree | 9517c7b292f2417b4e55145a6f9d2e9ea54f13ac /source | |
parent | dea34679251a827b80b789125988fbd09ffd9ad9 (diff) |
Made evdev input driver a bit more windowed mode friendly.
Diffstat (limited to 'source')
-rw-r--r-- | source/in_evdev.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/in_evdev.c b/source/in_evdev.c index 3550c09..8fe32ec 100644 --- a/source/in_evdev.c +++ b/source/in_evdev.c @@ -161,16 +161,26 @@ static void GrabMouse( grab_t grab ) { } #endif // EVIOCGRAB - if( grab ) { + if( grab == IN_GRAB ) { struct input_event ev; + SDL_WM_GrabInput( SDL_GRAB_ON ); + SDL_WM_SetCaption( "[" APPLICATION "]", APPLICATION ); SDL_ShowCursor( SDL_DISABLE ); evdev.io->wantread = qtrue; while( read( evdev.fd, &ev, EVENT_SIZE ) == EVENT_SIZE ) ; } else { - SDL_ShowCursor( SDL_ENABLE ); + if( evdev.grabbed == IN_GRAB ) { + SDL_WM_GrabInput( SDL_GRAB_OFF ); + SDL_WM_SetCaption( APPLICATION, APPLICATION ); + } + if( grab == IN_HIDE ) { + SDL_ShowCursor( SDL_DISABLE ); + } else { + SDL_ShowCursor( SDL_ENABLE ); + } evdev.io->wantread = qfalse; } |