GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Linux platform (GTK 4) by triniwiz · Pull Request #11620 · NativeScript/NativeScript

Conversation

@triniwiz

@triniwiz triniwiz commented Nov 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Adds support for the new Linux runtime (GTK 4).

Part of #27

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
triniwiz added 14 commits November 6, 2026 19:56
@triniwiz
feat(linux): GTK 4 platform
d5c257c
Adds a linux platform to @nativescript/core and @nativescript/webpack,
running on the NativeScript Linux runtime (C APIs from metadata).

- webpack: linux platform, __LINUX__ / global.isLinux, CommonJS output
- core: isLinux, LinuxApplication, LinuxNativeWindow (GtkWindow)
- views: core's own measure/layout pass (as on iOS); containers are
  GtkFixed with a JS custom layout manager placing children at the
  computed frames, leaf widgets measured with gtk_widget_measure
- styling through per-widget GTK CSS; Pango markup for formatted text
- Label, Button, Page, Frame, ActionBar, layouts, file system (GIO),
  http (runtime fetch), image source (GdkTexture), settings, device,
  screen, connectivity; remaining widgets are placeholders for now
- types-minimal: generated GTK / GLib / Pango / Cairo typings
@triniwiz
feat(linux): app id, window icon and window options
0600d56
The program name is the app id from nativescript.config, so desktops match
windows to <app-id>.desktop; the window icon comes from the staged icon
theme. linux.window sets the initial size, minimum size, resizability and
title. res:// images resolve from App_Resources/Linux/images.
@triniwiz
feat(linux): ScrollView, TextField, TextView, Switch, Slider, Progres…
3128569
…s, ActivityIndicator, SearchBar, HtmlView

- containers inside GTK scrolling viewports report their NativeScript frame
  as their size; only views NativeScript never laid out run a layout pass
- widget CSS changes re-measure the owning view; sub-part styling (switch
  thumb, scale highlight, progress fill, links) via scoped display CSS
@triniwiz
feat(linux): Image, DatePicker, TimePicker, ListPicker, SegmentedBar
0206d7e
Image is a GtkPicture over the source's GdkTexture (measured like iOS),
pickers use GtkCalendar, spin buttons and GtkDropDown, SegmentedBar is a
linked toggle button group. Also fixes TextView sizing (GTK validates text
lines lazily) and drops the platformCheck import that webpack 5.112 leaves
unresolved.
@triniwiz
feat(linux): gestures on GTK 4 controllers
13950b4
tap / doubleTap (GtkGestureClick), longPress, pan and touch (GtkGestureDrag),
swipe, pinch (GtkGestureZoom) and rotation, with iOS semantics: taps don't
fire for drags or long presses, pans start after movement, still releases
aren't swipes. Signal trampolines now take typed (double / int) arguments.
@triniwiz
feat(linux): alert, confirm, prompt, login and action dialogs
7b3e9f1
Modal windows over the app window built from GTK widgets (GTK 4.6 has no
GtkAlertDialog): primary button is the default, Return in an entry submits,
closing the window resolves as cancel unless cancelable is false.
@triniwiz
feat(linux): frame-driven animations
8a88bbd
Tweens opacity, backgroundColor, translate, scale, rotate, width and height
with CSS / Core Animation cubic-bezier curves, delays, iterations (including
infinite), sequential playback and cancel. GTK 4.6's GL renderer shears
views that are both rotated and translucent (fine with GSK_RENDERER=cairo
and newer GTK).
@triniwiz
feat(linux): ListView on GtkListView
bc97fad
Virtualized rows: a GtkStringList of placeholders backs a GtkListView, and
each bound row hosts a NativeScript view from the item template (itemLoading,
template selector, rowHeight, itemTap, loadMoreItems, scrollToIndex).

