Discussion:
Proposed change to Pipmak's grabbing
Aidan Gauland
2009-10-26 09:18:33 UTC
Permalink
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
Christian Walther
2009-10-31 16:47:45 UTC
Permalink
Post by Aidan Gauland
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
Aidan Gauland
2009-10-31 23:21:59 UTC
Permalink
Post by Christian Walther
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).
Post by Christian Walther
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.
Christian Walther
2009-11-01 09:47:07 UTC
Permalink
Post by Aidan Gauland
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.
Post by Aidan Gauland
... 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)?
Post by Aidan Gauland
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.
Post by Aidan Gauland
Or make it possible to force
grabbing *off* permanently (but this probably would not improve anything).
That would make direct mouse mode unusable.

-Christian
Urs Holzer
2009-11-01 14:14:20 UTC
Permalink
Post by Christian Walther
Post by Aidan Gauland
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.
Aidan Gauland
2009-11-03 01:04:24 UTC
Permalink
Post by Urs Holzer
Post by Christian Walther
Post by Aidan Gauland
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
Christian Walther
2009-11-05 12:04:47 UTC
Permalink
Post by Aidan Gauland
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
* 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

Aidan Gauland
2009-11-03 00:50:33 UTC
Permalink
Post by Christian Walther
Post by Aidan Gauland
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.
Post by Christian Walther
Post by Aidan Gauland
... 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.
Post by Christian Walther
Post by Aidan Gauland
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.
Christian Walther
2009-11-04 20:52:24 UTC
Permalink
Post by Aidan Gauland
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
Loading...