| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Callbacks as recommended
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a native dispatch'ed event like key/mouse/touch input
SIGSEGV on use after free of native X11 Display* at XEventsQueued in DisplayDriver.DispatchMessages0.
This potentially happens when an application destroys
the NEWT Window/Display from an action being called directly
from DisplayDriver.DispatchMessages0 (itself), i.e. keyboard or mouse input.
DisplayDriver.DispatchMessages0 stays in the event loop and the next
XEventsQueued call causes a SIGSEGV due to already deleted
display driver connection and hence invalid native X11 Display*.
This issue also exist for other Windowing System drivers,
where the native (dispatch) method sticks to a loop
and still (re)uses the window or display handle.
One is WindowsWindow, where touch events are looped,
but such handler could have closed the window.
Querying the status of a window / display instance before dispatching
is not be good enough
- resource could already be GC'ed, so we also would need to query jobject status
- would imply an addition Java callback
+++
This fix: Having the Java callbacks return
a boolean with the value Window.isNativeValid().
This way the dispatch logic
- can bail out right away w/o using the resource anymore
- must be reviewed by myself due to changed Call{Void->Boolean}*(..)
invocation change.
This review shall resolve potential similar issues.
+++
Tested on X11/Linux/GNU, Windows and MacOS
with new TestDestroyGLAutoDrawableNewtAWT,
which tests all destruction invocation variants.
|
|
|
|
|
|
|
|
|
|
| |
Commit c5431f46b7bf64f109315ec78461859dd88f202a
reduced the disableBackgroundErase(..) to SunToolkit's variation which doesn't work on Windows
as it does not act upon the java.awt.Canvas peer post addNotify().
This re-introduces the java.awt.Canvas method via class JAWTUtil.BackgroundEraseControl
and its called only after addNotify() on Windows and ASAP for everyone else.
Method also calles the SunTookit variation just to be sure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ad38d1559854985b1131e5b6c7274a392b5bc265
Commit ad38d1559854985b1131e5b6c7274a392b5bc265 introduced XTranslateCoordinates(..) to savely validate
the client-space window position against the parent (root).
Totally missing in this change was the NEWT child window case
since it always used the root-window as the destination.
This change tracks the parent-window (valid parent Window or NULL)
within the JavaWindow struct and either uses the parent-window
if available or the root-window for XTranslateCoordinates(..).
This results in the proper client-space position.
Validated against
- TestGearsES2NewtCanvasAWT
- TestBug1431NewtCanvasAWT
on Debian 12 w/ Java17.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
agnostic (PMVMatrix, Matrix4f, Vec4f, ..)
Math functionality (PMVMatrix, Matrix4f, Vec4f, ..)
- shall be used toolkit agnostic, e.g. independent from OpenGL
- shall be reused within our upcoming Vulkan implementation
- may also move outside of JOGL, i.e. GlueGen or within its own package to be reused for other purposed.
The 'com.jogamp.opengl.util.PMVMatrix' currently also used to feed in GLUniformData
via the toolkit agnostic SyncAction and SyncBuffer
shall also be split to a toolkit agnostic variant.
An OpenGL PMVMatrix specialization implementing GLMatrixFunc can still exist,
being derived from the toolkit agnostic base implementation.
+++
Initial commit .. compile clean, passing most unit tests.
|
|
|
|
| |
certain debug output to keep most silence for debugAll()
|
|
|
|
| |
AWT rendering thread support. Adopt it in tests and demos
|
|
|
|
|
|
|
|
|
|
|
| |
have AWT toolkit define pixelScale only (simplification)
This aligns with Glenn's initial AWT patch commit e5e7514d649cd7dd28bbb8e04b72338dc09c2c83, i.e. removing redundancies...
Tested on Linux, Windows and MacOS w/ GLCanvas, GLJPanel and GLWindow using pixelScale values:
- Linux: 1, 2
- Windows: 1, 1.25, 2
- MacOS: 1, 2
|
|
|
|
| |
dumpStack(); }
|
|
|
|
| |
blocking native change by monitor-pixelScale (Windows, X11)
|
|
|
|
| |
client-area in windowUnits (*fix regression*)
|
| |
|
|
|
|
| |
type in returned string
|
| |
|
|
|
|
| |
allowing access w/o jars. TODO: Test Android.
|
|
|
|
| |
RegionRenderer.init(..) renderModes argument
|
|
|
|
|
|
| |
FPSCounterImpl accuracy by maintaining timestamps in [ns]
Idea: Perhaps we want to use [ns] for FPSCounter's method types by now?
|
|
|
|
| |
eglSwapBuffers(..) already performs this task (TODO: More Tests!)
|
|
|
|
|
|
|
|
| |
newt.ws.mmwidth and newt.ws.mmheight property
This is essential on bare-metal devices where the screen DRM/GBM driver does not provide the screen-size (in mm).
Otherwise we would have resolution/(size_mm=0) infinity density and none of our graph font demos would work,
as we compute pixel-em-size based using dpi and pixel-pt-size.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
original font-units (FU) to have them scaled later ( fu * pixelScale / unitsPerEM )
Scaling from font-units (funits, or FU) is now performed by the renderer itself,
i.e. applying the scale-factor 'fontPixelSize / font.getMetrics().getUnitsPerEM()'
to the PMV matrix to render the whole graph GLRegion.
This finally provides proper device and resolution independent font utilization.
Further, preliminary kerning has been added.
+++
Also ...
TypecastFont:
- getGlyphID(..) getGlyph(..) enforce symbol mapping to Glyph.ID_SPACE Glyph.ID_CR,
as some fonts ave an erroneous cmap (FreeSerif-Regular)
- add getKerning(..)
TODO: Add binary search
- Set TypecastFont.USE_PRESCALED_ADVANCE := false,
i.e. dropping all prescaled pixel-sized advance values mapped to font pixel-size
as we utilize font-units only for later uniform scaling.
- Drop virtual getPixelSize() and add static FontScale.toPixels(..)
- Add fullString() for debugging purposed, including some font tables
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
monitor values w/ QT_SCREEN_SCALE_FACTORS syntax, use for X11
Per-monitor values are parsed if value is not a float and stored
in a given Map<String,float[2]>, parallel to a detected global_pixel_scale_xy.
The per-monitor value syntax matches QT_SCREEN_SCALE_FACTORS,
i.e. the regular expression '(<string>=<float>;)+',
e.g. QT_SCREEN_SCALE_FACTORS='DP-1=1.25;DP-2=1.25;HDMI-1=1.25;'
The per-monitor value is preferred and on X11 stored within the MonitorDevice,
matching the MonitorDevice's name.
The following env-var names are searched on X11:
"QT_SCREEN_SCALE_FACTORS", "QT_SCALE_FACTOR", "GDK_SCALE", "SOFT_SCALE"
|
|
|
|
|
|
| |
to the root window (global screen) ..
.. otherwise, we might end up receiving a client position of 0/0, while being positioned in a different absolute place within root.
|
|
|
|
| |
object
|
| |
|
|
|
|
| |
for X11 and Windows for now.
|
| |
|
|
|
|
|
|
|
|
| |
WindowDriver, used to call the super class method.
Regression of commit cfc35549810d3a0fb5eeb866c9450417e48cd8a1
Note to myself: You can't enforce a 'this' method call overridden with a virtual from a subclass.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(working state)
Both:
- Using Soft-PixelScale mode, i.e. converting all given window-units to pixel-units for native GDI/X11 ops
- Using scaled pixel-sized surface
- Adjusting NEWT's Monitor's window-unit viewport value to pixel-scale
For X11:
- Using global scale factor from environment variable, either: "GDK_SCALE", "QT_SCALE_FACTOR" or "SOFT_SCALE".
The latter is for testing only.
See https://wiki.archlinux.org/title/HiDPI
For Windows:
- Using actual monitor's pixel-scale via native SHC API (Shellscaling API, shcore.dll)
Misc:
- SurfaceScaleUtils.getGlobalPixelScaleEnv() reads a float value from given env names, first come, first serve
- MonitorModeProps.streamInMonitorDevice(..): Add `invscale_wuviewport` argument to scale wuvieport for soft-pixel-scale
- TestGearsNEWT: Enhance GL2 demo to be suitable for manual tests, this since my Windows KVM machine doesn't support ES2
- TestGLContextDrawableSwitch10NEWT: Add a few more test constraints .. working
Tested:
- Manually on a Windows virtual machine (KVM) using
- 2 virtualized 'Video QXL' cards and
- and 'remote-viewer' to see the 2 monitors
since `Virtual Machine Manager` build-in doesn't support
- remote-viewer spice://localhost:5917
- Manually on a Linux machine w/ SOFT_SCALE
- Both, X11 and Windows
- Place window on each monitor
- Move window across monitors w/ pixel-scale change (or not)
- TODO: Test and fix utilization with AWT, i.e. NewtCanvasAWT
|
|
|
|
|
|
|
| |
general usage
See MonitorDevice.getOrientationTo(MonitorDevice, int[]) to setup the move_diff
as added in commit 43dc472c4797f34e4079028a5eb04bc420c11c2a
|
|
|
|
|
|
| |
set a custom position additionally to size
This added functionality is desired when adjusting the window position and size when changing the soft-pixel-scale
|
|
|
|
|
|
| |
positionModified[] return value, allowing to not wait for the previous custom position
This is required if createNativeImpl(..) modifies the target position, i.e. due to soft-pixel-scale.
|
|
|
|
|
|
|
|
|
|
|
|
| |
determine the orientation of this monitor to the other incl. the 'move_diff'
move_diff int[2] to store the move delta for each axis from this-monitor to the other
This will be utilized when a NEWT window moved across monitors to signal the move_diff,
which helps to properly adjust the new position.
Tested: All 4 monitor crossings right_of, left_of, above and below.
TODO: Test and support a 'diagonal' move, i.e. move_diff on both axis.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
size and position via atomic-replacable int arrays
NEWT's Soft-PixelScale supports software pixel-scale by multiplying the underlying surface pixel-size with the scale-factor
and dividing the window position and size by same scale-factor.
Hence the window position and size space is kept virtually steady at virtually assumed DPI 96 at higher actual screen DPI
and the surface size is adjusted.
+++
This window- and pixel-unit separation also includes all callbacks for the native driver implementations,
hence the changes native code - allowing to determine whether window- or pixel-units were given.
|
|
|
|
|
|
|
|
|
|
| |
left-over changes ..
GDIUtil: Remove uncommented GetMonitorPixelScale(..) point variant
JAWTUtil: Clarify Java version comment w/ spacing
NEWT Display.getThreadName(): Return 'Thread[0x<hash-value>, <name>]'
NEWT Screen: Add getFullyEnteredMonitor(..)
NewtCanvasAWT: @SuppressWarnings for determineIfApplet() and use FQN within method
|
| |
|
|
|
|
| |
Add 64-bit nativeHandle (Windows HMONITOR), add PixelScale for Windows
|
|
|
|
| |
callbacks ..
|
|
|
|
| |
deadlock)
|
|
|
|
| |
null com.jogamp.newt.swt.NewtCanvasSWT.access$200(com.jogamp.newt.swt.NewtCanvasSWT)
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
TSMGetInputSourceProperty(), crashing on MacOS >= 13
Perhaps we want a replacement?
Fallback code uses keyCode, i.e. dropping the current keyboard layout (-> US).
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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(..)
|