From: Scipio <scipiox@freemail.hu>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH]USB tablet auto grab and ungrab
Date: Mon, 1 May 2006 16:19:57 +0200 [thread overview]
Message-ID: <200605011619.57752.scipiox@freemail.hu> (raw)
[-- Attachment #1: Type: text/plain, Size: 274 bytes --]
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
[-- Attachment #2: usbtablet_auto_grab_and_ungrab.diff --]
[-- Type: text/x-diff, Size: 415 bytes --]
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;
}
reply other threads:[~2006-05-01 14:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200605011619.57752.scipiox@freemail.hu \
--to=scipiox@freemail.hu \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).