qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] feature request: Mousepointer not grabbed
@ 2004-12-17  6:35 Jens Arm
  2004-12-17  7:12 ` Felipe Sanchez
  0 siblings, 1 reply; 7+ messages in thread
From: Jens Arm @ 2004-12-17  6:35 UTC (permalink / raw)
  To: qemu-devel

Hi

Is it possible to implement in qemu that the Mousepointer is not grabbed if enabled?
Like in BasiliskII?

Jens

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] feature request: Mousepointer not grabbed
  2004-12-17  6:35 [Qemu-devel] feature request: Mousepointer not grabbed Jens Arm
@ 2004-12-17  7:12 ` Felipe Sanchez
  2004-12-17  7:31   ` Jens Arm
  0 siblings, 1 reply; 7+ messages in thread
From: Felipe Sanchez @ 2004-12-17  7:12 UTC (permalink / raw)
  To: qemu-devel



On Fri, 17 Dec 2004, Jens Arm wrote:

> Is it possible to implement in qemu that the Mousepointer is not
> grabbed if enabled? Like in BasiliskII?


A patch with such functionality was posted here:

http://lists.gnu.org/archive/html/qemu-devel/2004-07/msg00453.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] feature request: Mousepointer not grabbed
  2004-12-17  7:12 ` Felipe Sanchez
@ 2004-12-17  7:31   ` Jens Arm
  2004-12-17  9:07     ` Elefterios Stamatogiannakis
  2004-12-17 11:13     ` Johannes Schindelin
  0 siblings, 2 replies; 7+ messages in thread
From: Jens Arm @ 2004-12-17  7:31 UTC (permalink / raw)
  To: qemu-devel

> > Is it possible to implement in qemu that the Mousepointer is not
> > grabbed if enabled? Like in BasiliskII?
> 
> 
> A patch with such functionality was posted here:
> 
> http://lists.gnu.org/archive/html/qemu-devel/2004-07/msg00453.html

Almost all hunks are failing in the patch :(

Jens

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] feature request: Mousepointer not grabbed
  2004-12-17  9:07     ` Elefterios Stamatogiannakis
@ 2004-12-17  9:05       ` Jens Arm
  2004-12-17 10:05         ` Elefterios Stamatogiannakis
  0 siblings, 1 reply; 7+ messages in thread
From: Jens Arm @ 2004-12-17  9:05 UTC (permalink / raw)
  To: qemu-devel

> > Almost all *hunks* are failing in the patch :(
> 
>   :-)
> 
>   Very funny typo.

Why typo patch is saying this:

patching file target-i386/translate.c
Hunk #12 succeeded at 4408 (offset 12 lines).
^^^^
Jens

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] feature request: Mousepointer not grabbed
  2004-12-17  7:31   ` Jens Arm
@ 2004-12-17  9:07     ` Elefterios Stamatogiannakis
  2004-12-17  9:05       ` Jens Arm
  2004-12-17 11:13     ` Johannes Schindelin
  1 sibling, 1 reply; 7+ messages in thread
From: Elefterios Stamatogiannakis @ 2004-12-17  9:07 UTC (permalink / raw)
  To: qemu-devel

> Almost all *hunks* are failing in the patch :(

  :-)

  Very funny typo.

  teris.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] feature request: Mousepointer not grabbed
  2004-12-17  9:05       ` Jens Arm
@ 2004-12-17 10:05         ` Elefterios Stamatogiannakis
  0 siblings, 0 replies; 7+ messages in thread
From: Elefterios Stamatogiannakis @ 2004-12-17 10:05 UTC (permalink / raw)
  To: qemu-devel

> Why typo patch is saying this:
> 
> patching file target-i386/translate.c
> Hunk #12 succeeded at 4408 (offset 12 lines).
> ^^^^
> Jens

  Yes you are right. My mind is playing games with me.
I always red that as "chunk". Don't now why.

  teris.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] feature request: Mousepointer not grabbed
  2004-12-17  7:31   ` Jens Arm
  2004-12-17  9:07     ` Elefterios Stamatogiannakis
