All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [Qemu-devel] [PATCH 1 of 2] sdl nograb
Date: Tue, 04 Nov 2008 13:08:46 -0600	[thread overview]
Message-ID: <49109DBE.70203@codemonkey.ws> (raw)
In-Reply-To: <49109615.20500@eu.citrix.com>

Stefano Stabellini wrote:
> Add a -nograb command line option to prevent sdl from grabbing mouse
> and keyboard.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>
> diff -r 5c78dd111aae sdl.c
> --- a/sdl.c	Tue Nov 04 09:04:41 2008 +0000
> +++ b/sdl.c	Tue Nov 04 18:31:02 2008 +0000
> @@ -451,7 +451,7 @@
>                          gui_key_modifier_pressed = 0;
>                          if (gui_keysym == 0) {
>                              /* exit/enter grab if pressing Ctrl-Alt */
> -                            if (!gui_grab) {
> +                            if (!gui_grab && !grab_disabled) {
>                                  /* if the application is not active,
>                                     do not try to enter grab state. It
>                                     prevents
> @@ -481,7 +481,7 @@
>              break;
>          case SDL_MOUSEMOTION:
>              if (gui_grab || kbd_mouse_is_absolute() ||
> -                absolute_enabled) {
> +                absolute_enabled || grab_disabled) {
>                  sdl_send_mouse_event(ev->motion.xrel, ev->motion.yrel, 0,
>                         ev->motion.x, ev->motion.y, ev->motion.state);
>              }
> @@ -490,7 +490,7 @@
>          case SDL_MOUSEBUTTONUP:
>              {
>                  SDL_MouseButtonEvent *bev = &ev->button;
> -                if (!gui_grab && !kbd_mouse_is_absolute()) {
> +                if (!gui_grab && !kbd_mouse_is_absolute() && !grab_disabled) {
>                      if (ev->type == SDL_MOUSEBUTTONDOWN &&
>                          (bev->button == SDL_BUTTON_LEFT)) {
>                          /* start grabbing all events */
> @@ -655,7 +655,10 @@
>      atexit(sdl_cleanup);
>      if (full_screen) {
>          gui_fullscreen = 1;
> -        gui_fullscreen_initial_grab = 1;
> -        sdl_grab_start();
> +        if (!grab_disabled)
> +        {
> +            gui_fullscreen_initial_grab = 1;
> +            sdl_grab_start();
> +        }
>   

Code formatting is off here (should be if () {).

In principle, I think this patch is good.  I wonder if we should 
introduce some sort of way to pass sdl options and fold -no-quit and 
-no-grab into the same command.  Like -sdlopts no-quit,no-grab.

Regards,

Anthony Liguori

      reply	other threads:[~2008-11-04 19:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-04 18:36 [Qemu-devel] [PATCH 1 of 2] sdl nograb Stefano Stabellini
2008-11-04 19:08 ` Anthony Liguori [this message]

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=49109DBE.70203@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=Ian.Jackson@eu.citrix.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.