Skip to content

Commit fe46411

Browse files
aboseclaude
andcommitted
fix: use outerWidth/outerHeight for Tauri new window dimensions
Tauri's WebviewWindow constructor treats width/height as outer size, but innerWidth/innerHeight only gives the content area. This caused each File > New Window to shrink by the title bar and border size. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent dc34734 commit fe46411

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

docs/API-Reference/command/Commands.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,12 @@ Shows current file in OS file explorer
626626
## NAVIGATE\_OPEN\_IN\_TERMINAL
627627
Shows current file in OS Terminal
628628

629+
**Kind**: global variable
630+
<a name="NAVIGATE_OPEN_IN_INTEGRATED_TERMINAL"></a>
631+
632+
## NAVIGATE\_OPEN\_IN\_INTEGRATED\_TERMINAL
633+
Opens integrated terminal at the selected file/folder path
634+
629635
**Kind**: global variable
630636
<a name="NAVIGATE_OPEN_IN_POWERSHELL"></a>
631637

src/document/DocumentCommandHandlers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,10 +1757,10 @@ define(function (require, exports, module) {
17571757
}
17581758

17591759
function newPhoenixWindow(cliArgsArray = null, cwd=null) {
1760-
// Electron needs outerWidth/outerHeight (includes window chrome).
1761-
// Tauri needs innerWidth/innerHeight.
1762-
let width = window.__ELECTRON__ ? window.outerWidth : window.innerWidth;
1763-
let height = window.__ELECTRON__ ? window.outerHeight : window.innerHeight;
1760+
// Both Electron and Tauri need outerWidth/outerHeight (includes window chrome)
1761+
// so the new window matches the current window's total size.
1762+
let width = (window.__ELECTRON__ || window.__TAURI__) ? window.outerWidth : window.innerWidth;
1763+
let height = (window.__ELECTRON__ || window.__TAURI__) ? window.outerHeight : window.innerHeight;
17641764
Phoenix.app.openNewPhoenixEditorWindow(width, height, cliArgsArray, cwd);
17651765
}
17661766

0 commit comments

Comments
 (0)