@ 2004-12-17 11:13     ` Johannes Schindelin
  1 sibling, 0 replies; 7+ messages in thread
From: Johannes Schindelin @ 2004-12-17 11:13 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 434 bytes --]

Hi,

On Fri, 17 Dec 2004, Jens Arm wrote:

> > > Is it possible to implement in qemu that the Mousepointer is not
> > > grabbed if enabled? Like in BasiliskII?
> >
> >
> > A patch with such functionality was posted here:
> >
> > http://lists.gnu.org/archive/html/qemu-devel/2004-07/msg00453.html
>
> Almost all hunks are failing in the patch :(

So I took the patch, and updated manually. You can see the result
attached.

Hth,
Dscho

[-- Attachment #2: Type: TEXT/PLAIN, Size: 3471 bytes --]

Index: sdl.c
===================================================================
RCS file: /cvsroot/qemu/qemu/sdl.c,v
retrieving revision 1.20
diff -u -u -r1.20 sdl.c
--- sdl.c	12 Dec 2004 16:56:30 -0000	1.20
+++ sdl.c	17 Dec 2004 11:11:04 -0000
@@ -39,6 +39,7 @@
 static int gui_fullscreen_initial_grab;
 static int gui_grab_code = KMOD_LALT | KMOD_LCTRL;
 static uint8_t modifiers_state[256];
+static int saved_grab_with_sdl;
 
 static void sdl_update(DisplayState *ds, int x, int y, int w, int h)
 {
@@ -263,8 +264,10 @@
 
 static void sdl_grab_start(void)
 {
-    SDL_ShowCursor(0);
-    SDL_WM_GrabInput(SDL_GRAB_ON);
+    if(grab_with_sdl) {
+        SDL_ShowCursor(0);
+        SDL_WM_GrabInput(SDL_GRAB_ON);
+    }
     /* dummy read to avoid moving the mouse */
     SDL_GetRelativeMouseState(NULL, NULL);
     gui_grab = 1;
@@ -273,8 +276,10 @@
 
 static void sdl_grab_end(void)
 {
-    SDL_WM_GrabInput(SDL_GRAB_OFF);
-    SDL_ShowCursor(1);
+    if(grab_with_sdl) {
+        SDL_WM_GrabInput(SDL_GRAB_OFF);
+        SDL_ShowCursor(1);
+    }
     gui_grab = 0;
     sdl_update_caption();
 }
@@ -307,9 +312,11 @@
     sdl_resize(ds, screen->w, screen->h);
     if (gui_fullscreen) {
         gui_saved_grab = gui_grab;
+	saved_grab_with_sdl = grab_with_sdl;
+	grab_with_sdl = 1;
         sdl_grab_start();
     } else {
-        if (!gui_saved_grab)
+        if (!gui_saved_grab || !saved_grab_with_sdl)
             sdl_grab_end();
     }
     vga_invalidate_display();
@@ -445,7 +452,7 @@
             }
             break;
         case SDL_ACTIVEEVENT:
-            if (gui_grab && (ev->active.gain & SDL_ACTIVEEVENTMASK) == 0 &&
+            if (grab_with_sdl && gui_grab && (ev->active.gain & SDL_ACTIVEEVENTMASK) == 0 &&
                 !gui_fullscreen_initial_grab) {
                 sdl_grab_end();
             }
Index: vl.c
===================================================================
RCS file: /cvsroot/qemu/qemu/vl.c,v
retrieving revision 1.110
diff -u -u -r1.110 vl.c
--- vl.c	12 Dec 2004 22:20:04 -0000	1.110
+++ vl.c	17 Dec 2004 11:11:05 -0000
@@ -136,6 +136,7 @@
 int full_screen = 0;
 TextConsole *vga_console;
 CharDriverState *serial_hds[MAX_SERIAL_PORTS];
+int grab_with_sdl = 1;
 
 /***********************************************************/
 /* x86 ISA bus support */
@@ -2672,6 +2673,7 @@
     QEMU_OPTION_loadvm,
     QEMU_OPTION_full_screen,
     QEMU_OPTION_pidfile,
+    QEMU_OPTION_no_sdl_grab,
 };
 
 typedef struct QEMUOption {
@@ -2738,6 +2740,7 @@
     /* temporary options */
     { "pci", 0, QEMU_OPTION_pci },
     { "cirrusvga", 0, QEMU_OPTION_cirrusvga },
+    { "no-sdl-grab", 0, QEMU_OPTION_no_sdl_grab },
     { NULL },
 };
 
@@ -3165,6 +3168,9 @@
             case QEMU_OPTION_pidfile:
                 create_pidfile(optarg);
                 break;
+	    case QEMU_OPTION_no_sdl_grab:
+		grab_with_sdl = 0;
+		break;
             }
         }
     }
Index: vl.h
===================================================================
RCS file: /cvsroot/qemu/qemu/vl.h,v
retrieving revision 1.63
diff -u -u -r1.63 vl.h
--- vl.h	12 Dec 2004 16:56:30 -0000	1.63
+++ vl.h	17 Dec 2004 11:11:05 -0000
@@ -124,6 +124,7 @@
 extern int graphic_height;
 extern int graphic_depth;
 extern const char *keyboard_layout;
+extern int grab_with_sdl;
 
 /* XXX: make it dynamic */
 #if defined (TARGET_PPC)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-12-17 11:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-17  6:35 [Qemu-devel] feature request: Mousepointer not grabbed Jens Arm
2004-12-17  7:12 ` Felipe Sanchez
2004-12-17  7:31   ` Jens Arm
2004-12-17  9:07     ` Elefterios Stamatogiannakis
2004-12-17  9:05       ` Jens Arm
2004-12-17 10:05         ` Elefterios Stamatogiannakis
2004-12-17 11:13     ` Johannes Schindelin

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).