feat: 添加 _NET_WM_STATE_SKIP_TASKBAR 支持
- 新增 skip_taskbar 字段到 client_t - 在 client_update_window_type 中检测并设置 skip_taskbar 状态 - 状态栏绘制时过滤 skip_taskbar 窗口
This commit is contained in:
@@ -27,6 +27,7 @@ _NET_WM_STATE
|
|||||||
_NET_WM_STATE_FULLSCREEN
|
_NET_WM_STATE_FULLSCREEN
|
||||||
_NET_WM_STATE_MAXIMIZED_HORZ
|
_NET_WM_STATE_MAXIMIZED_HORZ
|
||||||
_NET_WM_STATE_MAXIMIZED_VERT
|
_NET_WM_STATE_MAXIMIZED_VERT
|
||||||
|
_NET_WM_STATE_SKIP_TASKBAR
|
||||||
_NET_WM_WINDOW_TYPE
|
_NET_WM_WINDOW_TYPE
|
||||||
_NET_WM_WINDOW_TYPE_DIALOG
|
_NET_WM_WINDOW_TYPE_DIALOG
|
||||||
_NET_SUPPORTED
|
_NET_SUPPORTED
|
||||||
|
|||||||
@@ -366,6 +366,7 @@ void client_update_window_type(client_t *client) {
|
|||||||
|
|
||||||
if (state_reply) {
|
if (state_reply) {
|
||||||
xcb_atom_t state = *(xcb_atom_t *)xcb_get_property_value(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) {
|
if (state == _NET_WM_STATE_FULLSCREEN) {
|
||||||
client_set_fullscreen(client, true);
|
client_set_fullscreen(client, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -350,7 +350,10 @@ static void monitor_draw_tasks(monitor_t *monitor, int16_t right_edge) {
|
|||||||
if (!task_list) return;
|
if (!task_list) return;
|
||||||
|
|
||||||
uint16_t task_count = 0;
|
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;
|
if (task_count == 0) return;
|
||||||
|
|
||||||
int16_t x = monitor->layout_symbol_extent.end;
|
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;
|
if (task_width < wm.font_size) return;
|
||||||
|
|
||||||
for (task_in_tag_t *task = task_list; task; task = task->next) {
|
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.start = x;
|
||||||
task->bar_extent.end = x + task_width;
|
task->bar_extent.end = x + task_width;
|
||||||
x += task_width;
|
x += task_width;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ struct client_t {
|
|||||||
bool minimize;
|
bool minimize;
|
||||||
bool sticky;
|
bool sticky;
|
||||||
bool urgent;
|
bool urgent;
|
||||||
|
bool skip_taskbar;
|
||||||
bool size_freeze; /* 尺寸冻结窗口一定是浮动窗口 */
|
bool size_freeze; /* 尺寸冻结窗口一定是浮动窗口 */
|
||||||
|
|
||||||
char *class, *instance;
|
char *class, *instance;
|
||||||
|
|||||||
Reference in New Issue
Block a user