With this patch, automatic grab keyboard and mouse when the mouse enters the 
window, and ungrab when the mouse reachs the window edge.

I created this beacuse I want to close a window with ALT+F4 inside qemu, but I 
closed qemu window, because qemu is not grabbed.

Scipio
diff -u qemu.orig/sdl.c qemu/sdl.c
--- qemu.orig/sdl.c	2006-04-12 23:09:08.000000000 +0200
+++ qemu/sdl.c	2006-05-01 15:52:43.000000000 +0200
@@ -330,6 +330,11 @@
 	}
 
 	SDL_GetMouseState(&dx, &dy);
+	if( dx==0 || dx==width-1 || dy==0 || dy==height-1 ) {
+	    if(gui_grab) sdl_grab_end();
+	} else {
+	    if(!gui_grab) sdl_grab_start();
+        }
 	dx = dx * 0x7FFF / width;
 	dy = dy * 0x7FFF / height;
     }
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to