summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* SWT+AWT: Ensure SWTAccessor gets called before AWT initialization on GTK/X11 ↵Sven Gothel2023-01-162-8/+63
| | | | to avoid "cannot register existing type 'GdkDisplayManager'" and subsequent SIGSEGV
* TestNewtCanvasSWTGLn: Only dispose canvas1 at end of test, if not yet ↵Sven Gothel2023-01-161-16/+29
| | | | disposed (manual test case)
* NewtCanvasSWT: Remove certain DEBUG output causing an exceptionSven Gothel2023-01-161-2/+4
| | | | 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
* SWTAccessor: Adopt to SWT 4.26Sven Gothel2023-01-161-32/+27
|
* Merge pull request #108 from PeterC-DLS/swt-420-fixSven Gothel2023-01-161-1/+9
|\ | | | | Add new class location of SWT's gtk_widget_get_window
| * Add new class location of SWT's gtk_widget_get_windowPeter Chang2022-04-141-1/+9
| | | | | | | | | | | | | | 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.
* | X11GLXContext.getPlatformExtensionsStringImpl(): Add comment from pull ↵Sven Gothel2023-01-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #107 from ndjojo/platform-extensionsSven Gothel2023-01-161-10/+2
|\ \ | | | | | | Return either glXQueryClientString or glXQueryExtensionsString when getting the GLX extensions
| * | Update X11GLXContext.javandjojo2021-01-201-10/+2
| |/
* | Fix GLProfile GL2 Mapping: Only use GL3bc is available, add additional ↵Sven Gothel2023-01-151-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | JAWTUtil: Cleanup MacOS JVM and OS version flags: Private and store ↵Sven Gothel2023-01-151-14/+16
| | | | | | | | comparison result
* | Moved GlueGen's PlatformPropsImpl's static OSXVersion to ↵Sven Gothel2023-01-152-6/+29
| | | | | | | | GLContextImpl.MacOSVersion
* | Replace AccessController.doPrivileged() w/ SecurityUtil.doPrivileged() - via ↵Sven Gothel2023-01-141-2/+2
| | | | | | | | GLEmitter
* | Replace AccessController.doPrivileged() w/ SecurityUtil.doPrivileged()Sven Gothel2023-01-1433-76/+80
| |
* | MacOS: NEWT: Remove keySymbol mapping using 'HIToolbox' ↵Sven Gothel2023-01-141-8/+53
| | | | | | | | | | | | | | TSMGetInputSourceProperty(), crashing on MacOS >= 13 Perhaps we want a replacement? Fallback code uses keyCode, i.e. dropping the current keyboard layout (-> US).
* | MacOS: MacOSXCGLContext.drawableUpdatedNotify(): Issue updateContext() on ↵Sven Gothel2023-01-142-30/+27
| | | | | | | | | | | | main thread, deferred w/o wait (MacOS >= 13) updateContextRegister() stays in current thread.
* | MacOS: MacOSXCGLContext.NSOpenGLImpl.release(): Don't wait for releasing ↵Sven Gothel2023-01-141-1/+2
| | | | | | | | context view on MacOS >= 10.14 (deadlock)
* | MacOS: MacOSXCGLContext: Simplify version flags, remove Tiger, add Mojave.Sven Gothel2023-01-141-6/+20
|/
* Fix TestBug1398Deadlock02AWT: Missed adaption of unit test to AWTRobotUtil & ↵Sven Gothel2020-06-151-2/+3
| | | | | | GLTestUtil changes when 'front porting' Thanks to Julien Gouesse reminding me of this issue.
* Fix 'typo' in branching, valid config index is >= 0 (not < 0)Sven Gothel2020-06-151-1/+1
| | | | | | | 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.
* Bug 1398: MacOSXCGLContext: Ensure AWT is available before using it when ↵Sven Gothel2020-04-061-5/+12
| | | | | | | query java.awt.EventQueue.isDispatchThread() If AWT is not available, isAWTEventDispatchThread() returns false, otherwise returns java.awt.EventQueue.isDispatchThread().
* Bug 1398: Adding test case of commit f33681bbeeb459af4de81331d6d9241d8c9a75deSven Gothel2020-04-061-0/+151
|
* Bug 1398: Avoid AWT-AppKit blocking feedback flush deadlock and SetNSViewCmd ↵Sven Gothel2020-04-061-28/+60
| | | | | | | | | | | | | | | | | | | 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.
* Add missing SWTTestUtil, missed in commit ↵Sven Gothel2020-03-061-0/+64
| | | | 36ca7245653b1a0897f2070b9acbe0f0898f5949
* Bug 1398: Ensure CGLContext lock will be acquired before leaving user ↵Sven Gothel2020-03-054-186/+318
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Bug 1398: Expose NativeSurface implementation's RecursiveLock if utilizedSven Gothel2020-03-056-0/+43
| | | | This prepares proper release of the acquired NativeSurface lock to cure the missing CGLContext lock, see followup commit.
* OSX/SWT Testing: Drop using 'com.jogamp.newt.util.MainThread' enforcing ↵Sven Gothel2020-03-0418-364/+416
| | | | | | | | | | | | | | | | | | | 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.
* Merge branch 'bug1398'Sven Gothel2020-03-0213-130/+3127
|\
| * Bug 1398: MacOS: Perform [NSOpenGLContext setView:] on main-thread async w/o ↵Sven Gothel2020-02-243-133/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Bug 1398: Crash only occurs @ -[NSOpenGLContext setView:] when using XCode ↵Sven Gothel2020-02-2210-283/+2063
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Bug 1398: Refine test case: Make classpath and libpath runtime configurable ↵Sven Gothel2020-02-2110-177/+352
| | | | | | | | + show JOGL version
| * Bug 1398: Fixing native test allowing its execution using JOGL 2.3.2 and ↵Sven Gothel2020-02-2110-11/+575
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Bug 1398: Importing Jani's native test, attempting to reproduce the crash ↵Sven Gothel2020-02-213-0/+373
| | | | | | | | | | | | | | | | | | | | 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.
* | TestSharedContextVBOES2*3: Properly validateBuffers and setSyncObjects(..) ↵Sven Gothel2020-02-243-2/+17
| | | | | | | | in concurrent async test case.
* | IOSUtil.IsMainThread(): Utilize caching ThreadLocal<Boolean> like OSXUtil's ↵Sven Gothel2020-02-241-1/+17
|/ | | | variant.
* Bug 1374: NEWT/AWT: Annotation regarding general High-DPI for even non ↵Sven Gothel2020-01-173-0/+24
| | | | | | | | | | | | | | | 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.
* Bug 1423: NEWT Child Window on OSX: Don't use parent derived location in ↵Sven Gothel2020-01-161-15/+20
| | | | | | fullscreen mode WindowDriver OSX: useParent(..) -> useParentLocation(..) and add !isFullscreen() as a criteria to use the parent derived location.
* NEWT: Enhance FullScreen.run DEBUG output a bit; NEWTDemoListener ignore ↵Sven Gothel2020-01-162-2/+10
| | | | input if not visible.
* Bug 1422: NewtCanvasSWT: Handle case of !OSX && DPIUtil.getScalingFactor() > 1Sven Gothel2020-01-161-7/+17
| | | | | | | | 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(..)
* Bug 1422: Use own deviceZoomScaleUp(..) disregarding higher-toolkit's ↵Sven Gothel2020-01-162-17/+165
| | | | | | | | | | | | | | | | | | | 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).
* NEWT.Window: Refine string representation, renamed append(StringBuilder) -> ↵Sven Gothel2020-01-164-89/+162
| | | | | | | 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: Emulate DPI Scaling on non-native DPI autoscale platforms (!MacOS)Sven Gothel2020-01-156-13/+75
| | | | | | | | | | | | | | | | | | | | | | | | 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);'
* Nativewindow Rectangle*: Cleanup up union(..), intersection(..): Return a ↵Sven Gothel2020-01-152-26/+21
| | | | | | new Rectangle instance (mutable) Also return 'this' for setter methods for chaining.
* TestGLCanvasSWTNewtCanvasSWTPosInTabs: Only use 1 Animator to easy example codeSven Gothel2020-01-151-24/+14
| | | | | 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.
* Bug 1421: NEWT OSX Invisible: Refine 'Fake invisible child window' ↵Sven Gothel2020-01-151-1/+2
| | | | | | | 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 ;-)
* Bug 1421: Conclude OSX: Forward SHOW and HIDE events to NewtCanvasSWT ↵Sven Gothel2020-01-151-2/+50
| | | | | | | 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.
* Bug 1421: NEWTCanvasSWT: No action on SWT.Activate, use SWT.FocusIn. Also ↵Sven Gothel2020-01-151-83/+119
| | | | | | remove all SWT listener on dispose. Additionally print more details about the newtChild's state in DEBUG mode.
* NEWT.Window: Add 'StringBuilder append(StringBuilder sb)' supporting ↵Sven Gothel2020-01-153-6/+26
| | | | building custom efficient presentations
* Bug 1421: NEWT OSX Invisible: Implement 'Fake invisible child window'Sven Gothel2020-01-153-13/+40
| | | | | | | | | | | | | | | | | | | '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.
* Bug 1421: NEWT OSX Invisible: Fix orderOut0 re commit ↵Sven Gothel2020-01-151-2/+3
| | | | | | | | | | 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).