Skip to content

feat(api): add logical monitor bounds to the Monitor object - #15520

Merged
Legend-Master merged 3 commits into
tauri-apps:devfrom
polw1:feat/monitor-logical-bounds
Jun 13, 2026
Merged

feat(api): add logical monitor bounds to the Monitor object#15520
Legend-Master merged 3 commits into
tauri-apps:devfrom
polw1:feat/monitor-logical-bounds

Conversation

@polw1

@polw1 polw1 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Adds logicalPosition, logicalSize and logicalWorkArea to the Monitor object returned by currentMonitor(), primaryMonitor(), monitorFromPoint() and availableMonitors().

The values are derived in mapMonitor() from the existing physical bounds via toLogical(scaleFactor), so they match the logical units expected by WebviewWindow creation options. This removes the need for manual physical-to-logical conversion in userland, which is easy to miss on macOS mixed-DPI setups.

Existing position, size, workArea and scaleFactor fields are unchanged, so the change is non-breaking.

closes #15519

@polw1
polw1 requested a review from a team as a code owner June 11, 2026 12:58
Comment thread packages/api/src/window.ts Outdated
@polw1
polw1 force-pushed the feat/monitor-logical-bounds branch from 13d4dca to f1a1676 Compare June 13, 2026 02:09
polw1 added 3 commits June 12, 2026 23:13
Replaces the logicalPosition/logicalSize/logicalWorkArea fields with JSDoc
on Monitor.size, Monitor.position and Monitor.workArea stating the values
are in physical pixels, including examples converting to the logical pixels
expected by window creation options.
@polw1
polw1 force-pushed the feat/monitor-logical-bounds branch from f1a1676 to 8cf8fb8 Compare June 13, 2026 02:14
@github-actions

Copy link
Copy Markdown
Contributor

Package Changes Through 8cf8fb8

There are 7 changes which include tauri-utils with patch, tauri-runtime-wry with patch, tauri with patch, @tauri-apps/api with patch, tauri-bundler with patch, tauri-cli with patch, @tauri-apps/cli with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.11.0 2.11.1
tauri-utils 2.9.2 2.9.3
tauri-bundler 2.9.2 2.9.3
tauri-runtime 2.11.2 2.11.3
tauri-runtime-wry 2.11.2 2.11.3
tauri-codegen 2.6.2 2.6.3
tauri-macros 2.6.2 2.6.3
tauri-plugin 2.6.2 2.6.3
tauri-build 2.6.2 2.6.3
tauri 2.11.2 2.11.3
@tauri-apps/cli 2.11.2 2.11.3
tauri-cli 2.11.2 2.11.3

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@Legend-Master Legend-Master left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentations should help a lot on this, thanks!

@Legend-Master
Legend-Master merged commit 9167826 into tauri-apps:dev Jun 13, 2026
13 checks passed
Proksima pushed a commit to Proksima/tauri that referenced this pull request Aug 5, 2026
…ps#15520)

* feat(api): add logical monitor bounds to the Monitor object

* docs(api): document physical pixel units on Monitor fields

Replaces the logicalPosition/logicalSize/logicalWorkArea fields with JSDoc
on Monitor.size, Monitor.position and Monitor.workArea stating the values
are in physical pixels, including examples converting to the logical pixels
expected by window creation options.

* fix monitor position example null check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] Add logical monitor bounds to the JS Monitor API

2 participants