Views a parent hosts in a GTK widget (list rows, ActionBar.titleView) now
answer GTK's measure with a NativeScript measure and lay themselves out.
@triniwiz
feat(linux): TabView on GtkNotebook
51d8cb0
Each item's view is a hosted page laid out by NativeScript; items load once
the TabView loads (as on iOS); tab switches feed selectedIndex; tab text,
selected text, background and font size through scoped CSS.
@triniwiz
feat(linux): SplitView layout, WebView fallback
40abd00
SplitView lays out primary | supplementary | secondary | inspector columns
from the preferred width fractions, with show/hide per role. WebView opens
pages in the desktop browser until WebKitGTK 6.0 is in the metadata.
@triniwiz
fix(linux): hot module replacement reloads the edited page
396195c
As on iOS, livesync goes to the root view, which replaces the page whose
module changed and resets the root content when nothing handled it
(Frame.reloadPage is Android only).
@triniwiz
feat(core): linux native-api-usage.json for metadata filtering, C typ…
c293fd2
…ings with macro constants
@triniwiz
feat(vite): linux platform (build, HMR via the runtime's ns:module)
53f6ad1
@triniwiz
fix(vite): purge transform caches on TypeScript flavor hot updates
acd2924
@nx-cloud

nx-cloud Bot commented Nov 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 6122649

Command Status Duration Result
nx run-many -t build -p core,webpack5,vite ✅ Succeeded 25s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-11-12 00:55:57 UTC

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pkg-pr-new

pkg-pr-new Bot commented Nov 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11620
npm i https://pkg.pr.new/@nativescript/vite@11620
npm i https://pkg.pr.new/@nativescript/webpack@11620

commit: 6122649

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

triniwiz added 4 commits November 6, 2026 22:50
@triniwiz
fix(linux): AppStream-valid default metainfo (description, release)
59ce879
@triniwiz
chore(linux): default icon from the app templates' NativeScript artwork
d9beac2
@triniwiz
feat(linux): linux.appearance pins a light or dark GTK theme
deee1d6
'system' (the default) follows the desktop. 'light' or 'dark' set GtkSettings for the app, so a light app theme stays readable on a dark desktop, like a fixed Android app theme.
@triniwiz
feat(linux): requestAnimationFrame at the display refresh rate
add6df5
Frames come from the window's GDK frame clock (as CADisplayLink / Choreographer on iOS / Android), in g_get_monotonic_time() milliseconds; a ~60 Hz timer only until the first window exists.
This was referenced Nov 7, 2026
feat: Linux support triniwiz/nativescript-mason#172
Merged
feat: Linux support NativeScript/canvas#189
Merged
triniwiz added 8 commits November 7, 2026 04:53
@triniwiz
fix(linux): keep a page's focus across navigation
bb2d0c4
GTK gave the returning page's first focusable widget focus, and a ScrollView holding it scrolled
back to it. The page's focused view is now restored instead.
@triniwiz
docs(linux): appearance and config docs without toolkit details
9b2e9f3
@triniwiz
feat(linux): read app files from the app bundle
71e9fe8
File, Folder and ImageSource read the app folder through the runtime's
app.nsbundle when one is mounted (zero-copy for unencrypted bundles);
writes inside it fail with EROFS.
@triniwiz
feat(linux): bundle, bundleUnpack, sourceProtect and fuses config
e5ac69a
@triniwiz
fix(linux): balanced, escaped markup from HtmlView html
7906dfb
Unclosed or stray tags and raw & / < in hrefs made GTK reject the whole
markup (the label kept its old text). Open tags are now tracked and closed,
and href values escaped.
@triniwiz
fix(linux): ImageSource.toBase64String without a temp file
b612c2c
Encodes the PNG in memory instead of leaving ns-image-<ms>.png files (which
collided within the same millisecond) in the cache folder.
@triniwiz
fix(linux): HtmlView only opens http, https and mailto links
447f6ed
HTML content may be untrusted: file://, custom schemes and desktop
launchers no longer open.
@triniwiz
feat(linux): linux.v8Flags config
697a377
triniwiz added 6 commits November 8, 2026 06:15
@triniwiz
fix(linux): CSS keyframe animations, mouse enter/leave/move and Activ…
9f94e72
…ityIndicator spin (#11623)

* fix(linux): CSS keyframe animations write keyframe values

KeyframeAnimation sets the style's keyframe values when it starts, and they win
over local values, so the Linux Animation's local writes didn't show until the
animation ended (animate-pulse never pulsed). Like iOS and Android, an animation
with valueSource 'keyframe' now writes the keyframe values.

* feat(linux): mouseEnter, mouseLeave and mouseMove events

A GtkEventControllerMotion, attached while any of them has a listener, raises
the events (mouseMove with getX/getY) and keeps the hover visual state, as
Windows does. MasonKit's :hover and onMouseLeave relied on them.

* fix(linux): ActivityIndicator spins when busy is set before it's shown

GTK left the spinner's CSS animation still when gtk_spinner_start ran before
the widget was on screen (or inside its map signal), until a theme change
restyled it. It now starts on the turn after the spinner is mapped.
@triniwiz
fix(linux): restore a page's focus without scrolling to it (#11625)
67f1c96
@triniwiz
fix(vite): replay the launch event for frameworks that call run() aft…
ecff5a5
…er the placeholder

On Linux, Application.run() fires the one-shot launch event while the HMR
placeholder boots, before the app entry loads. Angular registers its launch
listener later and calls run() without an entry, which the patched run()
ignored, so the app never bootstrapped. Replay the launch event once and
install the root a listener supplies.
@triniwiz
fix(vite): read the CLI-written package.json in the HMR core bundle
77867dd
Core reads the app config with require('~/package.json'), but the core
bundle served it as an ESM default export, so require() returned
{ default } and Linux never set the program name, app name or window
title. Serve it as CommonJS that loads the CLI-written package.json on
device, with nativescript.config as the fallback.
@triniwiz
fix(linux): request animation frames one at a time
3456c82
FPSCallback started and stopped continuous updating on the window's frame
clock (through a tick callback) for every animation. GTK 4.6 resets its
frame-time smoothing each time updating starts, and doing that repeatedly
stalls GTK's own CSS animations: a GtkSpinner stops turning while short
view animations run. Request the next UPDATE phase from the clock on each
frame instead, as requestAnimationFrame does.
@triniwiz
fix(linux): load a page again when navigating back to it
6122649
Forward navigation unloads the outgoing page but leaves it in the frame,
so going back showed it without raising loaded and its views stayed
unloaded.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@triniwiz
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.