It has one now Re: No windowID in SDL_ProximityEvent

Last night Sam added a windowID to the proximity event. He also
reordered the data fields in events for convenience and did a lot of
other stuff. Sam was a busy guy. :slight_smile: The changes are available from
the svn server.

Try it now and lets see what the results are.On Tue, Jun 9, 2009 at 9:42 PM, Kenneth Bull wrote:

On Tuesday, 9 June 2009 20:03:26 you wrote:

On Tuesday, 9 June 2009 13:56:57 Gerry JJ wrote:

Den Tue, 9 Jun 2009 11:16:35 -0500

skrev Bob Pendleton <@Bob_Pendleton>:

Please someone, test the patch.

I tested it, and it doesn’t seem to work here (Wacom Intous2, Linux
(64-bit), X.org 1.6.1). ?Made a little test program that creates three
windows and looks for proximity events, and the window id is reported
as 0 for all of them.

Also, if proximity out occurs within one of the windows, proximity in
is reported even if the entry point is outside all of them (in this
case, x and y is the same as the last proximity out event), but
otherwise, proximity in/out is lost. ?It would be useful if proximity
events always got reported even when outside all windows if possible,
with window id 0 for no window (for tool switching).

  • Gerry

ok… looks like this will take a bit more work, at least on X.

I’ll peek around the code again myself and see what I can find.

I added SDL_SetMouseFocus(proximity->id, data->windowID) before each
SDL_SendProximity(…) call in SDL_x11events.c (see the attached diff).

This really may or may not work. ?If it doesn’t, try determining the windowID
from proximity->window, or, failing that, using proximity->root_x, proximity-

root_y and the position of the windows. ?If absolutely nothing works, you
could use root_x, root_y and forget about windowID, but this would obviously
be less than desirable.

You can use these for reference for XProximityNotifyEvent:
?http://ring.nict.go.jp/archives/NetBSD/NetBSD-
release-5-0/xsrc/xfree/xc/lib/Xi/XExtInt.c
?http://people.freedesktop.org/~whot/patches/XInput.h

This really isn’t something I can work on without a tablet. ?The previous
patch is the bare minimum to get this working in general. ?Even if it’s not
working on X yet, I would recommend applying it anyway and handle X and
Windows support separately.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------

Den Wed, 10 Jun 2009 12:26:42 -0500
skrev Bob Pendleton :

Last night Sam added a windowID to the proximity event. He also
reordered the data fields in events for convenience and did a lot of
other stuff. Sam was a busy guy. :slight_smile: The changes are available from
the svn server.

Try it now and lets see what the results are.

I get the same results as with Kenneth Bull’s patch.

However … I added motion event display to my little test program (which
I should’ve done originally, perhaps… left it out because it makes the
proximity events scroll away), and window id is reported as 0 for all
mouse events, not just proximity.

Also, the "SDL_SetMouseFocus(proximity->deviceid, data->windowID);"
part of Kenneth’s second patch wasn’t in Sam’s, so I tried adding it.
Compile then fails with “?X11_MouseData? has no member named
?windowID?” … so it’s probably not so surprising that window id
doesn’t work at all, then.

I’ll try fiddling with it a bit later and see if I can make things work.

(Also, should there be a ‘cursor’ field in the button and wheel events?
They currently don’t have one.)

  • Gerry>

On Tue, Jun 9, 2009 at 9:42 PM, Kenneth Bull wrote:

On Tuesday, 9 June 2009 20:03:26 you wrote:

On Tuesday, 9 June 2009 13:56:57 Gerry JJ wrote:

Den Tue, 9 Jun 2009 11:16:35 -0500

skrev Bob Pendleton :

Please someone, test the patch.

I tested it, and it doesn’t seem to work here (Wacom Intous2,
Linux (64-bit), X.org 1.6.1). ?Made a little test program that
creates three windows and looks for proximity events, and the
window id is reported as 0 for all of them.

Also, if proximity out occurs within one of the windows,
proximity in is reported even if the entry point is outside all
of them (in this case, x and y is the same as the last proximity
out event), but otherwise, proximity in/out is lost. ?It would
be useful if proximity events always got reported even when
outside all windows if possible, with window id 0 for no window
(for tool switching).

  • Gerry

ok… looks like this will take a bit more work, at least on X.

I’ll peek around the code again myself and see what I can find.

