Merge branch 'main' into arch_refactor
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -317,12 +317,7 @@ static void enter_notify(xcb_enter_notify_event_t *ev) {
|
||||
if (!client || wm.client_focused == client) return;
|
||||
|
||||
client_focus(client);
|
||||
}
|
||||
|
||||
static void focus_in(xcb_focus_in_event_t *ev) {
|
||||
client_t *client = client_get_by_window(ev->event);
|
||||
if (!client) return;
|
||||
wm_set_current_monitor(client->monitor, ev->mode != XCB_NOTIFY_MODE_NORMAL);
|
||||
wm_set_current_monitor(client->monitor, false);
|
||||
}
|
||||
|
||||
static void selection_clear(xcb_selection_clear_event_t *ev) {
|
||||
@@ -353,7 +348,6 @@ static void handle_xcb_event(xcb_generic_event_t *event) {
|
||||
EVENT(XCB_UNMAP_NOTIFY, unmap_notify);
|
||||
EVENT(XCB_DESTROY_NOTIFY, destroy_notify);
|
||||
EVENT(XCB_ENTER_NOTIFY, enter_notify);
|
||||
EVENT(XCB_FOCUS_IN, focus_in);
|
||||
EVENT(XCB_SELECTION_CLEAR, selection_clear);
|
||||
|
||||
#undef EVENT
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -38,6 +38,7 @@ struct client_t {
|
||||
bool minimize;
|
||||
bool sticky;
|
||||
bool urgent;
|
||||
bool skip_taskbar;
|
||||
bool size_freeze; /* 尺寸冻结窗口一定是浮动窗口 */
|
||||
|
||||
char *class, *instance;
|
||||
|
||||
Reference in New Issue
Block a user