aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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).
* NEWT OSX MacWindow.c: Add parentWindow to DBG_PRINTSven Gothel2020-01-151-16/+25
|
* NEWT OSX/IOS WindowDriver: Minor cleanup of local var usage (prefer reuse); ↵Sven Gothel2020-01-142-19/+19
| | | | reconfig: Only orderOut w/ valid window-handle
* Bug 1421: NEWT OSX Invisible: Refining child window visibility setting, ↵Sven Gothel2020-01-142-6/+28
| | | | | | | | | | | | | | | | | | | commenting on child-window orderOut Actual small change is to have child-NSWindow to use '[myWindow orderWindow: NSWindowAbove relativeTo:..' instead of 'orderFront' in creation and use the simple 'orderFront' to set a top-level NSWindow visible. Adding comment why we can't use 'orderOut' on child-NSWindow setting it invisible, this is due to OSX 10.7 changes and testing detaching the child-window from its parent causes havoc w/ SWT at least. Hence we only issue 'mWin orderWindow: NSWindowOut relativeTo:..]' and the result is having the child-NSWindow below the application. This in turn will make it visible again when moving the application around, as this child-NSWindow will no more follow the position. Suggestion is to have this 'fake invisible' child-NSWindow to be moved out of the overal viewport (all screens).
* NewtCanvasSWT Tests: Add NEWTDemoListener giving weight to toolkit ↵Sven Gothel2020-01-132-0/+21
| | | | independent UI interaction coding
* TestSWTAccessor02NewtGLWindow: Setup SWT EDTUtil for NEWT, avoiding ↵Sven Gothel2020-01-131-38/+30
| | | | | | deadlocks on OSX and Windows Essentially same code path as NewtCanvasSWT
* Bug 1421 Related: Handle SWT Events: Activate (focus), Show and Hide.Sven Gothel2020-01-131-0/+9
| | | | | Show and Hide handling resolves TabFolder layout, i.e. hiding the 'hidden' and showing the current tab.
* Bug 1421, Bug 1358, Bug 969, Bug 672: Fix NEWT's coordinate conversion on ↵Sven Gothel2020-01-1310-244/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | MacOS (fixes NewtCanvasSWT on SWT positioning) Newt's OSX Window consist out of NSView wrapped up within its own NSWindow. It's position is being set via its NSWindow's client-area position on screen (frame), which we derive from NSView's client-area position. When NEWT reparents into a new 'window', on OSX it uses the parent's NSView and its NSWindow to attach its own NSView and NSWindow as a subview and childwindow. SWT's OSX implementation uses NSView's for each Compositor, but an individual NSWindow is only established for the Shell (Window). An oversight in Nativewindow and NEWT's coordinate translation: 'top-left view <-> top-left screen' by missing the 'view <-> window' translation caused this whole issue. The oversight occured as NEWT's 'view <-> window' translation had no impact due to its 1-view to 1-window mapping. Fixing the coordinate translation resolves the mess for SWT and for potential other toolkits on OSX. NewtCanvasSWT behaves same on OSX as on X11 etc finally.
* NativeWindow Point.set*(..): Return instance for scaling (chaining)Sven Gothel2020-01-122-5/+20
|
* NEWT JVM_JNI8: Adapt to native library separation (head, drm) of commit ↵Sven Gothel2020-01-091-2/+9
| | | | | | | | | b91c680fb93a03720ff9fcb39cf052cfe8d40e76 See commit b91c680fb93a03720ff9fcb39cf052cfe8d40e76 To support static libraries JEP 178, we have to provide JNI_OnLoad_<libname> etc. Hence change and add function entries accordingly.
* Bug 1358: Merely simplifying the non MacOS getClientAreaInPixels() code pathSven Gothel2020-01-061-2/+6
| | | | | | This also demonstrates that on non MacOS, SWT's scale-factor is artificially imposed on the actual pixel-units, as SWT's getClientArea() is simply returning: DPIUtil.autoScaleDown(getClientAreaInPixels())
* Bug 1421: Tackle wrong position of TabFolder, SashForm etcSven Gothel2020-01-062-60/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getClientArea() on MacOS produces a 'difficult' result regarding the position, which usually is returned as zero. Using a zero position issues the bug w/ SashForm, where the offset doesn't seems to be covered by the native NSView nor an SWT parent Composition. Then using the getLocation() as is (i.e. the view's frame position) may also cause issues with the TabFolder, as it includes the tab's trimming. Here the native NSView 's position includes the tab's trimming, gladly the parent (TabFolder or a Composition)'s clientArea includes this offset. Therefor, as a testbed - on OSX, getClientArea2(..) returns - position: getLocation() - getParent().getClientArea().position - size: getSize() This at least works OK'sh using - no special layout parent - TabFolder - SashForm ++++ Unit test TestGLCanvasSWTNewtCanvasSWTPosInTabs: Adding 'addComposite' to test matrix. 'addComposite' wraps our GLCanvas or NewtCanvasSWT into a Composite instead of adding it directly into the layouting parent. It demonstrates an issue with the new test 'test32_NewtCanvasSWTTabSashGLWComp', i.e. the NewtCanvasSWT is shown on the left as the SashForm's offset is being dropped. Summary: - No more issues with High-DPI pixelScale observed! - GLCanvas is being most well layouted, no issues in tests - NewtCanvasSWT may show severe positioning issues -> test32_NewtCanvasSWTTabSashGLWComp - NewtCanvasSWT always shows a small positioning offset into the lower-right corner w/ overlapping - NewtCanvasSWT overall positioning is not perfectly understood - NewtCanvasSWT misses to hide the NEWT child when changing tabs in TabFolder
* Bug 1421: Minor commentingSven Gothel2020-01-061-2/+1
|
* Bug 1421: Minor cleanup / commentingSven Gothel2020-01-061-9/+8
|
* Bug 1421: Move Bug 1362 'setBackground(..)' fix before potential ↵Sven Gothel2020-01-061-4/+4
| | | | 'setNEWTChild(..)'
* Bug 1421: OSXUtil: Add GetLocation(..), simply returning the view's frame ↵Sven Gothel2020-01-062-0/+44
| | | | position
* Bug 1421, Bug 1358, Bug 969, Bug 672: Deleting merged tests (obsolete)Sven Gothel2020-01-062-734/+0
|
* Bug 1421, Bug 1358, Bug 969, Bug 672: Generalization of test case ↵Sven Gothel2020-01-061-110/+389
| | | | | | TestGLCanvasSWTNewtCanvasSWTPosInTabs (2/2) Complete merging unit tests.
* SWT GLCanvas: Fix NPE in DEBUG mode; NewtCanvasSWT: Resurect comment in ↵Sven Gothel2020-01-062-2/+5
| | | | setBounds(..)
* Bug 1358: GLCanvas: Call new OSXUtil.SetWindowPixelScale(..) when GLCanvas ↵Sven Gothel2020-01-053-4/+57
| | | | | | gets realized on MacOS This fixes GLCanvas's High-DPI scaled size issue on MacOS of Bug 1358.
* Bug 1421, Bug 1358, Bug 969, Bug 672: SWTAccessor: Add ↵Sven Gothel2020-01-051-1/+74
| | | | get[Location|Size]InPixels(..) and getLocationOnScreen()
* Bug 1421, Bug 1358, Bug 969, Bug 672: Generalization of test case ↵Sven Gothel2020-01-052-69/+118
| | | | | | | | | | | | | TestGLCanvasSWTNewtCanvasSWTPosInTabs (1/2) Testing the TabFolder and a SashForm in the 2nd tab covering both SWT layout use cases on both out SWT support classes SWT GLCanvas and NewtCanvasSWT. Merging TestBug1421NewtCanvasSWTPosInTabs + TestBug672NewtCanvasSWTSashFormComposite into TestGLCanvasSWTNewtCanvasSWTPosInTabs. TestBug672NewtCanvasSWTSashFormComposite exposes that SWT GLCanvas still requires work for proper High-DPI scaling on OSX!
* Bug 1421: NewtCanvasSWT child on layouted SWT parent only occurs on MacOS, ↵Sven Gothel2020-01-051-5/+7
| | | | regardless of High-DPI
* Bug 1421: Demo wrong NEWT Child window position within an SWT TabFolder ↵Sven Gothel2020-01-051-0/+238
| | | | layout using NewtCanvasSWT on MacOSX with High-DPI Retina
* Bug 1358: MacOS NEWT WindowDriver / NewtCanvasSWT High-DPI:Sven Gothel2020-01-041-7/+14
| | | | | | | | | | | | | | | | | Even w/ commit fb211581fefc994d1458a2a74801dfb937170f39, propagating the SWT pixelScale to NEWT-Child, hasPixelScale was never updated via updatePixelScale() through native callback [NSView viewDidChangeBackingProperties]! [NSView viewDidChangeBackingProperties] not being called on [created] child windows (NewtCanvasSWT) confused the overal pixelScale state, i.e. no hasPixelScale update via updatePixelScale(..). This change explicitly queries OSXUtil.GetWindowPixelScale(handle) (commit e6d53e29f05a6928192f6c4a988b2aa558be8d65)for: 1) updateMaxScreenPixelScaleByWindowHandle(..), which now updates the actual hasPixelScale after native creation and for 2) setSurfaceScale(..), which directly calls updatePixelScale(..) with the queried actual pixelScale instead of relying on the native callback [NSView viewDidChangeBackingProperties].
* Bug 1358: NewtCanvasSWT High-DPI: Propagate pixelScale to NEWT-Child and ↵Sven Gothel2020-01-041-3/+39
| | | | | | | | | utilize it for convertTo*Units(..) Detected pixelScale on SWT should be propagated to the NEWT Child using 'newtChild.setSurfaceScale(pixelScale)' to allow an impact. Also utilize computed pixel for converTo*Units(..) implementation.
* Bug 1358: NewtCanvasSWT High-DPI: Use window-units where required instead of ↵Sven Gothel2020-01-041-8/+8
| | | | | | | | pixel-units Commit ca7f0fb61b0a608b6e684a5bbde71f6ecb6e3fe0 did one thing wrong: Using the pixel-unit size for NEWT child window operations where window-units are required.
* Bug 1358: Add OSXUtil.GetWindowPixelScale(..)Sven Gothel2020-01-042-1/+52
| | | | | It is now possible to retrieve the pixel scale [NSWindow backingScaleFactor] after native creation by NEWT - as we have changed the lifecycly (all-in-one native method on AppKit)
* Bug 1420: Add FFMpeg 4.* versioned lib-names and provide optional internal ↵Sven Gothel2020-01-032-59/+153
| | | | | | | | | | | | | | | | | | | | | lib lookup New property 'jogl.ffmpeg.lib' may be set to 'internal', setting PREFER_SYSTEM_LIBS:=false (default it true) Non system internal libraries are named 'internal_<basename>', e.g. 'internal_avutil'. System default libraries are named '<basename>', e.g. 'avutil'. If PREFER_SYSTEM_LIBS is true (default), we lookup the default library first, then the versioned library names and last the internal library. If PREFER_SYSTEM_LIBS is false, we lookup the internal library first, then the versioned library names and last the default library.
* Bug 1393: MacOS: getLocationOnScreen w/ JAWT Parent: Use parent's unblocking ↵Sven Gothel2020-01-022-10/+22
| | | | | | | | | | | | | | | specialization On MacOS, commit 12eed5d38616d23b6e8e2e5b497dfc2f54d90c90 replaced all parent.getLocationOnScreen(..) calls with OSXUtil.GetLocationOnScreen(parentHandle, ..) avoiding the EDT + Appkit Deadlock with native parenting. On MacOS AWT and JAWT are using offscreen CALayer since Java >= 1.7.0, therefor the MacOSXJAWTWindow's native window handle can't be used to gather the screen position via OSXUtil. However, the JAWT Window specialization MacOSXJAWTWindow implements a non-locking code-path and we can decide to use it by querying the general interface OffscreenLayerOption.
* Bug 1312: GLContextShareSet: Utilize WeakIdentityHashMap for shareMap and ↵Sven Gothel2019-12-314-7/+285
| | | | | | | | | | | | its destroyedShares Picking up Tom Nuydens suggestion to utilize a WeakIdentityHashMap instead of a IdentityHashMap, allowing destroyed GLContext to be removed from the GLContextShareSet through the GC. TestSharedContextVBOES2NEWT5 demonstrates the use-case, having one master context and several slaves being spawn off, killed and new sets to be spawn off. Here the GLContextShareSet shall not hard-reference the destroyed and user-unreferenced context, but allowing the system to GC 'em.
* Bug 1312: GLContextShareSet CleanupSven Gothel2019-12-312-15/+63
| | | | | | | | | - refine some method names, eg -- 'addNew' -> 'mapNewEntry' -- 'hasCreatedSharedLeft(..)' -> 'hasCreatedSharesLeft(..)' - add 'getCreatedShareCount(..)' and 'getDestroyedShareCount(..)' - add 'getSize()' and 'printMap(..)'
* Gears* tests: Obey verbose flagsSven Gothel2019-12-312-16/+41
|
* Reuse Gluegen's Bitfield.Util for 'PowerOf2' computationSven Gothel2019-12-311-30/+6
| | | | See gluegen commit 178c7b9d40e06a04790542241912ca21d2c7b92f
* Bug 1347: Resolve Merged EGL/Desktop Profile MappingSven Gothel2019-12-285-19/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | GLProfile.computeProfileImpl(..) as of Bug 1084 is not the culprit here and its hardware criteria filter works. The issue is commit 99a064327bf991318841c858d21d13e55d6b39db of Bug 1203, in particular the change in GLProfile re: "Merge computed EGL-Profile-Map (1) and Desktop-Profile-Map (2) per device, instead of just using the last computation, preserving and favoratizing the Desktop-Profile-Map." Here the Desktop-Profile-Map overwrites the EGL-Profile-Map and hence the software mapping gets used. Indeed, this is a regression cause by the work of Bug 1203. +++ Resolution is to revert the explicit 'union mapping' and rely on an enhanced 'GLContextImpl.remapAvailableGLVersions(fromDevice, toDevice)' function. Here the EGLDrawableFactory _already_ maps the EGL device's GL Versions to the 'host' device (e.g. X11). This has to be refined so that the remap will not overwrite the 'host' device's already detected GL Versions. That alone is enough, so that GLProfile can simply use the 'mappedEGLProfiles' of the 'host' device if detected, which already is a merged mapping of X11 host- and EGL sub-device. In case no 'mappedEGLProfiles' are available, we simply use the 'mappedDesktopProfiles'.
* Bug 1287 - Complete Immutable glNamedBufferStorage support in ↵Sven Gothel2019-12-271-8/+9
| | | | | | | | | | | | GLBufferObjectTracker As of the time of implementation, named immutable buffers were not fully supported within GL 4.4. This has changed, i.e. GL 4.5 supports glNamedBufferStorage. This patch adds support for the immutable named buffer storage case. jogl commit 09fc7aa5539731bb0fba835caee61f6eb837ecff, added GLBufferObjectTracker allowing to keep required references to NIO object. This tracker complements the NIO buffer lifecycle with the GL semantics.
* Bug 1156 Regression (Bug 1417): Probe whether 'eglGetPlatformDisplay(..)' is ↵Sven Gothel2019-12-252-1/+38
| | | | | | | | | | | | | | | | | | available before using commit f4281b5ee80d7674134bfee357695a98382884a3 for Bug 1156 (DRM/GBM) introduced the call to 'eglGetPlatformDisplay(..)' for known EGL-platforms. However, 'eglGetPlatformDisplay(..)' is only available for EGL versions >= 1.5 or 'eglGetPlatformDisplayEXT(..)' if EGL extension 'EGL_EXT_platform_base' is available. This patch adds a singular EGL version probe and a secondary extension fallback test at first call using EGL_NO_DISPLAY on both EGL_VERSION and EGL_EXTENSION eglQueryString(..) calls. If 'eglGetPlatformDisplay*(..)' is not available, simply use 'eglGetDisplay(..)'. This regression also impacted Bug 1417 (Android bringup using current SDK + NDK), i.e. disabled most Android devices as their EGL version is often 1.4.