summaryrefslogtreecommitdiff
path: root/source/in_evdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/in_evdev.c')
-rw-r--r--source/in_evdev.c14
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;
}