No windowID in SDL_ProximityEvent

No windowID here, so what is x, y relative to?

330 typedef struct SDL_ProximityEvent
331 {
332 Uint8 type;
333 Uint8 which;
334 int cursor;
335 int x;
336 int y;
337 } SDL_ProximityEvent;

A quick look at SDL_events.h shows that this event is marked as there
for backward compatibility. A quick look at the code in SDL_mouse.c
shows no attempt to find out the windowid. So… I suspect that this
event is only their for backward compatibility and therefore only
works with one window. Which means you should not use this event when
working with SDL 1.3

Bob PendletonOn Fri, Jun 5, 2009 at 1:28 AM, Kenneth Bull wrote:

No windowID here, so what is x, y relative to?

?330 typedef struct SDL_ProximityEvent
?331 {
?332 ? ? Uint8 type;
?333 ? ? Uint8 which;
?334 ? ? int cursor;
?335 ? ? int x;
?336 ? ? int y;
?337 } SDL_ProximityEvent;


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


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

A quick look at SDL_events.h shows that this event is marked as there
for backward compatibility. A quick look at the code in SDL_mouse.c
shows no attempt to find out the windowid. So… I suspect that this
event is only their for backward compatibility and therefore only
works with one window. Which means you should not use this event when
working with SDL 1.3

Bob Pendleton

OK, that was completely wrong…

Proximity events are generated to tell when a stylus enters or leaves
the range of a tablet. That means there is no associated window.
These events tell you the status of an external hardware and do not
have anything to do with a window.

Bob PendletonOn Fri, Jun 5, 2009 at 2:16 PM, Bob Pendleton<@Bob_Pendleton> wrote:

On Fri, Jun 5, 2009 at 1:28 AM, Kenneth Bull wrote:

No windowID here, so what is x, y relative to?

?330 typedef struct SDL_ProximityEvent
?331 {
?332 ? ? Uint8 type;
?333 ? ? Uint8 which;
?334 ? ? int cursor;
?335 ? ? int x;
?336 ? ? int y;
?337 } SDL_ProximityEvent;


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


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


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

same problem though. except when a window is fullscreen, where exactly (x,y)
is is somewhat doubtful with multiple windows unless you specify a specific
windowID.On Friday, 5 June 2009 19:19:45 Bob Pendleton wrote:

On Fri, Jun 5, 2009 at 2:16 PM, Bob Pendleton wrote:

A quick look at SDL_events.h shows that this event is marked as there
for backward compatibility. A quick look at the code in SDL_mouse.c
shows no attempt to find out the windowid. So… I suspect that this
event is only their for backward compatibility and therefore only
works with one window. Which means you should not use this event when
working with SDL 1.3

Bob Pendleton

OK, that was completely wrong…

Proximity events are generated to tell when a stylus enters or leaves
the range of a tablet. That means there is no associated window.
These events tell you the status of an external hardware and do not
have anything to do with a window.

Bob Pendleton

On Fri, Jun 5, 2009 at 1:28 AM, Kenneth Bull<@Kenneth_Bull> wrote:

No windowID here, so what is x, y relative to?

330 typedef struct SDL_ProximityEvent
331 {
332 Uint8 type;
333 Uint8 which;
334 int cursor;
335 int x;
336 int y;
337 } SDL_ProximityEvent;


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


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

same problem though. ?except when a window is fullscreen, where exactly (x,y)
is is somewhat doubtful with multiple windows unless you specify a specific
windowID.

Yeah, I see that. Looking at the source for the X11 version of SDL1.3
I can tell you that the x and y that are returned are for the window
that the event was generated in, not for the root window. I can also
see that the window ID is available but that SDL is not returning it.

I do not know why the window id is not returned, but it must say that
does seem reasonable for SDL to return the window id in a proximity
event.

Maybe you should file a bug report.

Bob PendletonOn Sat, Jun 6, 2009 at 12:26 AM, Kenneth Bull wrote:

On Friday, 5 June 2009 19:19:45 Bob Pendleton wrote:

On Fri, Jun 5, 2009 at 2:16 PM, Bob Pendleton<@Bob_Pendleton> wrote:

A quick look at SDL_events.h shows that this event is marked as there
for backward compatibility. A quick look at the code in SDL_mouse.c
shows no attempt to find out the windowid. So… I suspect that this
event is only their for backward compatibility and therefore only
works with one window. Which means you should not use this event when
working with SDL 1.3

Bob Pendleton

OK, that was completely wrong…

Proximity events are generated to tell when a stylus enters or leaves
the range of a tablet. That means there is no associated window.
These events tell you the status of an external hardware and do not
have anything to do with a window.

Bob Pendleton

On Fri, Jun 5, 2009 at 1:28 AM, Kenneth Bull wrote:

No windowID here, so what is x, y relative to?

?330 typedef struct SDL_ProximityEvent
?331 {
?332 ? ? Uint8 type;
?333 ? ? Uint8 which;
?334 ? ? int cursor;
?335 ? ? int x;
?336 ? ? int y;
?337 } SDL_ProximityEvent;


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


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

I did. Bug 749 http://bugzilla.libsdl.org/show_bug.cgi?id=749.
It looks easy to fix, but I don’t have a tablet to test it with.On Saturday, 6 June 2009 22:43:01 Bob Pendleton wrote:

I do not know why the window id is not returned, but it must say that
does seem reasonable for SDL to return the window id in a proximity
event.

Maybe you should file a bug report.

Bob Pendleton

I do not know why the window id is not returned, but it must say that
does seem reasonable for SDL to return the window id in a proximity
event.

Maybe you should file a bug report.

Bob Pendleton

I did. ?Bug 749 http://bugzilla.libsdl.org/show_bug.cgi?id=749.
It looks easy to fix, but I don’t have a tablet to test it with.

Yeah, me either.On Tue, Jun 9, 2009 at 3:54 AM, Kenneth Bull wrote:

On Saturday, 6 June 2009 22:43:01 Bob Pendleton wrote:


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


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

All,

Perhaps I can test this later today - I’ll let you guys know. (I have a
Wacom Bamboo tablet).

Tim Jones
www.sdltutorials.comOn Tue, Jun 9, 2009 at 10:30 AM, Bob Pendleton wrote:

On Tue, Jun 9, 2009 at 3:54 AM, Kenneth Bull wrote:

On Saturday, 6 June 2009 22:43:01 Bob Pendleton wrote:

I do not know why the window id is not returned, but it must say that
does seem reasonable for SDL to return the window id in a proximity
event.

Maybe you should file a bug report.

Bob Pendleton

I did. Bug 749 http://bugzilla.libsdl.org/show_bug.cgi?id=749.
It looks easy to fix, but I don’t have a tablet to test it with.

Yeah, me either.


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

uploaded a patch, it’s attached here for easy access. Only needed to add two
lines. I documented the SDL_ProximityEvent structure while I was at it.

This should work as long as the operating system is actually reporting the
window ID itself, but it really does need to be tested.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: proximity.diff
Type: text/x-patch
Size: 1162 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090609/3334b2a7/attachment.binOn Tuesday, 9 June 2009 10:35:17 Tim Jones wrote:

Maybe you should file a bug report.

Bob Pendleton

I did. Bug 749 http://bugzilla.libsdl.org/show_bug.cgi?id=749.
It looks easy to fix, but I don’t have a tablet to test it with.

Yeah, me either.
All,

Perhaps I can test this later today - I’ll let you guys know. (I have a
Wacom Bamboo tablet).

Tim Jones
www.sdltutorials.com

Please someone, test the patch.

Bob PendletonOn Tue, Jun 9, 2009 at 11:00 AM, Kenneth Bull wrote:

On Tuesday, 9 June 2009 10:35:17 Tim Jones wrote:

Maybe you should file a bug report.

Bob Pendleton

I did. ?Bug 749 http://bugzilla.libsdl.org/show_bug.cgi?id=749.
It looks easy to fix, but I don’t have a tablet to test it with.

Yeah, me either.
All,

Perhaps I can test this later today - I’ll let you guys know. (I have a
Wacom Bamboo tablet).

Tim Jones
www.sdltutorials.com

uploaded a patch, it’s attached here for easy access. ?Only needed to add two
lines. ?I documented the SDL_ProximityEvent structure while I was at it.

This should work as long as the operating system is actually reporting the
window ID itself, but it really does need to be tested.


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


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

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>

Bob Pendleton

On Tue, Jun 9, 2009 at 11:00 AM, Kenneth Bull wrote:

On Tuesday, 9 June 2009 10:35:17 Tim Jones wrote:

Maybe you should file a bug report.

Bob Pendleton

I did. ?Bug 749
http://bugzilla.libsdl.org/show_bug.cgi?id=749. It looks
easy to fix, but I don’t have a tablet to test it with.

Yeah, me either.
All,

Perhaps I can test this later today - I’ll let you guys know. (I
have a Wacom Bamboo tablet).

Tim Jones
www.sdltutorials.com

uploaded a patch, it’s attached here for easy access. ?Only needed
to add two lines. ?I documented the SDL_ProximityEvent structure
while I was at it.

This should work as long as the operating system is actually
reporting the window ID itself, but it really does need to be
tested.


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

ok… looks like this will take a bit more work, at least on X.
can anyone test this patch on windows?

Some useful references:
Windows:
http://www.wacomeng.com/devsupport/ibmpc/gddevpc.html
http://www9.plala.or.jp/herm/Pages/Localized/WinTab/6-2.html
Linux:
http://linuxwacom.sourceforge.net/index.php/toc
https://sourceforge.net/project/downloading.php?group_id=69596&filename=linuxwacom-0.8.3-5.tar.bz2&a=78556640
xidump
Both:
http://www.wacomeng.com/devsupport/index.html

I’ll peek around the code again myself and see what I can find.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

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.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: proximity.diff
Type: text/x-patch
Size: 2272 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090609/345b11ce/attachment.binOn Tuesday, 9 June 2009 20:03:26 you wrote:

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