| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
when in offscreen-mode (OSX/CALayer)
NewtCanvasAWT.FocusAction must take focus when in offscreen-mode (OSX/CALayer)
since the NEWT window _is_ offscreen (no input events) and AWT events are translated to NEWT.
Regression of commit 0be87f241c0f0b2f5881d9a602ce12378b8e453d
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
multiple threads; Fix Bug 892: Reduce Focus Hopping
Since we manage focus key traversal ourselves w/o requiring the AWT
component to have the focus[1],
we simply can drop requesting the focus for 'focus hopping' NEWT -> AWT -> NEWT[2].
Further more, 'MenuSelectionManager.defaultManager().clearSelectedPath()'
must be performed on AWT-EDT w/o blocking. Otherwise it may perform blocking tasks on AWT-EDT.
[1] Commit cb7118fc875b6722803e4b11d5681671962a8d3a
introduced function to query the next or previous 'to be focused' component:
AWTMisc.getNextFocus(..) .. etc.
[2] Focus hopping is also addressed in Bug 892
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Support 'Continue Drag on Exit'
- Track dragging operation, allow exterior dragging
- Hence track EXIT (see below)
- Windows:
- Capture mouse for exterior dragging
- Only 'NewtWindows_trackPointerLeave' if 'entering'
- Simplify touch: No 'inside' check - Not required.
- Consistent Mouse ENTER/EXIT
- Track ENTER/EXIT and synthesize if required, drop duplicate
- OSX benefits, since it never produced ENTER/EXIT events
- AWT (or other TK) translated events beahve equal now.
- Required for EXIT event after ending exterior dragging and final RELEASE
Tests: Passed unit tests 'junit.run.newt.event' on
- GNU/Linux
- Windows7
- OSX 10.7
Tested exterior tracking manually w/ NEWT TestGearsES2NEWT and TestGearsES2NewtCanvasAWT:
- GNU/Linux
- Windows7 (mouse)
- Windows8.1 (touch)
- OSX 10.7
|
|
|
|
| |
consumePointerEvent(..) impl. details
|
|
|
|
| |
not break Windows < 7 Compatibility
|
|
|
|
| |
reusing of app)
|
| |
|
|
|
|
| |
device does _not_ require locking on global shared device.
|
|
|
|
| |
applications to not block until window becomes visible.
|
|
|
|
|
|
|
|
|
|
| |
manually in close0()
Release NewtMacWindow manually in close0()
- Mark [NewtMacWindow setReleasedWhenClosed: NO] in init0(..)
- Release NewtMacWindow manually in close0(..)
Check pointer args in close0(..)
|
|
|
|
| |
handles before usage in NewtMacWindow (Not the culprit .. but more safe)
|
|
|
|
| |
DEBUG output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
; Fix GLContext memory contract (volatile)
(Unit test remarks see below)
- Add shared GLContext queries
- Refined GLContextShareSet:
- Use IdentityHashMap since GLContext's can only be identical w/ same reference (footprint, performance)
- Add API doc for clarification
- Add methods:
- ArrayList<GLContext> getCreatedShares(final GLContext context)
- ArrayList<GLContext> getDestroyedShares(final GLContext context)
- Use 'final' where possible
- Add GLContext methods:
- boolean isShared()
- List<GLContext> getCreatedShares()
- List<GLContext> getDestroyedShares()
- Add GLSharedContextSetter interface defining setting a shared GLContext
directly (GLContext) or via a GLAutoDrawable:
- setSharedContext(GLContext)
- setSharedAutoDrawable(GLAutoDrawable)
Both cause initialization/creation of GLAutoDrawable's drawable/context to be postponed,
if the shared GLContext is not yet created natively or
the shared GLAutoDrawable's GLContext does not yet exist.
Most of impl. resides in GLDrawableHelper
Implemented in:
- GLAutoDrawableBase, GLOffscreenAutoDrawable
- GLWindow
- AWT GLCanvas
TODO:
- GLJPanel
- SWT GLCanvas
- GLDrawableFactory:
- Add 'GLOffscreenAutoDrawable createOffscreenAutoDrawable(..)' variant w/o passing the
optional shared GLContext _and_ specifying lazy GLContext
creation. This allows to benefit from GLSharedContextSetter contract.
Lazy GLContext creation is performed at 2st display() call at the latest.
All JOGL code and unit tests use this new method now.
- Mark 'createOffscreenAutoDrawable(..)' w/ shared GLContext argument
and immediate GLContext creation deprecated - shall be removed in 2.2.0
- Make reference to GLContext and it's native handle volatile
Since we rely on the query 'GLContext.isCreated()' to properly allow GLAutoDrawable's to query whether
a shared GLContext is natively created (already), the handle must be volatile
since such query and the actual creation may operate on different threads.
+++++
- Add/Refine shared GLContext unit tests demonstrating diff. sharing methods.
All variants of using shared GLContext:
com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBO*
Most convenient way to share via setSharedAutoDrawable(GLAutoDrawable):
com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES2[NEWT|AWT]3
AWT use w/ JTabbedPane using setSharedAutoDrawable(GLAutoDrawable):
com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextWithJTabbedPaneAWT
|
|
|
|
| |
more stable (i.e. only 2 pointer pressed)
|
|
|
|
|
|
|
| |
One String is already being built, passing it to new String() is just wasteful as
the temp String can be returned just as easily.
Signed-off-by: Harvey Harrison <[email protected]>
|
|
|
|
| |
Signed-off-by: Harvey Harrison <[email protected]>
|
|
|
|
| |
Signed-off-by: Harvey Harrison <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
button/pointer', i.e. button == 0, pointer-ID == -1
doPointerEvent:
- allow id==-1 -> button==0 for no button, i.e. mouse move
doMouseEvent:
- keep button 0 value, i.e. map to pointer-ID -1
|
|
|
|
|
|
|
|
|
|
|
|
| |
a05b87a369441d9ef38f97929f866b3d4ced0e57: NULL printGLAD of GLCanvas and NewtCanvasAWT
We have to pre-init printGLAD w/ current GLAD (similiar w/ GLJPanel).
Also properly define reqNewGLAD:
reqNewGLAD = !caps.getSampleBuffers() && ( reqNewGLADOnscrn || reqNewGLADSamples || reqNewGLADSize );
where '!caps.getSampleBuffers() && ( .. )' is due to Bug 830,
swapGLContextAndAllGLEventListener and onscreen MSAA w/ NV/GLX does not work.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LBUTTON[DOWN|UP] issues
- w/ TOUCH, Win8 may steal focus (KILLFOCUS), quickly grab FOCUS again when on TOUCH operation
- track 'touchDownLastUp', and don't act on LBUTTON[UP|DOWN] and MOUSEMOVE if just lifted last finger
- don't use GetMessageExtraInfo() to distinguish MOUSE/TOUCH, simply use tracked touchDownCount
- Also track mouseInside in TOUCH operation, i.e. true if _all_ fingers are inside,
otherwise don't send TOUCH event
|
|
|
|
| |
consumePointerEvent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Native:
- WindowUserData tracks:
- window size
- mouse inside
- pointer touch-down count
and flags whether multiple-touch is supported.
- Suppress WM_*BUTTON* events if within TOUCH operations, e.g. fingers are pressed, or
if event is determined as TOUCH (0 != GetMessageExtraInfo())
- MOUSEMOVE issues NewtWindows_trackPointerLeave(..) directly
if no TOUCH operation is in process.
Removes need for MouseListener on Java side.
- TOUCH events are send as follows:
- PRIMARY first
- 1 MOVE 2nd (if not sent already)
- UP/DOWN (if not sent already)
We only send max. one MOVE event, since Win7 / Win8
assignes MOVE per default, even if no actual move happened.
Hence a single MOVE event shall suffice and is compatible
w/ e.g. Android (AFAIK).
- TOUCH pointer names are mapped to consecutive IDs
on the java side.
|
| |
|
|
|
|
|
|
| |
'consume<Type>Event(<Type>Event ..)' must be protected and non-final
Overriding by impl. class allowed.
|
|
|
|
| |
implementer can use PointerType.valuesOf(int[] ordinals) to convert. Enhanced API doc. Methods 'final'
|
|
|
|
|
|
|
| |
40863632d1428de015099b5967e5136425e99f25), throw IllegalArgumentException if ordinal is out-of-range. Add API doc.
- FFMPEGNatives
- MouseEvent.PointerType
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
consumePointerEvent(..) - Unifies native mouse and Android's pointer event, ready for Win7 touch
Unify event processing in new doPointerEvent(..), which is also invoked from doMouseEvent(..),
and consumePointerEvent().
doPointerEvent(..): Validates and modifies event data and finally creates the event,
where consumePointerEvent(..) calls gesture handlers and may synthesize events.
Unifies native mouse and Android's pointer event, ready for Win7 touch.
AndroidNewtEventFactory calls doPointerEvent(..) directly.
Removed lots of duplicated pointer event handling code.
|
|
|
|
| |
FFMPEGNatives's Enums and new MouseEvent.PointerType.valueOf(int)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
InputEvent: getButtonDownCount() and isAnyButtonDown();
- Clarify 'Multiple-Pointer' w/ button[mask] semantics
- Pointer IDs start w/ 0 and are consecutive numbers.
- 'button' == triggering pointer-ID
- buttonMask in modifiers show pressed button _and_ pointer-IDs
- deprecated BUTTON_NUMBER -> use BUTTON_COUNT (name semantics)
|
|
|
|
| |
NativeWindow's util types.
|
|
|
|
| |
allowing user to set custom tile size for performance evaluation/tweak
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We processed MouseEvents within NEWT as follows:
sendMouseEvent/enqueueMouseEvent -> doMouseEvent,
- called by native code to be delivered via consumeMouseEvent (now or later)
- events are validated (move/drag, boundaries)
- missing events are synthesized (click, enter, ..)
as well as in several factories, i.e.:
- AWTNewtEventFactory (1:1)
- AndroidNewtEventFactory
- synthesized events .. (click, ..)
- android typed gesture detection (drag -> 1 finger scroll..)
The latter enqueues events do Window/Display directly to be consumed by WindowImpl.
Then users may have their own gesture detection etc.
+++
This change unifies mouse/pointer event processing within NEWT within consumeEvent(..)
which represents a common entry point.
Gesture processing is now realized w/ a public API
- GestureHandler
- GestureHandler.GestureListener
- GestureHandler.GesureEvent
which supplies:
- default impl. of optional gesture handlers (scroll, .. - default: enabled)
- public API to add/remove gesture-handler and -listener
+++
This allows our impl. to scale better in support of
more multiple pointer devices (-> Win7/Win8, X11, ..).
|
|
|
|
| |
beginTile() throws an EOT IllegalStateException to avoid division by zero
|
|
|
|
| |
from fullscreen; JOGLNewtAppletBase: Reparent to pos 32/32, trying to avoid browser window focus/top stealing on X11.
|
|
|
|
|
|
|
|
|
|
| |
favor of FocusPropertyChangeListener requestFocusNEWTChild()
The AWT's requestFocus*() overrides were intended to receive the AWT focus (default) and
clear it afterwards to forward the focus to the NEWT component -> requestFocusNEWTChild().
This can be achieved simply by using our FocusPropertyChangeListener
and invoking requestFocusNEWTChild() when receiving the focus on the NewtCanvasAWT component.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add reparentWindow(..) top-level position arguments; Misc
- Fixes X11 unsuccessful return to parent window
On X11 when returning to parent window (-> CHILD),
we have to set the window invisible and wait for the result.
Otherwise it sometimes happens that the WM's reparent operation fails,
i.e. the window won't become a child of desired parent and is positioned randomly.
- Add reparentWindow(..) top-level position arguments
.. allows bringing the child-window to top-level w/ a desired position.
Otherwise the window would be positioned elsewhere as a top-level
as the plain reparenting operation.
X11 needs to set position and size _after_ making the window visible,
otherwise WM may ignore the XConfigureWindow request.
- Reparent recreate shall always store the desired position and size
On OSX/CALayer when recreation is being used, we need to store the pos/size
for later creation.
- Tests: Use 'NewtAWTReparentingKeyAdapter' where possible (reparent/fullscreen)
instead of duplicating such code.
NewtAWTReparentingKeyAdapter: Performs reparenting and fullscreen operations
off-thread (i.e. not on AWT/NEW EDT) while decorating the action w/
revoking/restoring the ExclusiveContextThread (ECT).
Manually tested 'TestGearsES2NewtCanvasAWT' reparenting and fullscreen
on X11, Windows and OSX/CALayer w/ JDK 7u40 successful.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
which is to be stopped.
This case appears on e.g. OSX/CALayer (offscreen) reparenting using recreation (onscreen <-> offscreen),
i.e. display destroy/create is performed on EDT.
Misc Cleanup:
- Rename EDTUtil: restart() -> start()
- Rename Display: validateEDT() -> validateEDTStopped()
- Simplify Display.setEDTUtil(..): Remove need for redundant 'newEDTUtil' local var.
- Simplify Display.runOnEDTIfAvail(..): edtUtil is never null
|
|
|
|
|
|
| |
main-thread must be synchronized (wait-until-done)
- Leave WindowDriver.close0(..) w/o sync
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
synchronized (wait-until-done)
Wait-until-done (main thread):
- WindowDriver.close0(..)
- WindowDriver.initWindow0(..)
Otherwise a re-queued operation (i.e. CALayer attachment)
will mixup the order ..
Experienced w/ fullscreen exit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[invisible-exit-visible] (-> like reparent); Always force focus; X11: Always use ALWAYSONTOP.
- Remove unused 'fullscreenUseSpanningMode' state
- Exit re-parenting fullscreen w/ [invisible-exit-visible] (-> like reparent)
solves X11 issue, where the NEWT window doesn't 'return to it's parent'.
Probably also fixes Bug 836!
- Always force focus when enter and exit FS
- X11: Always use ALWAYSONTOP
No reason to behave different (spanning and normal-fs)
|
|
|
|
| |
reproducible after restart of OSX test machine!
|
|
|
|
| |
'handleReshape' if panelSize/awtSize mismatch, otherwise 'sendReshape' and exception if offscreen size doesn't match panelSize.
|
|
|
|
|
|
|
|
|
| |
AWT-GLAD's size, since the latter uses AWT's component size.
.. the AWT component size could have been modified after setupPrinting(..).
The AWT-GLAD getWidth() and getHeight() is implemented by AWT's component
and hence may not reflect the actual GLDrawable size while printing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
functionality (reshapeTile(..), ..); Only process GLEventListener impl. TileRendererListener; attachToAutoDrawable -> attachAutoDrawable, etc.
-TileRendererNotify -> TileRendererListener
- Added methods:
- void reshapeTile(TileRendererBase tr,int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight);
- void startTileRendering(TileRendererBase tr);
- void endTileRendering(TileRendererBase tr);
allowing to clarify user code and API specification,
i.e. TR only processes GLEventListener which impl. TileRendererListener.
This also allows simplifying the API doc, while having a more descriptive
reshape method focusing solely on tile rendering.
Further more, the start/end TR methods allow certain GL related actions
while the context is current before and after iterating through the tiles.
This is even used for RandomTileRenderer (one tile only), to allow
to reuse same TileRendererListener for diff TRs.
- Fix language, attach and detach usage was vice versa. We do attach an GLAutoDrawable to a TR
- attachToAutoDrawable -> attachAutoDrawable
- detachFromAutoDrawable -> detachAutoDrawable
- Adapted unit tests.
|
|
|
|
|
|
|
|
|
| |
JAWT_OSX_CALAYER_QUIRK_SIZE and JAWT_OSX_CALAYER_QUIRK_POSITION.
- Provide quirk bits for OSX CALayer depending on used JVM/AWT
and act accordingly.
- TestBug816OSXCALayerPosAWT: Add resize by frame
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
not destroyed, otherwise use current thread's tg.
With jdk7u40, when re-launching a NEWT applet (JOGLNewtApplet1Run),
i.e. via browser back and forth, the following exception happens:
java.lang.RuntimeException: java.lang.IllegalThreadStateException
at com.jogamp.newt.awt.applet.JOGLNewtApplet1Run.init(JOGLNewtApplet1Run.java:218)
at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalThreadStateException
at java.lang.ThreadGroup.addUnstarted(Unknown Source)
at java.lang.Thread.init(Unknown Source)
at java.lang.Thread.<init>(Unknown Source)
at jogamp.newt.DefaultEDTUtil$NEDT.<init>(DefaultEDTUtil.java:280)
at jogamp.newt.DefaultEDTUtil.restart(DefaultEDTUtil.java:91)
at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:231)
at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:1758)
at jogamp.newt.WindowImpl.setUndecorated(WindowImpl.java:1477)
at com.jogamp.newt.opengl.GLWindow.setUndecorated(GLWindow.java:278)
at com.jogamp.newt.awt.applet.JOGLNewtApplet1Run.init(JOGLNewtApplet1Run.java:188)
... 3 more
This is due to 7u40's changed ThreadGroup (tg) lifecycle, i.e. the tg is destroyed.
In such case, DefaultEDTUtil.restart() shall use the current threads tg.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
double precicion clip bounds 'all the way'; Explicitly scale image and clip w/ current scaled transform.
- Use 'Shape getClip()'
Don't assume Rectangle2D, but use Shape's getBounds2D()
- Use double precicion clip bounds 'all the way'
Remove rounding error on clip bounds w/ start value, which was _not_ using doubles.
- Explicitly scale image and clip w/ current scaled transform.
Instead of abusing Graphics2D's clip shape to scale image size and clip-area,
explicitly use transform both bounding boxes into transformed space,
scale space and transform out (inversion).
A possible NoninvertibleTransformException will be thrown while Graphics2D has not been modified.
|
|
|
|
| |
GLJPanel: Attempt to initialize if not done yet (similar to GLCanvas)
|