All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] fix SDL mouse events processing
Date: Wed, 5 Mar 2008 13:51:26 +0000	[thread overview]
Message-ID: <20080305135126.GD9786@implementation.uk.xensource.com> (raw)
In-Reply-To: <alpine.LSU.1.00.0803051403570.15786@racer.site>

Johannes Schindelin, le Wed 05 Mar 2008 14:09:10 +0100, a écrit :
> What is this good for?  (I imagine that it would make sense to add a 
> comment to document why this is here, for clueless people like me.)
> 
> Maybe it is to initialise the state of the mouse buttons?

That's it.

> This means that you avoid sending (0,0) events.  Good.

Yes, that's what I said in my comments.

> >                  SDL_MouseButtonEvent *bev = &ev->button;
> > +                if (ev->type == SDL_MOUSEBUTTONDOWN)
> > +                    state |= SDL_BUTTON(bev->button);
> > +                else
> > +                    state &= ~SDL_BUTTON(ev->button.button);
> >                  if (!gui_grab && !kbd_mouse_is_absolute()) {
> >                      if (ev->type == SDL_MOUSEBUTTONDOWN &&
> > -                        (bev->state & SDL_BUTTON_LMASK)) {
> > +                        (bev->button == SDL_BUTTON_LEFT)) {
> 
> Is this change necessary?

It's actually a bug fix: state doesn't contain the button state but the
0/1 according to the event being a press or release event. Yes, that's
duplicate information from SDL.

Samuel

  reply	other threads:[~2008-03-05 13:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 11:47 [PATCH] ioemu: fix SDL mouse events processing Samuel Thibault
2008-03-05 12:18 ` [Qemu-devel] [PATCH] " Samuel Thibault
2008-03-05 13:09   ` Johannes Schindelin
2008-03-05 13:51     ` Samuel Thibault [this message]
2008-03-05 13:54     ` Samuel Thibault
2008-03-05 14:08       ` Johannes Schindelin
2008-03-13 19:50       ` Aurelien Jarno
2008-03-13 23:37         ` Samuel Thibault

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=20080305135126.GD9786@implementation.uk.xensource.com \
    --to=samuel.thibault@eu.citrix.com \
    --cc=Johannes.Schindelin@gmx.de \
    --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.