JTablet Mac OS X incompatibility

51 views
Skip to first unread message

Marcello Bastéa-Forte

unread,
Dec 16, 2010, 1:47:04 AM12/16/10
to jtabl...@googlegroups.com
I've done some digging into the latest issues with the Mac OS X driver. It doesn't look good.

The symptoms:
  • JTablet 2 doesn't get any events on Java applets
Everything works correctly with the command drag action or in a separate awt.Frame for all browsers,

This occurs in Firefox 4 beta (64-bit, possibly earlier) and Chrome 8 beta (32-bit, possibly earlier) but not Safari 5 (64-bit). 

If I choose (in Java Preferences) to run applets "in their own process" instead of "within the browser process," then Safari also stops working!

There are two causes of this problem:
  • Component.getMousePosition() and KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow() both always return null. 
    • This should be solveable/hackable, though I don't have a good solution yet.
    • At the very least this should allow for MouseListener support, but doesn't make JTablet very useful
  • The NSEvents are being mucked up in both Firefox/Chrome, and by the time they reach the JNI code, they're missing all the Tablet data.
    • Both Firefox (since 3.6.4) and Chrome (since ever?) have out-of-process plugins, so it might be related to that.
    • It's also possibly related to a recent update to the Java plugin.
    • On Firefox, the x/y coordinates include decimal information, but nothing else comes through (pressure, tilt, etc)
    • On Chrome, not even that comes through.
    • On Safari with "in their own process" is the same as Firefox, except MouseMove events are not even fired!
My guess, when the app runs in its own process, Java is a separate NSApplication, and JTablet isn't getting the original events. When it's embedded in a browser window, the browser decides when to forward events to the separate process (losing data in the process).

This seems to affect the Wacom Web plugin as well: http://www.wacomeng.com/web/index.html

I have no idea what to do about this. Somehow intercept the events at an OS level? Hi-jack the browser event stream?

Marcello

Marcello Bastéa-Forte

unread,
Dec 20, 2010, 1:45:32 AM12/20/10
to jtabl...@googlegroups.com
  • Component.getMousePosition() and KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow() both always return null. 
    • This should be solveable/hackable, though I don't have a good solution yet.
    • At the very least this should allow for MouseListener support, but doesn't make JTablet very useful
Turns out the Component.getMousePosition() thing is harder than I thought, the best I could do was use a MouseListener to detect enter/exit events, but it doesn't work if the window doesn't have focus, and if you switch focus while the mouse is over the window, it screws up. Not much I can do about that.
  • The NSEvents are being mucked up in both Firefox/Chrome, and by the time they reach the JNI code, they're missing all the Tablet data.
I have no idea what to do about this. Somehow intercept the events at an OS level? Hi-jack the browser event stream?

I did the middle thing and with a bit of fan-dangling it seems to work. I only enable this mode if I detect the driver being loaded in an out-of-process java plugin host.

Seems to work ok on Firefox 4, Safari 5 (both in-process and out-of-process), and Chrome 8.

Marcello
Reply all
Reply to author
Forward
0 new messages