Up to Tauri 2.0.6, the position values passed to the Window constructor and set in tauri.conf.json were treated as LogicalPosition. This is no longer the case since Tauri 2.1.0, at least on Windows 11.
Reproduction
const initialX = 100;
const initialY = 100;
const win = new WebviewWindow('win', {
x: initialX,
y: initialY
});
win.once('tauri://created', async () => {
const pos = await win.outerPosition();
const scaleFactor = await win.scaleFactor();
const logicalPos = pos.toLogical(scaleFactor);
console.log('Position (converted to logical)', logicalPos);
console.log(
'Logical position should match initial position (x, y)',
Math.round(logicalPos.x) === initialX,
Math.round(logicalPos.y) === initialY);
console.log('Physical Position (physical)', pos);
});
Output
Position (converted to logical) LogicalPosition { type: "Logical", x: 40, y: 40 }
Logical position should match initial position (x, y) false false
Physical Position (physical) Physical { Positiontype: "Physical", x: 100, y: 100 }
Expected behavior
Position values passed to the Window constructor should be treated as LogicalPosition.
Describe the bug
Up to Tauri 2.0.6, the position values passed to the
Window
constructor and set intauri.conf.json
were treated asLogicalPosition
. This is no longer the case since Tauri 2.1.0, at least on Windows 11.Reproduction
Output
Expected behavior
Position values passed to the
Window
constructor should be treated asLogicalPosition
.Full
tauri info
outputStack trace
No response
Additional context
Tested on Windows 11 with a High DPI display and 250% scaling.