| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
to avoid "cannot register existing type 'GdkDisplayManager'" and subsequent SIGSEGV
|
|
|
|
| |
disposed (manual test case)
|
|
|
|
| |
Cannot invoke "com.jogamp.newt.Window.getDelegatedWindow()" because the return value of "com.jogamp.newt.swt.NewtCanvasSWT.access$200(com.jogamp.newt.swt.NewtCanvasSWT)" is null
|
| |
|
|\
| |
| | |
Add new class location of SWT's gtk_widget_get_window
|
| |
| |
| |
| |
| |
| |
| | |
In SWT version 4.20, some gtk methods moved to a new gtk3 subpackage so add
check and find it in there. Note, this new package was not exported until
SWT 4.23 (aka 3.119.0 or v4950) so intervening versions will not work when
using OSGi class loading.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
request regarding GLX extensions
https://github.com/sgothel/jogl/pull/107
Return either glXQueryClientString or glXQueryExtensionsString when getting the GLX extensions
ndjojo:
glXQueryExtensionsString will make a request for glXQueryServerString if needed and will append the necessary client-side extensions.
This doc, under the section "Using GLS Extensions", also suggests checking the glXQueryExtensionsString before using GLX extensions.
+++
aschleck:
For some more context this came up with the release of Mesa 20.3.0,
which has client support for GLX_EXT_swap_control but no server support.
The current JOGL behavior of appending the client extensions to the server extensions is incorrect.
They should instead be intersected (with client-only extensions then appended) as the doc Nicole linked above says,
which is precisely what glXQueryExtensionsString does.
With the current extension querying behavior JOGL thinks glXSwapIntervalEXT is available under Mesa/llvmpipe
even though it is not, causing a segfault at JOGL initialization time.
I originally filed this as a Mesa bug (https://gitlab.freedesktop.org/mesa/mesa/-/issues/4128)
along with some code that repro'd JOGL's checking behavior but it became apparent that Mesa is fine and the checking behavior is incorrect.
|
|\ \
| | |
| | | |
Return either glXQueryClientString or glXQueryExtensionsString when getting the GLX extensions
|
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
GLContext.isGL3bcAvailable() check
Julien Gouesse resolved this odd issue, where a requested GL2 profile was mapped to GL3bc but is not implemented,
see <https://forum.jogamp.org/InternalError-XXX0-profile-2-GL2-gt-profileImpl-GL3bc-not-mapped-td4041754i20.html#a4042018>.
I exploded his patch a little to reuse the GLContext.getAvailableGLProfileName() result
and simplify the conditional statement.
This might need more testing perhaps, plus analyis why GLContext.getAvailableGLProfileName()
offers GL3bc but is not available via GLContext.isGL3bcAvailable() check.
|
| |
| |
| |
| | |
comparison result
|
| |
| |
| |
| | |
GLContextImpl.MacOSVersion
|
| |
| |
| |
| | |
GLEmitter
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
TSMGetInputSourceProperty(), crashing on MacOS >= 13
Perhaps we want a replacement?
Fallback code uses keyCode, i.e. dropping the current keyboard layout (-> US).
|
| |
| |
| |
| |
| |
| | |
main thread, deferred w/o wait (MacOS >= 13)
updateContextRegister() stays in current thread.
|
| |
| |
| |
| | |
context view on MacOS >= 10.14 (deadlock)
|
|/ |
|
|
|
|
|
|
| |
GLTestUtil changes when 'front porting'
Thanks to Julien Gouesse reminding me of this issue.
|
|
|
|
|
|
|
| |
This issue was introduced in commit 0a6a592c04a85d8124aa9d38b67f0caa1d739b75
and the '2nd choice branch' obviously never tested.
Thanks to Lathanda finding this issue on 6/14/20.
|
|
|
|
|
|
|
| |
query java.awt.EventQueue.isDispatchThread()
If AWT is not available, isAWTEventDispatchThread() returns false,
otherwise returns java.awt.EventQueue.isDispatchThread().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
on initial makeCurrent when offscreen
makeCurrent shall skip SetNSViewCmd for offscreen, i.e. refine criteria of nsViewChanged.
Previous term enforced SetNSViewCmd on initial call as lastNSViewDescr was null.
Expand first term to require an actual non null NSView.
contextMadeCurrent must avoid blocking to wait for completion of our SetNSViewCmd on AppKit.
AWT has procedures running on AppKit under certain situations,
where it issues a feedback flush on AWTEDT (from Appkit) blocking.
This in turn deadlocks our SetNSViewCmd waiting on the AppKit,
as we are blocking the AWTEDT waiting for same command.
Further avoiding other potential deadlocks, by adding a 500ms timeout.
Also clearing the lastSetNSViewCmd field post wait, regardless,
which avoid repeatitive SetNSViewCmd issuance on timeout.
Note that the SetNSViewCmd, we failed to wait for eventually gets executed.
|
|
|
|
| |
36ca7245653b1a0897f2070b9acbe0f0898f5949
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
makeCurrent() call
Command SetNSViewCmd sets NSOpenGLContext's NSView via [NSOpenGLContext setView:]
on the main-thread as enforced since XCode 11 using SDK macosx10.15, see Bug 1398.
This command is injected into OSX's main-thread @ NSOpenGLImpl.makeCurrent(long) only if required,
i.e. issued only for a newly bound NSView and skipped for surface-less or offscreen 'surfaces'.
This operation must be performed w/o blocking other tasks locking the NativeSurface on main-thread to complete.
Since [NSOpenGLContext setView:] acquires the CGLContext lock on the main-thread,
it can't be locked by the calling thread until this task has been completed.
Command issuer NSOpenGLImpl.makeCurrent(long) will not acquire the CGLContext lock if this command is pending.
contextMadeCurrent(true) cures the potential unlocked CGLContext by issuing
a whole GLContext.release() and GLContext.makeCurrent() cycle while waiting for this command to be completed in-between.
This GLContext cycle also ensures an unlocked NativeSurface.getLock() in-between,
allowing potentially blocked other tasks on the main-thread to complete and hence this queued command to execute.
Notable test provoking critical multithreading issues is com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT.
Notable test exposing issues with an unlocked CGLContext is com.jogamp.opengl.test.junit.jogl.glsl.TestGLSLShaderState02NEWT.
|
|
|
|
| |
This prepares proper release of the acquired NativeSurface lock to cure the missing CGLContext lock, see followup commit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
default test behavior
SWT and OSX's UI TK have their strict threading policy we require to comply with, e.g. see Bug 1398 lately.
It doesn't help using our own MainThread vehicle to move the unit test on the OS main thread,
as this removes potential causes of deadlocks - which we intend to find and resolve.
This patch removed using MainThread altogether from our ant unit testing recipe
as well from our manual test scripts.
Unit tests are no more executed on the 'main thread'.
SWT tests are patched to comply with SWT's UI threading policy.
We also catch violations within NewtCanvasSWT and our SWT GLCanvas
to provide same behavior on all platforms.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
blocking
Set NSOpenGLContext's NSView via [NSOpenGLContext setView:]
on the main-thread as enforced since XCode 11 using SDL macosx10.15, using Runnable SetNSViewCmd.
This operation must be performed async w/o blocking to allow
other tasks locking the NativeSurface on main-thread to complete.
Further, since [NSOpenGLContext setView:] acquired the CGLContext lock,
it can't be locked until this task has been completed.
Worst case scenario for a late [NSOpenGLContext setView:] issuance
might be corrupt initial frame(s) displayed.
Since all concurrent locking is performed within JOGL,
the unlocked CGLContext window risk is only academic.
However, if native 3rd party toolkits take share control,
we might have a situation.
+++
SetNSViewCmd is issued @ makeCurrent() now as opposed to createContext(..)
and associateDrawable(true). The latter was actually late as well,
as it also happened after makeCurrent when updating the drawable
association. It also missed setting a null NSView when detached!
release() will also set a null NSView if called after associateDrawable(false).
SetNSViewCmd will only be issued if the NSView has been changed,
i.e. first makeCurrent() or changing the drawable.
If issued, makeCurrent() will not lock the underlying CGLContext
and hence allow SetNSViewCmd to perform - see above.
+++
NSViewDescriptor class structure replaces the less convenient method 'getNSViewHandle(..)',
exposing all collected drawable characteristics as fields.
NSViewDescriptor also respects a ProxySurface's OPT_UPSTREAM_SURFACELESS mode,
which results in not using any underlying NSView - similar to OPT_UPSTREAM_WINDOW_INVISIBLE.
This change ensures that all surfaceless GL operations will not use any NSView.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
11 _and_ its default SDK 'macosx10.15'
This patch demonstrates that using the SDK 'macosx10.11' does not cause the crash @ -[NSOpenGLContext setView:].
SDK 'macosx10.15' enforces Apple's own Cargo Cult of 'main-thread' by throwing a SIGILL signal (or SIGABRT)
- essentially an exception.
This surely renders our code officially invalid due to this policy,
i.e. we are not allowed to issue [* setView] on any non main-thread.
+++
The crash occurs independently of used Java version on Java 8 - 11,
as well as on JogAmp 2.3.2 - current master tip.
+++
The initial remedy to issue said action on the main-thread in a blocking/wait
manner has the risk to deadlock, due to
1) [NSOpenGLContext setView:] itself using a mutex (Thanks to Ken Harris's analysis)
and
(2) in case where we are 'thread hopping':
- [main-thread] Event like 'window ready' -> kick off action on EDT-thread *blocking*
- [EDT-thread] Create stuff incl OpenGLContext -> kick off setView on main-thread *blocking*
This has to be further investigated.
This crash finally has been reliably reproduced now.
|
| |
| |
| |
| | |
+ show JOGL version
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
latest tip using XCode 11
Changes to test
- Using own 'NSApplicationMain' entry to avoid the 'missing Info.plist' message!
- Configurable CLASSPATH and LIBPATH at compile time.
Note that the java.library.path is now hardcoded as well.
- Don't close stderr in test, just fflush
- Don't close the JVM after launch via 'die(env)', let it run.
- Java: Add GLEventListener RedSquareES2 to see something in action @ 30fps
- Java: GLCanvase visible bounds
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
using XCode 11 and JOGL 2.3.2 as well as current tip
This change imports '[email protected]' patch as
reported and provided in Bug 1398.
I can not execute this patch properly,
as received a error message regarding missing Info.plist at start.
|
| |
| |
| |
| | |
in concurrent async test case.
|
|/
|
|
| |
variant.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
native DPI toolkit aware platforms (Linux, Windows)
NEWT + NewtCanvasAWT:
Maybe create "interface ScalableSurface.Upstream {
void pixelScaleChangeNotify(final float[] curPixelScale, final float[] minPixelScale, final float[] maxPixelScale); }"
to allow downstream to notify upstream ScalableSurface implementations like NEWT's Window to act accordingly.
+++
AWT GLCanvas: Add remark where to add the potential pixel scale.
|
|
|
|
|
|
| |
fullscreen mode
WindowDriver OSX: useParent(..) -> useParentLocation(..) and add !isFullscreen() as a criteria to use the parent derived location.
|
|
|
|
| |
input if not visible.
|
|
|
|
|
|
|
|
| |
NewtCanvasSWT.SWTNativeWindow's surfaceSize in pixel units
shall only return scaled-up windowUnits using SWTAccessor.deviceZoomScaleUp(..) for !OSX
and potentially auto scaled-up pixelUnits to passthrough (OSX).
See detailed API doc to NewtCanvasSWT.newtScaleUp(..)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
compensation like 'DPIUtil.useCairoAutoScale()'
We can't use DPIUtil's 'autoScaleUp(..)' method on non-native DPI scaling platforms
as it uses a scale-factor of 1f if the higher toolkit compensates, i.e. 'DPIUtil.useCairoAutoScale()'.
Since NEWT uses X11 and GDI directly, which are not DPI scale-aware,
we have to drop the semnatics of 'DPIUtil.useCairoAutoScale()'
and merely use the actual 'deviceZoom'.
This was proposed by Marcel Au in the first place.
At least I understand these semantics by now.
+++
Additionally NewtCanvasSWT.SWTNativeWindow needs to return the 'deviceZoomScaleUp(..)'
values for returning its size in window- and pixel-units (surface).
|
|
|
|
|
|
|
| |
toString(..), added toSimpleString(..)
This also revised commit f56adf14deadd4ee8f434ea1293e27bcafdf2a90 Window API addition of 'append(StringBuilder)',
which has been renamed to 'toString(StringBuilder)' as aligned to out other classes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bug 1422 shows that it seems to be desired to emulate DPI scaling where
the native toolkit does not implmement the same.
On GTK, DPIUtil.mapDPIToZoom (int dpi) reads:
double zoom = (double) dpi * 100 / 96;
int roundedZoom = (int) Math.round (zoom);
return roundedZoom;
While having dpi calculated as:
dpi = 96 * GDK.gdk_monitor_get_scale_factor(monitor);
Well, this seems to exist to allow 96 dpi fixed layout to
'look' OK on high-dpi screens.
However, you get in trouble if you layout high-dpi aware,
i.e. using percentages etc.
There is one exception: If DPIUtil.useCairoAutoScale() is true, scalingFactor is 1f
and hence the scaling emulation dropped.
'DPIUtil.setUseCairoAutoScale((sx[0]*100) == scaleFactor || OS.isGNOME);'
|
|
|
|
|
|
| |
new Rectangle instance (mutable)
Also return 'this' for setter methods for chaining.
|
|
|
|
|
| |
Otherwise one would want to pause the Animator instance for the hidden GLWindow,
otherwise such animator with zero visible drawables will become a CPU hog.
|
|
|
|
|
|
|
| |
off-viewport position
Ensure it stays out of sight by moving it to 2x width/height of viewport.
Otherwise one could see the child window moving from lower-right to upper-left ;-)
|
|
|
|
|
|
|
| |
instances if 'below notification threshold'
'below notification threshold' here is simply being a child SWT Control of like a Composition or SashForm etc
where these events won't get propagated.
|
|
|
|
|
|
| |
remove all SWT listener on dispose.
Additionally print more details about the newtChild's state in DEBUG mode.
|
|
|
|
| |
building custom efficient presentations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'Fake invisible child window' is implemented by simply moving the window out of sight (viewport).
- orderOut0 needs to use '[mWin orderWindow: NSWindowBelow relativeTo:..' parentWindow
instead of '[mWin orderBack:..', otherwise the whole parent application gets invisible w/ SWT ;-)
- NewtNSWindow may also needs to use parent's Screen instance if moved offscreen,
as the own Screen is invalid (zero size) in this case.
- WindowDriver: Adding special treatment for 'Fake invisible child window' (tagged as such):
-- reconfigureWindowImpl: setWindowClientTopLeftPointAndSize0(..) will be called
using the viewport's max position -> out of sight.
-- screenPositionChanged: ignore the 'new' position
-- sizeChanged: ignore the 'new' size
This sensitive NEWT change set shall benefit other toolkits being used as parentWindow
besides SWT, as this behavior is the same across MacOS.
|
|
|
|
|
|
|
|
|
|
| |
d92dc518eb891f2d125a8136efd6ed603d74a6e9
We also cannot use 'mWin orderWindow: NSWindowOut relativeTo:..]' as it also removes the child-NSWindow from its parent like 'orderOut'.
Hence only use 'orderBack' to keep the relationship inplace.
Fake invisible child window is in progress,
i.e. moving it out of the overal viewport (all screens).
|