Skip to content

MarkdownAura v1.4.3

Choose a tag to compare

@westsource westsource released this 09 Oct 13:00
· 24 commits to main since this release

MarkdownAura 1.4.3

A window that was minimised when the session was saved could not be brought back. Windows gives a
minimised window its iconic rectangle — 272×91 at (-32000, -32000) was what one session held — and the
app stored it and honoured it on the next launch: the window was there, 32000px to the left of everything
and the size of a postage stamp. Worse, the single-instance rule then hands every new launch to that
invisible window, so restarting does not help. Two guards, both measured before they were written:

  • saving keeps the last good rectangle while the window is minimised, so the icon rectangle is never
    stored in the first place;
  • restoring ignores a rectangle smaller than the window's own floor (720×480) or one that overlaps no
    monitor that exists now — a laptop undocked since the session was written has no screen where the
    second one used to be, and honouring that rectangle puts the window out of reach by the same route. An
    ignored rectangle leaves the default window: 1200×800, centred, and the session is healed on the spot.

And the window no longer grows by a frame on every launch. The session stored the outer size while
setSize sets the inner one, so each restart added the frame: measured 1000×700 → 1016×709 → 1032×718.
It now stores the inner size, and the round trip is exact.

Nothing else changes: these three fixes, the two read-only window permissions they need
(is-minimized, available-monitors), and the notes that say why. The PDF export that was developed
alongside them is not part of this release — it was withdrawn before it was ever committed.


最小化时保存的窗口矩形,会让应用再也回不来。 Windows 给最小化窗口报的是图标矩形(一次会话里
存的就是 272×91 @ (-32000,-32000)),应用把它记下来、下次启动照它摆放:窗口确实存在,但在离所有东西
32000 像素之外、只有邮票大小。更糟的是单实例机制会把之后每次启动都交给那个看不见的窗口,所以重启也没用。
两条护栏都是先量后写:

  • 保存时窗口处于最小化 → 不写几何,沿用"最后一次正常"的矩形,图标矩形根本没机会落盘;
  • 恢复时矩形小于窗口自身下限(720×480)、或与当前任何显示器都不相交(拔了扩展屏的笔记本,第二块
    屏的位置已经没有屏幕了,照它摆放同样会把窗口放到够不着的地方)→ 忽略它,保持 lib.rs 建好的默认窗口:
    1200×800 居中,并当场把会话治好。

另外,窗口不再每启动一次就长大一圈。 会话存的是外框尺寸,而 setSize 设置的是内框,于是每次
重启都加上一条边框的宽度:实测 1000×700 → 1016×709 → 1032×718。现在存内框,往返精确。

其余不变:就是这三处修复、它们需要的两条只读窗口权限(is-minimized、available-monitors),以及记录
"为什么这样做"的设计笔记。与它们同期开发的 PDF 导出不在本次发布内 —— 它从未提交就已撤除。