feat(window): 任务栏层级提升到窗口之上

- render_range 顺序改为:背景 → 窗口 → 任务栏 → 光标,
  窗口拖到任务栏区域时会被任务栏盖住
- hit_test 在任务栏高度内直接返回 -1,避免窗口视觉上被任务栏
  盖住后还能点到下面的窗口;任务栏图标仍由 _taskbar_icon_hit 处理
This commit is contained in:
TermiNexus committed 2026-10-27 14:35:38 +08:00
1 parent b6ea47277c
commit b94de46ce5
1 file changed
+5 -3
+5 -3
View File
@@ -1397,11 +1397,11 @@ class DeskServer:
if xx < self.fb_w:
self.row_blit(xx, yy, self.bg_row, xx, self.fb_w - xx)
yy += 1
# 2) 任务栏(先于窗口,窗口会盖住它 —— 与内核桌面同序)
self._draw_taskbar_rows(y0, y1)
# 3) 窗口
# 2) 窗口
for i in range(cnt):
self.render_window_rows(order[i], y0, y1, top_z)
# 3) 任务栏:最后画,始终盖在窗口之上(视觉层级高于所有窗口)
self._draw_taskbar_rows(y0, y1)
# 4) 光标
self.render_cursor_rows(y0, y1)
@@ -1726,6 +1726,8 @@ class DeskServer:
# ---------------- 输入 ----------------
def hit_test(self, x: int, y: int) -> int:
# 任务栏层级最高:覆盖区域内不接受窗口命中(图标命中由 _taskbar_icon_hit 单独处理)
if y >= self.fb_h - TASKBAR_H: return -1
best: int = -1
best_z: int = -1
for i in range(desk.DESK_MAX_WIN):