Proposed change to Pipmak's grabbing

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Proposed change to Pipmak's grabbing

Aidan Gauland-2
Hello,

I have writtien a patch for Pipmak that changes the way it grabs the
window-manager input as follows:
* It no longer automatically when the mouse enters the window.
* It no longer ungrabs the mouse when the mouse is run against the window edge.
* Pressing Ctrl+Alt toggles the grabbing.
* When grabbing is on, a message is displayed in the window title that tells
the user how to get his mouse back.
* All calls to SDL_WM_GrabInput() have been changed to call a new function in
Pipmak itself: pipmakGrabInput().
* pipmakGrabInput() handles changing the title to add the message mentioned above.

I wrote this patch, because I always found the auto-grabbing a bit akward, and
I would like some feedback from the other Pipmak users on this.

  --Aidan



grabPatch-oct26.patch.gz (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Proposed change to Pipmak's grabbing

cwalther
Administrator
Aidan Gauland wrote:
> I have writtien a patch for Pipmak that changes the way it grabs the
> window-manager input
> ...
>
> I wrote this patch, because I always found the auto-grabbing a bit akward, and
> I would like some feedback from the other Pipmak users on this.

I have tried this patch, and it appears to work as intended. However, I
dislike the intention, because I think it decreases usability.

My main objection is that it makes the user aware of the grabbing and
requires him to think about it and understand the concept. The grabbing
should be an implementation detail, something that happens in the
background without the user noticing. Since you say you found it
awkward, it appears that this has not been the case for you? Perhaps
there's a way of fixing that, instead of trying to cover up the
symptoms? As it is, my impression is that you made things much more
awkward than before. It worked (mostly) nicely for me on Mac OS X
before, if it didn't for you on Linux, can you explain how?

Also, being able to ungrab while in direct mouse mode is confusing.

Technical note: There was a reason why we also grab in joystick mode,
where it wouldn't normally be necessary. That hasn't always been like
that. I don't remember exactly (would have to consult the SVN log), but
I think it was that otherwise I didn't manage to always get seamless
transitions between joystick and direct mode, without jumps of the
cursor. Ideally that is something that should be fixed in SDL, but I
didn't succeed on Mac OS X at the time, and gave up when I noticed that
things weren't any better on Windows and X11.

  -Christian



Reply | Threaded
Open this post in threaded view
|

Re: Proposed change to Pipmak's grabbing

Aidan Gauland-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Christian Walther wrote:

> I have tried this patch, and it appears to work as intended. However, I
> dislike the intention, because I think it decreases usability.
>
> My main objection is that it makes the user aware of the grabbing and
> requires him to think about it and understand the concept. The grabbing
> should be an implementation detail, something that happens in the
> background without the user noticing. Since you say you found it
> awkward, it appears that this has not been the case for you? Perhaps
> there's a way of fixing that, instead of trying to cover up the
> symptoms? As it is, my impression is that you made things much more
> awkward than before. It worked (mostly) nicely for me on Mac OS X
> before, if it didn't for you on Linux, can you explain how?

Now that I think about it that way (as an implementation detail), I think it
does make things worse.

What I don't like is that Pipmak makes the mouse jump when the mouse moves
over and past the window.  Although, this would not be much of an issue if I
were only playing a Pipmak game, instead of using it for development.  I have
tried Pipmak on Mac OS X (although I don't own a Macintosh), and it is much
smoother on that system.  It seems that this problem occurs on X11, no matter
what the window manager, since someone else on the mailing lists (Urs, I
think) said that he had problems with Pipmak's edge-resistance on KDE's window
manager (KWM, I think), and I have experienced it with three other window
managers (metacity, xfwm, and stumpwm).

Maybe we need to, instead, look at the workaround to prevent the mouse from
becoming permanently grabbed.  I think it was to generate a mouse-motion
event, which would be why the mouse jumps.  Or make it possible to force
grabbing *off* permanently (but this probably would not improve anything).

> Also, being able to ungrab while in direct mouse mode is confusing.

Yes, I admit I had not thought about that.  That makes things even more awkward.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEUEARECAAYFAkrsxpcACgkQjyzTRvYJmaWkEACTBnnipX2W3a90RZVSg0s/iIAF
jACfQKwAFBm8TyNeY4T6OhkJxD9c+10=
=mNdy
-----END PGP SIGNATURE-----


Reply | Threaded
Open this post in threaded view
|

Re: Proposed change to Pipmak's grabbing

cwalther
Administrator
Aidan Gauland wrote:
> What I don't like is that Pipmak makes the mouse jump when the mouse moves
> over and past the window.

Then the proper course of action would be to fix this in SDL. Grabbing
and ungrabbing should not make the mouse jump. I have never examined
grabbing in the X11 backend of SDL, maybe it's easy to fix. Maybe it's
even fixed already - I haven't followed SDL development for almost two
years. I don't even know what the status of SDL 1.3 is, whether it has
already supplanted 1.2 as the "stable" version.

> ... someone else on the mailing lists (Urs, I think) said that he had
> problems with Pipmak's edge-resistance on KDE's window manager

Didn't we eliminate the edge resistance (r177)?

> Maybe we need to, instead, look at the workaround to prevent the mouse from
> becoming permanently grabbed.  I think it was to generate a mouse-motion
> event, which would be why the mouse jumps.

Are you talking about any of revs 178, 179, 180, 195? I'm not sure if
they have anything to do with the issue.

> Or make it possible to force
> grabbing *off* permanently (but this probably would not improve anything).

That would make direct mouse mode unusable.

  -Christian



Reply | Threaded
Open this post in threaded view
|

Re: Proposed change to Pipmak's grabbing

Urs Holzer-2
Christian Walther wrote:
>> Or make it possible to force
>> grabbing *off* permanently (but this probably would not improve
>> anything).
>
> That would make direct mouse mode unusable.

This wouldn't be a problem when developing a game, would it? I think the
only right solution to this problem is to implement different behaviours
and an option that lets the user switch between them. As default we
should use a behaviour that is most convinient to a player, a developer
always can change the option.




Reply | Threaded
Open this post in threaded view
|

Re: Proposed change to Pipmak's grabbing

Aidan Gauland-2
In reply to this post by cwalther
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Christian Walther wrote:

> Aidan Gauland wrote:
>> What I don't like is that Pipmak makes the mouse jump when the mouse moves
>> over and past the window.
>
> Then the proper course of action would be to fix this in SDL. Grabbing
> and ungrabbing should not make the mouse jump. I have never examined
> grabbing in the X11 backend of SDL, maybe it's easy to fix. Maybe it's
> even fixed already - I haven't followed SDL development for almost two
> years. I don't even know what the status of SDL 1.3 is, whether it has
> already supplanted 1.2 as the "stable" version.

SDL 1.3 has yet to succeed SDL 1.2, and the version in Debian stable is only
one behind the latest upstream version.

I also have no idea where to begin with looking for this bug in SDL.

>> ... someone else on the mailing lists (Urs, I think) said that he had
>> problems with Pipmak's edge-resistance on KDE's window manager
>
> Didn't we eliminate the edge resistance (r177)?

Yes we did.  I was just pointing out that another X11-only grabbing-issue.

>> Maybe we need to, instead, look at the workaround to prevent the mouse from
>> becoming permanently grabbed.  I think it was to generate a mouse-motion
>> event, which would be why the mouse jumps.
>
> Are you talking about any of revs 178, 179, 180, 195? I'm not sure if
> they have anything to do with the issue.

Yes, sorry.  I was getting confused about what was changed.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrvflkACgkQjyzTRvYJmaUM2gCgg/1Ho4xi9Q+SM8tZsrTfzJ5w
LpoAn3g1S2JB2pkGZK2myTcqGixsxZqr
=PmSz
-----END PGP SIGNATURE-----


Reply | Threaded
Open this post in threaded view
|

Re: Proposed change to Pipmak's grabbing

Aidan Gauland-2
In reply to this post by Urs Holzer-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Urs Holzer wrote:

> Christian Walther wrote:
>>> Or make it possible to force
>>> grabbing *off* permanently (but this probably would not improve
>>> anything).
>> That would make direct mouse mode unusable.
>
> This wouldn't be a problem when developing a game, would it? I think the
> only right solution to this problem is to implement different behaviours
> and an option that lets the user switch between them. As default we
> should use a behaviour that is most convinient to a player, a developer
> always can change the option.

Urs has a good point.  Perhaps, as Pipmak can, but won't always, be used as
development tool, we should release two different versions: a developer build
 (for developers *using* Pipmak, not developers *of* Pipmak), and a user
build.  The only difference being that the developer build has features that
would be useful only to developers, and the user build would have these
stripped out at compile time.

Some features that would only be useful to developers that I can think of off
the top of my head:

* Highlighting controls.
* The table editor.
* Control over the grabbing.
* The Lua command-line.
* Creating a new, empty project (this would not be necessary for a copy of
Pipmak bundled with a game).

 --Aidan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrvgZgACgkQjyzTRvYJmaX9mACdEIHi7rDX4GEQn99ABMnelptr
aSIAn3cvvGC/49YbYNSi+W+R+EV7T6Rs
=MWx+
-----END PGP SIGNATURE-----


Reply | Threaded
Open this post in threaded view
|

Re: Proposed change to Pipmak's grabbing

cwalther
Administrator
In reply to this post by Aidan Gauland-2
Aidan Gauland wrote:
> I also have no idea where to begin with looking for this bug in SDL.

I would start by compiling SDL from source, running Pipmak (or a small
test application) in a debugger, and stepping into an SDL_WM_GrabInput
call to see what it does.

  -Christian



Reply | Threaded
Open this post in threaded view
|

Re: Proposed change to Pipmak's grabbing

cwalther
Administrator
In reply to this post by Aidan Gauland-2
Aidan Gauland wrote:

> Urs has a good point.  Perhaps, as Pipmak can, but won't always, be used as
> development tool, we should release two different versions: a developer build
>  (for developers *using* Pipmak, not developers *of* Pipmak), and a user
> build.  The only difference being that the developer build has features that
> would be useful only to developers, and the user build would have these
> stripped out at compile time.
>
> Some features that would only be useful to developers that I can think of off
> the top of my head:
>
> * Highlighting controls.
> * The table editor.
> * Control over the grabbing.
> * The Lua command-line.
> * Creating a new, empty project (this would not be necessary for a copy of
> Pipmak bundled with a game).

I have thought about this in the past, but dismissed the idea for
various reasons (mentioned here:
http://article.gmane.org/gmane.games.devel.pipmak.user/103). Mainly
because it seems an unnecessary complication to me.

As to the "control over grabbing" issue, I would still prefer to fix the
problem instead of making far-reaching decisions in an attempt to work
around it.

  -Christian