aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
Commit message (Collapse)AuthorAgeFilesLines
* Bug 1156: Seperate DRM/GBM NEWT native library from main head NEWT native ↵Sven Gothel2019-12-2512-13/+33
| | | | | | | | | | | | | | | | library DRM/GBM is enabled for Linux in general. Nativewindow's 'nativewindow_drm' DRM/GBM native library is already seperated. NEWT get its 'newt_drm' DRM/GBM native library. NEWT's main head native library is renamed from 'newt' -> 'newt_head' and is earmarked for further seperation similar to Nativewindow's. At least a 'newt_wayland' will probably followup when support is added. Goal is to remove DRM/GBM dependency for Linux X11 operation as well as removing X11 dependency for Linux DRM/GBM operation.
* Bug 1156: NEWT WindowDriver: Handle case with requested ↵Sven Gothel2019-12-091-2/+2
| | | | CapabilitiesImmutable not being GLCapabilitiesImmutable
* Bug 1156: NEWT Window: Better handling of fixed console case: Not resizable ↵Sven Gothel2019-12-0914-30/+142
| | | | | | | | | | | | | | | | | | | | | | | and not repositionable. Our two fixed size and position console cases 'bcm.egl' and 'egl.gbm' (drm.gbm) only operate in a console like fullscreen mode. We should earmark and expose this behavior, as well as handle it by not waiting for a position / size and not attempting to change position and size. Reducing WindowImpl.minimumReconfigStateMask to bare minimum values: STATE_MASK_VISIBLE | STATE_MASK_FOCUSED; New WindowImpl.mutableSizePosReconfigStateMask extends WindowImpl.minimumReconfigStateMask, representing previous values: STATE_MASK_VISIBLE | STATE_MASK_FOCUSED | STATE_MASK_FULLSCREEN | STATE_MASK_RESIZABLE | STATE_MASK_REPOSITIONABLE; All WindowDriver implementations previously using WindowImpl.minimumReconfigStateMask are now using WindowImpl.mutableSizePosReconfigStateMask but the explicit console driver named above. I would have liked to add the STATE_BIT_FULLSCREEN to the current stateMask to notify this semantics, however this would have lead to more code changes as our fullscreen mode assumes to be 'on top' of the normal mode. Here the normal mode is essentially fullscreen and no back/forth fullscreen setting is useful or allowed. Therefore, both fixed size & position console driver won't expose themselves as being in fullscreen mode.
* Bug 1393: Apply 12eed5d38616d23b6e8e2e5b497dfc2f54d90c90 to IOS, avoiding ↵Sven Gothel2019-12-081-4/+6
| | | | AppKit/EDT deadlock for parent screen location lookup
* Bug 1393: Resolve EDT + AppKit Deadlock with native parenting: Fetch parent ↵Sven Gothel2019-12-081-4/+6
| | | | screen position directly w/o locking.
* NEWT WindowImpl: Wording in commentSven Gothel2019-12-081-1/+1
|
* Bug 1156: DRM/GBM NEWT: Clarify drmModeSetCrtc(..)'s x/y parameter and ↵Sven Gothel2019-12-072-160/+84
| | | | | | earmark spanning across monitors drmModeSetCrtc(..)'s x/y parameter are the surface's offset to be scanned out from one CRT!
* Bug 1412: Fix commit a8c2de110a2254af137a3d99007cc77e3ecd8078Sven Gothel2019-12-062-6/+11
|
* Bug 1412 - JNI: NEWT Check & Handle Exception after calling back into Java ↵Sven Gothel2019-12-061-0/+1
| | | | (NewtCommon.c)
* Bug 1413 - NEWT X11Window: NewtWindows_getFrameExtends(..) may hang on ↵Sven Gothel2019-12-063-18/+28
| | | | | | | | | | | XPeekEvent(..) The wait loop uses XPeekEvent(dpy, &e), which can block indefinite if queue is empty. Replace with timeout only _and_ only wait on CreateWindow0(..) not when queried via X11Display dispatch loop on events when it is assumed the information has been propagated already.
* Bug 1412 - JNI: NEWT Check & Handle Exception after calling back into Java ↵Sven Gothel2019-12-064-7/+57
| | | | (X11Display + X11Window)
* Bug 1410: Fix NEWT PointerIcon Lifecycle (destroy and clean references @ ↵Sven Gothel2019-12-062-10/+35
| | | | | | | | | | | closing) Commit d5ba4cae824087879a4857e20961a95da04eaebb clarified and simplified the lifecycle of a PointerImpl instance, i.e. drop its resurrection in PointerImpl.validateHandle() in favor of a hard exception. This caused detection of subsequent PointerImpl lifecycle issues, as instances were not fully destroyed on Display closing and references not null'ed in Display and Screen instances.
* Fix regression of commit 2b899a55e365aa03aeb234187600526777c1a9acSven Gothel2019-12-061-1/+1
| | | | This bug never allowed a PointerIconImpl to be destroyed via PointerIconImpl.destroy()
* Bug 1409: GNU/Linux DRM Console: Clear stdin before exit and don't act on ↵Sven Gothel2019-12-053-3/+60
| | | | | | | | | stdin in vsync-wait-loop User input during test from the console will also end up in stdin of the console after the java application has been closed. This is not only annoying, but also a security concern, as the input gets executed if containing a CR. Further, the vsync-wait-loop shall ignore stdin.
* PointerIcon new instances are always valid ..Sven Gothel2019-12-052-7/+15
| | | | Move native handle check to pre-destruction call in PointerIconImpl.destroyOnEDT(..), unifying single destruction and all.
* Bug 1405, Bug 1406, Bug 1408: Resolution: Call ↵egl-gbmSven Gothel2019-12-051-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ReleasePrimitiveArrayCritical(..) in GetPrimitiveArrayCritical(..) code path! Now that was quite a miss, causing the bugs in the first place! The freeze was caused in the JVM, as this open GetPrimitiveArrayCritical(..) disabled the GC. This was reported via '-Xcheck:jni'. Depending on the system/jvm, the freeze may happen early or only after a while. This code path was not executed with new property 'newt.disable.PointerIcon' set, but from there to finding the missing critical release - a journey: - jstack showed "main" #1 prio=5 os_prio=0 cpu=275.71ms elapsed=51.93s allocated=9710K defined_classes=472 tid=0x00007f7084015000 nid=0x1a39 waiting on condition [0x00007f70897c2000] java.lang.Thread.State: RUNNABLE at jogamp.opengl.es3.GLES3Impl.dispatch_glUniformMatrix4fv1(Native Method) at jogamp.opengl.es3.GLES3Impl.glUniformMatrix4fv(GLES3Impl.java:2585) at jogamp.opengl.es3.GLES3Impl.glUniform(GLES3Impl.java:10713) -- said that this thread was no more running, waiting on condition .. -- glUniformMatrix4fv1 was given an array! - '-Xcheck:jni' gave: Warning: Calling other JNI functions in the scope of Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical -- Now it is clear that the lack of releasing the critical array, returning to Java and then calling other JNI methods caused the Warning - and eventually the freeze.
* LinuxKeyEventTracker: Factor out 'sendKeyEvent(..)' call with null check.Sven Gothel2019-12-051-12/+12
|
* NEWTDemoListener: Fix NPESven Gothel2019-12-051-4/+7
|
* Bug 1156: NEWT DRM/GBM PointerIcon: Use hotX/hotY drmModeSetCursor2(..), ↵Sven Gothel2019-12-054-30/+35
| | | | hence pass PointerIconImpl through
* Bug 1408: NEWT DRM/GBM WindowDriver: Adding glFinish() before ↵Sven Gothel2019-12-041-0/+1
| | | | | | | eglSwapBuffers(..) just in case .. This is the poor man's SYNC: glFenceSync () with glWaitSync(). However, this change did not resolve Bug 1408. Earmarked to be removed!
* Bug 1408: NEWT DisplayImpl PointerIcon: Property 'newt.disable.PointerIcon' ↵Sven Gothel2019-12-041-1/+7
| | | | disables PointerIcon usage in general.
* Bug 1408: NEWT DRM/GBM DisplayDriver: Add device locking/unlocking ↵Sven Gothel2019-12-042-9/+44
| | | | decoration for PointerIcon operations
* NEWT: Align DisplayImpl.createPointerIcon(..) behavior; ↵Sven Gothel2019-12-043-40/+16
| | | | | | | | | | | | | | | | PointerIconImpl.validatedHandle() shall not create native resource. Semantic cleanup for clarity and equal behavior Align DisplayImpl.createPointerIcon(..) behavior - return null handle of createPointerIconImplChecked(..) shall be accepted, no exception for neither of the two creation methods. PointerIconImpl.validatedHandle() shall not create native resource. - throws exception if handle is null (about to be used) - no native creation shall happen here. Display.PointerIcon.validate(): Removed, not used.
* Bug 1156, Bug 1406: NEWT DRM/GBM WindowDriver.surfaceSwap(): Pass ↵Sven Gothel2019-12-042-16/+41
| | | | swapInterval to optionally skip VSYNC if 0
* Bug 1406: demos.Launcher0: More code path reduction: useMultiplePointerIcon ↵Sven Gothel2019-12-041-6/+11
| | | | must be enabled via -pointerIcon
* Bug 1156: Remove verbose print in native CreatePointer..Sven Gothel2019-11-301-1/+1
|
* Bug 1156: LinuxKeyEventTracker, LinuxMouseTracker: Robostness (+NEWT fix)Sven Gothel2019-11-306-41/+65
| | | | | | | | commit 453f80e38bcb0945e7eac27a5917dce9bdc6446b added disabling the tracker, however the NEWT usage didn't cover all mouse tracker null pointer. Further, let's initialize and spawn off the threads only at first getSingleton() call not at class initialization earlier.
* Bug 1156: LinuxKeyEventTracker, LinuxMouseTracker: Adding property to ↵Sven Gothel2019-11-302-14/+42
| | | | | | | | | | | disable each LinuxKeyEventTracker also disable the eventX reading by default, but can be enabled via new property. The 'return bug' (crash due to underlying console) is indeed not occuring when using a VT w/o running console application underneath. As Xerxes showed, one may use chvt to a free known VT or openvt.
* Bug 1156: LinuxKeyEventTracker: Add '/dev/input/by-path/*-event-kbd' and ↵Sven Gothel2019-11-291-42/+75
| | | | more documentation
* Bug 1156: DRM/GBM: Add full PointerIcon (Cursor) SupportSven Gothel2019-11-296-40/+307
| | | | | | | | | | | | DRM allows 64x64 pixel cursor images, using GBM_FORMAT_ARGB888 only. Notable: GBM_FORMAT_ARGB888 == PixelFormat.BGRA8888 Having fixed mouse and keyboard input with previous commit, the demo com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT shows via key press - i -> pointer visible/invisible - c -> pointer icon change
* Bug 1156: LinuxKeyEventTracker: Fix 64bit InputEvent and attempt to only use ↵Sven Gothel2019-11-292-54/+123
| | | | | | | | | | | | | keyboard event files The time structure on 64bit machines uses two 8 byte long values instead of two 4 bytes int values on 32bit machines. The insufficient read on 64bit machines caused an IllegalArgument exception. This fix considers 32 or 64 bit operation. Class renamed: LinuxEventDeviceTracker -> LinuxKeyEventTracker, as it tracks key events specifically. Now the EventDeviceManager tries to only use /dev/input/by-id/*-event-kbd keyboard event files, which reduces the handling on kbd event files only.
* Bug 1156: DRM/GBM Native test: Add CursorSven Gothel2019-11-281-0/+89
|
* Bug 1402: Standalone native test attempting to reproduce issueSven Gothel2019-11-282-0/+830
| | | | | | | | | Mesa 18.3.6 issues mixing EGL_DEFAULT_DISPLAY and GBM device on EGL_PLATFORM_GBM_KHR Interestingly, the issue is no more reproducible. Weird. However, it is advised to use a real GBM device handle for EGL display creation under EGL_PLATFORM_GBM_KHR.
* Bug 1156 - Implement DRM/GBM Support for JOGL(EGL) and NEWTSven Gothel2019-11-288-684/+549
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding new classes DRMLib (gluegen of drm + gbm), DRMUtil and DRMMode GBMDummyUpstreamSurfaceHook to new package jogamp.nativewindow.drm, allowing full awareness of DRM + GBM within NativeWindow for JOGL + NEWT. DRMMode replaces the previous native code of collecting drmMode* attributes: active connector, used mode, encoder etc and also supports multiple active connectors. DRMUtil handles the global static drmFd (file descriptor), currently only the GNU/Linux DRM device is supported. GBMDummyUpstreamSurfaceHook provides a simple dummy GBM surface. NativeWindow provides the new nativewindow_drm.so and nativewindow-os-drm.jar, which are included in most 'all' jar packages. build property: setup.addNativeEGLGBM -> setup.addNativeDRMGBM Changes NativeWindowFactory: - TYPE_EGL_GBM -> TYPE_DRM_GBM while keeping the package ID of '.egl.gbm' for NEWT (using EGL) - Initializing DRMUtil at initialization Changes EGLDrawableFactory: - Using native GBM device for the default EGL display creation instead of EGL_DEFAULT_DISPLAY. This resolves issues as seen in Bug 1402, as well in cases w/o surfaceless support. - GL profile mapping uses surfaceless when available for GBM, otherwise uses createDummySurfaceImpl (dummy GBM surface via GBMDummyUpstreamSurfaceHook) - createDummySurfaceImpl uses a dummy GBM surface via GBMDummyUpstreamSurfaceHook - DesktopGL not available with GBM, see Bug 1401 NEWT's DRM + GBM + EGL Driver - Using DRMLib, DRMUtil and DRMMode, removed most native code but WindowDriver swapBuffer - ScreenDriver uses DRMMode, however currently only first connected CRT. - WindowDriver aligns position and size to screen, positions other than 0/0 causes DRM failure - WindowDriver reconfigure n/a NEWT TODO: - DRM Cursor support (mouse pointer) - Pointer event handling
* Bug 1156: GBM: Bring up incl GL rendering (TODO: GBM working page flip / sync)Sven Gothel2019-11-236-90/+485
| | | | | | | | | | | | | | | | | - EGLSurface: Factor out 'eglCreate[Platform]WindowSurface' NEWT egl.gbm.WindowDriver -- Properly use GBM fourcc format and use as visualID for GBM surface creation and EGL config selection -- Create eglSurface within this class -- Hook up GBM/DRM page flip (not working yet, no visible artifacts - no swap) - ProxySurfaceImpl.surfaceSwap() call upstreamSurface's implementation if available TODO: 'Permission denied' calling: - drmSetMaster (optional) - drmModeSetCrtc - drmModePageFlip
* Bug 1156: GBM: Fixing native GBM code, surviving initializationSven Gothel2019-11-223-32/+114
|
* Bug 1156: NEWT: NewtFactory.getCustomClass(..) RobustnessSven Gothel2019-11-224-20/+11
| | | | | getCustomClass(..) shall throw all required exceptions upstream. Previous essential NEWT driver exception information got suppressed if failing, only disclosed in debug mode.
* Bug 1156: EGL-GBM: Cleanup Code & Replace Newt GBM implementationSven Gothel2019-11-219-421/+704
| | | | | | GBM driver is now under egl/gbm subpackage and has been replaced by bcm_vc_iv boilerplate. Native code is reentrant capable and cleaned up. TODO: EGLDisplayUtil work with SharedResourceRunner
* gbm/WindowDriver: make it compile and linkXerxes Rånby2019-11-212-5/+7
|
* Bug 1156: EGL-GBM: Cherry pick changes ..Sven Gothel2019-11-211-2/+5
|
* add native gbm implementation for drm and gbm initialization.Erik De Rijcke2019-11-213-152/+117
|
* add gbm java & build modificationsErik De Rijcke2019-11-214-0/+447
|
* Bug 1393: MacOS: Wait for window position setting on main-thread (blocking)Sven Gothel2019-11-212-26/+10
| | | | Also issue the orderFront0 call within createWindow1 (aligned with IOS code)
* Bug 1393: MacOS: Implement AppKit EDTUtil operating solely on main-threadSven Gothel2019-09-162-1/+362
| | | | | | Introducing boolean property 'newt.macos.useAppKitEDTUtil', which defaults to 'false'. If enabled, the new AppKitEDTUtil is being used, operating on the AppKit main thread. This is used to ease debugging Bug 1393, minimizing thread context switches.
* Bug 1394 - NEWT X11Window didn't gather inset at window creation (properly)Sven Gothel2019-09-111-16/+46
| | | | | | | | | | | | | | X11Window.c's 'NewtWindows_getFrameExtends(..)' retrieves the insets via XGetWindowProperty on _NET_FRAME_EXTENTS. Right after window creation this method fails as the WM did not yet provide the information as the window has not yet been mapped. Implementation needs to retry for a certain amount of time (250ms) and maximum number of attempts (96 XEvent). This issue surfaced while validating fix for Bug 1393, testing TestDisplayLifecycle02NEWT also on X11.
* NEWT Cleanup: WindowImpl: Drop unused 'defer' argument (state change only): ↵Sven Gothel2019-09-109-26/+21
| | | | insetsChanged + insetsVisibleChanged
* NEWT Cleanup: WindowImpl::visibleChanged(ZZ): Remove unused 'defer' ↵Sven Gothel2019-09-1018-51/+51
| | | | argument. Method only changes state.
* Bug 1393: MacOS/iOS: Issue updateSizePosInsets0 async to AppKit Main-ThreadSven Gothel2019-09-092-5/+22
| | | | | | Additionally, setPointerIcon0 must also be made async on AppKit (instead of wait), we have to assume/hope the user won't pull the PointerIconImpl instance in-between ;-) Hence removing the comment regarding the lifecycle.
* Bug 1393: Run orderFront0(=setVisible) async off-thread on AppKit after sync ↵Sven Gothel2019-09-095-159/+152
| | | | | | | | | | | | | | | | | AppKit NSWindow creation MacOS 10.14.6 + OpenJDK11U produces occasional freezes on AppKit Main Thread Latest manual tests after resolving Bug 1389 disclosed a few occasional freezes using NEWT + Java11. These are related to probable AWT changes since Java8, as these do not occur with Java8. Fix: Spun off orderFront0(=setVisible) async off-thread on AppKit after sync AppKit NSWindow creation. This fix also aligns the macos createWindow code with the new simplified ios implementation, see commit 004c67c73a0309158c30929cd0d6513e23f34803
* Bug 1363: Java 11: JAWTUtil: Use sun.awt.SunToolkit.awtLock/Unlock and ↵Sven Gothel2019-09-042-115/+6
| | | | | | | | | | | | | | | disableBackgroundErase (impl. semantics) Commit 13c6bbbde5ea476d60e0a2f04a5172d3302d0edd simply removed the AWT commonly used SunToolkit lock/unlock methods, which was incorrect. It lead to certain resources access collisions as access has to be synchronized using the same reentry lock across AWT and NativeWindow/JOGL. We utilize the new com.jogamp.common.util.UnsafeUtil of GlueGen commit 07c1885e9a3d1f3a3853414648c06fb3864bc69f to disable the IllegalAccessLogger while fetching the methods/fields and making them accessible. JAWUtil also hosts access to SunToolkit's disableBackgroundAccess(Component) aligning the code for GLCanvas, NewtCanvasAWT and AWTCanvas.