Feat/logical UI scaling - #437
Draft
flsobral wants to merge 106 commits into
Draft
Conversation
flsobral
force-pushed
the
feat/logical-ui-scaling
branch
from
August 4, 2026 00:34
b09a01a to
ce56078
Compare
flsobral
force-pushed
the
feat/logical-ui-scaling
branch
7 times, most recently
from
August 13, 2026 00:11
9b0972a to
6c9440d
Compare
BREAKING CHANGE: recompiled applications use logical layout values by default. Set LayoutUnit.PIXEL on the root window to retain legacy pixel layout.
Use the visible AWT frame graphics configuration after peer creation and when it moves between displays.
Set ScreenSurface.contentScale alongside the iOS viewport dimensions so Skia and logical image operations receive the device scale instead of the default zero value. Keep the existing pixel dimensions and pitch unchanged while restoring the screen scaling contract on iOS. Copyright validation and cached diff checks passed; a full Xcode archive was deferred.
Derive Settings screen dimensions and density from the shared ScreenSurface so logical dimensions remain consistent with physical framebuffer scaling across platform initialization paths. Preserve the Windows small-screen fallback while using the surface's physical dimensions, resolution, and pixel format. Update the native caller to pass the full surface state. Validated copyright headers, staged whitespace, and the configured macOS Ninja native build. Full SDK, Android, and iOS validation were deferred because this slice only changes native settings initialization.
Store the platform content scale as a double so iOS coordinates, safe-area insets, touch events, and keyboard dimensions retain fractional scale factors until conversion to physical integer coordinates. Replace the shared iosScale state and update all affected native boundaries to round only after multiplication. This preserves logical geometry on Retina devices without changing the public API or generated artifacts. Validated headers, staged whitespace, stale-symbol search, and the configured native Ninja build. Full Xcode/iOS workspace validation was deferred because the configured macOS build does not compile UIKit sources.
Correct the generated JNI comments to match the current Launcher4A Java declarations, including Surface parameters and callback names and signatures. Keep the native header documentation synchronized with the Android bindings without changing the native ABI or runtime behavior. The machine-generated header remains free of a manually added copyright block. Validated staged whitespace and diff consistency. Native compilation was deferred because this commit changes comments only.
Move target-platform detection and normalized OS families into a shared CMake module and compiler-visible header. Use target properties derived from CMAKE_SYSTEM_NAME, Apple SDKs, Android, and legacy WinCE generators so CMake decisions no longer duplicate platform checks. Generate the platform configuration header while retaining a preprocessor fallback for non-CMake builds. Add repository copyright metadata to the new first-party headers and CMake module. Validated staged diff, copyright headers, CMake configure, and the macOS Ninja build. Cross-platform Android, iOS, Windows, and WinCE builds were deferred.
Move graphics, renderer, and windowing choices into a validated CMake module with exactly-one selection for each implementation group. Expose the selected backend in the generated platform configuration and use TC_RENDERER_SKIA consistently for Skia sources, dependencies, and link flags. Keep target link dependencies private while preserving the existing macOS Skia and SDL behavior. Validated staged diff, CMake configuration, and the macOS Ninja build. Android, iOS, Windows, and WinCE configurations were deferred.
Generate Launcher4A JNI declarations with javac -h as part of the Android build and pass the generated include root into CMake. Remove the checked-in machine-generated header, make native compilation fail early when generation is missing, and update the event include to the generated jni subdirectory. Keep Gradle task ordering tied to native configure and build tasks while preserving clean-task handling. Validated copyright headers, staged diff, JNI generation, Android CMake configuration, and the external native debug build. Full Android release and package validation was deferred.
Use shared TC_WINDOWING, TC_GRAPHICS, and TC_RENDERER macros to select windowing, graphics, and Skia implementations across native UI sources. Move the GLES and software graphics headers under backend/graphics and remove the duplicate Darwin declaration so platform routing follows one contract. This keeps SDL/Skia builds compiling on macOS while preserving legacy DirectFB paths and platform-specific GLES code. It changes source layout only for native headers; generated artifacts and Android/iOS packaging are unchanged. Validated with git diff --check --cached, copyright-header validation, and a CMake/Ninja Release build on macOS arm64. Android, iOS, and Linux builds were not run.
Just checking for the variable is enough.
Generate compile_commands.json from the native CMake configuration. This lets the VSCode C/C++ extension resolve TC_PLATFORM_CONFIGURED and other platform definitions emitted by CMake. Point the repository workspace at the generated build artifact. This changes developer tooling only; runtime and release behavior are unchanged. Validate CMake configuration and IntelliSense metadata generation; defer native compilation and full platform builds.
Keep Android surface creation, destruction, pause/resume, and keyboard shifts outside the SCREEN_CHANGED event payload so TScreenSurface owns the committed screen configuration and pending lifecycle changes. Store EGL, native-window, contentScale, and fontScale state in the surface extension, remove sentinel-based globals, and convert touch coordinates from physical to logical units. Preserve SCREEN_CHANGED as a notification with zeroed legacy arguments while routing Graphics scale values from the active surface. Validated copyright headers, staged diff checks, and the Android Java compile task. Full native Android release and runtime semantic validation remain deferred.
- preserve the orthogonal position in PathAnimation when explicitly requested - keep legacy PathAnimation behavior for existing consumers - fix TopMenu animations so they no longer override safe-area positioning - lay out SlidingWindow using its final safe-area-aware bounds before animating - start SlidingWindow offscreen without relaying out its contents - avoid briefly displaying SlidingWindow at its final position before the animation - keep SlidingWindow geometry consistent after screen resize and rotation
Exercise Window-based TopMenu, SlidingWindow, and SideMenu through the JavaSE preview renderer with portrait and asymmetric landscape insets, animation frames, reopen, resize, outside dismissal, and Back/Escape.
Keep screen dimensions, safe areas, layout, fonts, and input in logical units while deriving the Java Launcher framebuffer and pitch from density. Rasterize Control and Window primitives, text, images, copies, screenshots, alpha, fading, and raw pixel operations at the simulated content scale. Keep AWT monitor transforms and scale limited to host presentation. This changes Java simulator rendering only; native runtime behavior and packaged artifacts remain unchanged. Validate density 1, 2, and 3 with the focused simulator, graphics, layout, safe-area, and AWT suites. The full SDK suite retains the known order-dependent LegacySafeAreaVisualTest failure; its isolated rerun passes.
Keep the SLJIT JIT library private to the VM target and disable the SLJIT JIT option for Android native builds, where this configuration is not intended to be enabled. This prevents the JIT linkage from propagating and keeps Android builds on the supported non-JIT path. Validated copyright headers and the cached diff check. Full native and Android builds were deferred because this focused configuration change does not require a release build for commit validation.
Add a dedicated safe-area bridge header so Darwin event code no longer includes Window.h, avoiding duplicate SIP_* enumerators already provided by sipargs.h.
flsobral
force-pushed
the
feat/logical-ui-scaling
branch
from
August 18, 2026 23:16
edce7d1 to
032b29a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #433