Draw the window's own frame: no menu bar, no title bar

The File/Edit/View/Window menu is a browser's menu, and it brought
accelerators that fought the app's own shortcuts. The OS title bar is gone
too, with minimize/maximize/close drawn in the header beside the language
toggle.

Two things a frameless window has to be told explicitly, both of which fail
as a window that cannot be moved rather than as an error: the header has to
declare itself a drag region, and interactive children have to opt out of it.

Maximise state is read from the window rather than tracked from the last
button press, because the window manager can maximise on its own — a
double-click on the drag region, a shortcut, or snapping to an edge.
This commit is contained in:
ylhan
2026-09-21 23:33:28 +08:00
parent e1193ed032
commit 607d01160f
13 changed files with 258 additions and 4 deletions
+13
View File
@@ -241,6 +241,19 @@ preload contextBridge,窄白名单 —— 这个文件**就是**
字节以 `Uint8Array` 跨界,绝不用字符串。TCP 经常把 UTF-8 字符切断在 chunk 之间,单独解码任一半都会损坏它;这个 bug 只在中文或 emoji 输出时出现,因此极易漏掉。
### 窗口边框
没有系统标题栏,也没有应用菜单:应用在头部自绘窗口按钮,除此之外什么都没有。
两个容易漏掉的连带后果:
- **头部是唯一的拖动区域。** 如果客户区从不声明 `-webkit-app-region: drag`,
窗口管理器就不会移动它——症状是窗口**完全拖不动**,而不是报错。
- **可交互的子元素必须用 `no-drag` 显式退出**,否则它们既拖不动、在某些平台上
也点不动。
最大化状态是从窗口**读取**的,而不是根据上一次按钮点击推断的——因为窗口管理器
可以自己最大化:双击拖动区、键盘快捷键、或贴边吸附。
### 终端字体
终端使用**桌面自己的等宽字体**——启动时从 `org.gnome.desktop.interface