I added SDL_SetMouseFocus(proximity->id, data->windowID) before each
SDL_SendProximity(…) call in SDL_x11events.c (see the attached
diff).

This really may or may not work. ?If it doesn’t, try determining
the windowID from proximity->window, or, failing that, using
proximity->root_x, proximity-

root_y and the position of the windows. ?If absolutely nothing
works, you
could use root_x, root_y and forget about windowID, but this would
obviously be less than desirable.

You can use these for reference for XProximityNotifyEvent:
?http://ring.nict.go.jp/archives/NetBSD/NetBSD-
release-5-0/xsrc/xfree/xc/lib/Xi/XExtInt.c
?http://people.freedesktop.org/~whot/patches/XInput.h

This really isn’t something I can work on without a tablet. ?The
previous patch is the bare minimum to get this working in general.
?Even if it’s not working on X yet, I would recommend applying it
anyway and handle X and Windows support separately.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

The low level X event handling code in /src/video/x11 is incomplete.
Mouse focus never gets set and you will never get a window enter/leave
event. I’ll spend some time on this today, but then I’m going away for
several days.

The code is about half way between adapted for multiple devices and
about half way not. Looks like an area where any time spent would be
very useful.

Bob PendletonOn Thu, Jun 11, 2009 at 3:08 AM, Gerry JJ wrote:

Den Wed, 10 Jun 2009 12:26:42 -0500
skrev Bob Pendleton <@Bob_Pendleton>:

Last night Sam added a windowID to the proximity event. He also
reordered the data fields in events for convenience and did a lot of
other stuff. Sam was a busy guy. :slight_smile: The changes are available from
the svn server.

Try it now and lets see what the results are.

I get the same results as with Kenneth Bull’s patch.

However … I added motion event display to my little test program (which
I should’ve done originally, perhaps… left it out because it makes the
proximity events scroll away), and window id is reported as 0 for all
mouse events, not just proximity.

Also, the "SDL_SetMouseFocus(proximity->deviceid, data->windowID);"
part of Kenneth’s second patch wasn’t in Sam’s, so I tried adding it.
Compile then fails with “?X11_MouseData? has no member named
?windowID?” … so it’s probably not so surprising that window id
doesn’t work at all, then.

I’ll try fiddling with it a bit later and see if I can make things work.

(Also, should there be a ‘cursor’ field in the button and wheel events?
They currently don’t have one.)

  • Gerry

On Tue, Jun 9, 2009 at 9:42 PM, Kenneth Bull wrote:

On Tuesday, 9 June 2009 20:03:26 you wrote:

On Tuesday, 9 June 2009 13:56:57 Gerry JJ wrote:

Den Tue, 9 Jun 2009 11:16:35 -0500

skrev Bob Pendleton <@Bob_Pendleton>:

Please someone, test the patch.

I tested it, and it doesn’t seem to work here (Wacom Intous2,
Linux (64-bit), X.org 1.6.1). ?Made a little test program that
creates three windows and looks for proximity events, and the
window id is reported as 0 for all of them.

Also, if proximity out occurs within one of the windows,
proximity in is reported even if the entry point is outside all
of them (in this case, x and y is the same as the last proximity
out event), but otherwise, proximity in/out is lost. ?It would
be useful if proximity events always got reported even when
outside all windows if possible, with window id 0 for no window
(for tool switching).

  • Gerry

ok… looks like this will take a bit more work, at least on X.

I’ll peek around the code again myself and see what I can find.

I added SDL_SetMouseFocus(proximity->id, data->windowID) before each
SDL_SendProximity(…) call in SDL_x11events.c (see the attached
diff).

This really may or may not work. ?If it doesn’t, try determining
the windowID from proximity->window, or, failing that, using
proximity->root_x, proximity-

root_y and the position of the windows. ?If absolutely nothing
works, you
could use root_x, root_y and forget about windowID, but this would
obviously be less than desirable.

You can use these for reference for XProximityNotifyEvent:
?http://ring.nict.go.jp/archives/NetBSD/NetBSD-
release-5-0/xsrc/xfree/xc/lib/Xi/XExtInt.c
?http://people.freedesktop.org/~whot/patches/XInput.h

This really isn’t something I can work on without a tablet. ?The
previous patch is the bare minimum to get this working in general.
?Even if it’s not working on X yet, I would recommend applying it
anyway and handle X and Windows support separately.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------