feat: 添加 _NET_WM_STATE_SKIP_TASKBAR 支持

- 新增 skip_taskbar 字段到 client_t
- 在 client_update_window_type 中检测并设置 skip_taskbar 状态
- 状态栏绘制时过滤 skip_taskbar 窗口
This commit is contained in:
2026-03-11 06:45:37 +08:00
parent cdcafa1216
commit 1ec92ec3e2
4 changed files with 9 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ _NET_WM_STATE
_NET_WM_STATE_FULLSCREEN
_NET_WM_STATE_MAXIMIZED_HORZ
_NET_WM_STATE_MAXIMIZED_VERT
_NET_WM_STATE_SKIP_TASKBAR
_NET_WM_WINDOW_TYPE
_NET_WM_WINDOW_TYPE_DIALOG
_NET_SUPPORTED

View File

@@ -366,6 +366,7 @@ void client_update_window_type(client_t *client) {
if (state_reply) {
xcb_atom_t state = *(xcb_atom_t *)xcb_get_property_value(state_reply);
client->skip_taskbar = state == _NET_WM_STATE_SKIP_TASKBAR;
if (state == _NET_WM_STATE_FULLSCREEN) {
client_set_fullscreen(client, true);
}

View File

@@ -350,7 +350,10 @@ static void monitor_draw_tasks(monitor_t *monitor, int16_t right_edge) {
if (!task_list) return;
uint16_t task_count = 0;
for (task_in_tag_t *task = task_list; task; task = task->next) ++task_count;
for (task_in_tag_t *task = task_list; task; task = task->next) {
if (task->client->skip_taskbar) continue;
++task_count;
};
if (task_count == 0) return;
int16_t x = monitor->layout_symbol_extent.end;
@@ -361,6 +364,8 @@ static void monitor_draw_tasks(monitor_t *monitor, int16_t right_edge) {
if (task_width < wm.font_size) return;
for (task_in_tag_t *task = task_list; task; task = task->next) {
if (task->client->skip_taskbar) continue;
task->bar_extent.start = x;
task->bar_extent.end = x + task_width;
x += task_width;

View File

@@ -38,6 +38,7 @@ struct client_t {
bool minimize;
bool sticky;
bool urgent;
bool skip_taskbar;
bool size_freeze; /* 尺寸冻结窗口一定是浮动窗口 */
char *class, *instance;