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(windows): view location in window, on screen and relative to a view by triniwiz · Pull Request #11515 · NativeScript/NativeScript

Conversation

@triniwiz

@triniwiz triniwiz commented Oct 9, 2026

Copy link
Copy Markdown
Member

PR Checklist

  • The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages.
  • There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
  • You have signed the CLA.
  • All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/DevelopmentWorkflow.md#running-unit-tests-application.
  • Tests for the changes are included - https://github.com/NativeScript/NativeScript/blob/master/tools/notes/WritingUnitTests.md.

What is the current behavior?

On Windows, getLocationInWindow(), getLocationOnScreen() and getLocationRelativeTo() fall through to ViewCommon and return undefined.

What is the new behavior?

The Windows View implements all three, in DIPs as on Android and iOS:

  • getLocationInWindow(): the element's origin through TransformToVisual(null).
  • getLocationRelativeTo(other): the origin through TransformToVisual(other). It returns undefined unless both views share a XamlRoot.
  • getLocationOnScreen(): the in-window location plus the window's client-area origin. A new getClientOriginOnScreen(xamlRoot) util in window-helper.windows.ts reads that origin from the AppWindow (outer position plus frame insets, divided by the window scale) and caches each root's AppWindow.

Each call makes one or two native calls, and the origin point is created once.

Stacked on #11468 (base fix/windows-parent-percent-sizing).

Testing:

  • Tested on Windows x64 with nativescript-mason's WebSpec suite. It measures every fixture with getActualSize() and getLocationRelativeTo(): 416/416 pass without the suite's own Windows workarounds.
  • At 125% scale, getLocationOnScreen() for the window content matched Win32 ClientToScreen (109.6 × 132.8 DIPs).
  • tsc -p packages/core/tsconfig.lib.json reports no errors.
  • There are no specs for the Windows view.

Sorry, something went wrong.

Uh oh!

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

All reactions
@triniwiz
feat(windows): view location in window, on screen and relative to a view
2994750
getLocationInWindow and getLocationRelativeTo transform the element's origin
through XAML; getLocationOnScreen adds the window's client origin, read off its
AppWindow (cached per XamlRoot) by a window-helper util.
@nx-cloud

nx-cloud Bot commented Oct 9, 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 83ee840

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 13s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

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


☁️ Nx Cloud last updated this comment at 2026-10-19 13:22:10 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 Oct 9, 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@11515
npm i https://pkg.pr.new/@nativescript/vite@11515
npm i https://pkg.pr.new/@nativescript/webpack@11515

commit: 106a6da

All reactions

Sorry, something went wrong.

Uh oh!

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

@triniwiz triniwiz mentioned this pull request Oct 9, 2026
feat(windows): parity with Android and iOS triniwiz/nativescript-mason#91
Merged
triniwiz added 6 commits October 9, 2026 13:38
@triniwiz
Merge branch 'fix/windows-parent-percent-sizing' into fix/windows-vie…
c136c4b
…w-location
@triniwiz
Merge branch 'fix/windows-parent-percent-sizing' into fix/windows-vie…
fa5d852
…w-location
@triniwiz
Merge branch 'fix/windows-parent-percent-sizing' into fix/windows-vie…
646bb21
…w-location
@triniwiz
Merge branch 'fix/windows-parent-percent-sizing' into fix/windows-vie…
7be61a7
…w-location
@triniwiz
Merge remote-tracking branch 'origin/fix/windows-parent-percent-sizin…
83ee840
…g' into fix/windows-view-location

# Conflicts:
#	packages/core/ui/core/view/index.windows.ts
@triniwiz
Merge branch 'fix/windows-parent-percent-sizing' into fix/windows-vie…
106a6da
…w-location
@triniwiz
triniwiz merged commit 3917e9f into fix/windows-parent-percent-sizing Oct 23, 2026
7 checks passed

Uh oh!

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

@triniwiz
triniwiz deleted the fix/windows-view-location branch October 23, 2026 03:34
triniwiz added a commit that referenced this pull request Oct 23, 2026
@triniwiz
feat(windows): let a parent resolve its children's percentage sizes (#…
f301728
…11468)

* feat(windows): let a parent resolve its children's percentage sizes

View gains _setChildPercentSize(child, horizontal, fraction), which
returns false. A percentage width or height is handed to the parent's;
when it returns true, core leaves the XAML Width/Height unset and skips
its own percent sizing. Setting a length clears it (fraction null).

* feat(windows): view location in window, on screen and relative to a view (#11515)

getLocationInWindow and getLocationRelativeTo transform the element's origin
through XAML; getLocationOnScreen adds the window's client origin, read off its
AppWindow (cached per XamlRoot) by a window-helper util.
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.