Summary: | AWT-to-NEWT event modifier translation does not preserve mouse button state | ||
---|---|---|---|
Product: | [JogAmp] Newt | Reporter: | Rob Hatcherson <rob.hatcherson> |
Component: | x11 | Assignee: | Rob Hatcherson <rob.hatcherson> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | gouessej, rami.santina, sgothel |
Priority: | --- | ||
Version: | 1 | ||
Hardware: | pc_x86_32 | ||
OS: | linux | ||
Type: | --- | SCM Refs: |
jogl 811e3791b98fea0dfa3b7d301cb532c54df8dc82
jogl 13168c99ff9e8bf71c83f1be7afee270a3db4074
jogl 7ec58d773535e86e413e3c581a5e5bd734cb1269
jogl 58eb9d922c2a16a2724aaa2188c56784d440fb99
jogl f3e2467decf2a5ee47cfb458f7071772f39ea9c6
jogl d45f777e7969769eaa9b7d7f3eb5b34c10268368
jogl 17fde6c517b4ccf91b07c7e86974019bcbfee642
|
Workaround: | --- | ||
Bug Depends on: | |||
Bug Blocks: | 656 | ||
Attachments: | test.sh output |
Description
Rob Hatcherson
2012-10-12 19:14:37 CEST
Created attachment 376 [details]
test.sh output
Thank you Rob! Status: I have implemented a candidate patch for this particular variation of the problem. At your request I have also implemented a candidate comprehensive JUnit test for general testing of NEWT event modifier preservation for at least .../awt/GLCanvas, NewtCanvasAWT, and NewtCanvasSWT. I think to test .../swt/GLCanvas we would need a SWT equivalent to the AWT...Adapter classes (?); I might be wrong about this, as I am still absorbing what all these pieces do. However... While the unit tests work fine for .../awt/GLCanvas at least on Linux, they work less fine for NewtCanvasAWT and NewtCanvasSWT. Examples: - When the robot clicks in the test window when using NewtCanvasAWT and NewtCanvasSWT, there appear to be synthesized EVENT_MOUSE_EXITED and EVENT_MOUSE_ENTERED events prior to MOUSE_PRESSED, and the final MOUSE_CLICKED is omitted. - Event modifiers don't seem to be there in the expected form when using NewtCanvasAWT and NewtCanvasSWT. I'm still working on making sure these are real problems and not some artifact of my test code. If these persist should I go straight to Bugzilla with them and start discussion there? In particular, skip cluttering up the forum with this kind of low-level discussion? I probably would: - File a low-priority enhancement bug on AWT...Adapter equivalents for SWT. - File a bug about the superfluous synthesized EVENT_MOUSE_EXITED/EVENT_MOUSE_ENTERED events. - File a bug about the missing MOUSE_CLICKED. - File a new bug for the other missing modifier cases. Since the AWT is a common case and the .../awt/GLCanvas tests work, I am inclined at the moment to submit the work I have so far for general comments. If you're satisfied with it then those changes will at least fix the NEWT event modifiers for the common .../awt/GLCanvas case. Then we can discuss these other issues in the new bugs noted above. Preferences? (In reply to comment #3) > Status: > > I have implemented a candidate patch for this particular variation of the > problem. > > At your request I have also implemented a candidate comprehensive JUnit test > for general testing of NEWT event modifier preservation for at least > .../awt/GLCanvas, NewtCanvasAWT, and NewtCanvasSWT. I think to test > .../swt/GLCanvas we would need a SWT equivalent to the AWT...Adapter classes > (?); I might be wrong about this, as I am still absorbing what all these pieces > do. > > However... > > While the unit tests work fine for .../awt/GLCanvas at least on Linux, they > work less fine for NewtCanvasAWT and NewtCanvasSWT. > > Examples: > > - When the robot clicks in the test window when using NewtCanvasAWT and > NewtCanvasSWT, there appear to be synthesized EVENT_MOUSE_EXITED and > EVENT_MOUSE_ENTERED events prior to MOUSE_PRESSED, and the final MOUSE_CLICKED > is omitted. Ofc it might not be possible to have the very same events produced when using the native window parenting (NewtCanvasAWT, etc). Keep in mind that the visible NEWT window is on top of the native AWT/SWT peer and hence the focus cycle _is_ a bit more complicated .. and produces more events. The AWT / NEWT focus handling in this case is indeed a huge mess due to unpredicted / different behavior on some platforms. > > - Event modifiers don't seem to be there in the expected form when using > NewtCanvasAWT and NewtCanvasSWT. Key and mouse events are coming from NEWT itself, i.e. the native subsystem. > > I'm still working on making sure these are real problems and not some artifact > of my test code. If these persist should I go straight to Bugzilla with them > and start discussion there? In particular, skip cluttering up the forum with > this kind of low-level discussion? I probably would: > > - File a low-priority enhancement bug on AWT...Adapter equivalents for SWT. > - File a bug about the superfluous synthesized > EVENT_MOUSE_EXITED/EVENT_MOUSE_ENTERED events. > - File a bug about the missing MOUSE_CLICKED. > - File a new bug for the other missing modifier cases. > > Since the AWT is a common case and the .../awt/GLCanvas tests work, I am > inclined at the moment to submit the work I have so far for general comments. > If you're satisfied with it then those changes will at least fix the NEWT event > modifiers for the common .../awt/GLCanvas case. Then we can discuss these > other issues in the new bugs noted above. > > Preferences? Well, if you don't break current unit tests w/ your changes - or can correct / describe such changes in behavior - I agree. This task (unifying event handling) is a heavy one but surely required to provide a reliable system for production. See Bug 601 and Bug 631 .. even for key events the story ain't over yet. FYI .. NEWT's (native) KeyEvent handling has been refined (see Bug 601 and 631, as well as KeyEvent class and rel. commits.) Maybe it helps - available next week to continue working on this issue. OK. I've been keeping up with your master on github every few days. I haven't pushed the changes to my clone of your master yet though, simply due to time constraints. I'll try to put priority on this next week. You're right - an overhaul to the event system will be a substantial task. Since the existing infrastructure is very far along it's probably best at this point to smooth out its few remaining rough spots and get it working as consistently as possible across AWT/SWT/NEWT/etc. Then we'll have time to step back and think about whether or not an improved approach is warranted. TODO: Unify synthesization of NEWT event artifacts as described by the above, allowing NEWT event translation to benefit from same code to gain same semantics. Notable: AWTNewtEventFactory and SWTNewtEventFactory (In reply to comment #7) > TODO: Unify synthesization of NEWT event artifacts as described by the > above, > allowing NEWT event translation to benefit from same code to gain same > semantics. > Notable: AWTNewtEventFactory and SWTNewtEventFactory See Bug 656 |