opt: use event mask to decide whether print ipc message

This commit is contained in:
DreamMaoMao
2025-12-02 16:46:11 +08:00
parent 075d4979b6
commit 9196e2a50b
4 changed files with 205 additions and 96 deletions

View File

@@ -3255,6 +3255,6 @@ void reset_option(void) {
int reload_config(const Arg *arg) { int reload_config(const Arg *arg) {
parse_config(); parse_config();
reset_option(); reset_option();
printstatus(); printstatus(PRINT_ALL);
return 0; return 0;
} }

View File

@@ -503,7 +503,7 @@ int setlayout(const Arg *arg) {
selmon->pertag->ltidxs[selmon->pertag->curtag] = &layouts[jk]; selmon->pertag->ltidxs[selmon->pertag->curtag] = &layouts[jk];
clear_fullscreen_and_maximized_state(selmon); clear_fullscreen_and_maximized_state(selmon);
arrange(selmon, false); arrange(selmon, false);
printstatus(); printstatus(PRINT_ALL);
return 0; return 0;
} }
} }
@@ -517,7 +517,7 @@ int setkeymode(const Arg *arg) {
} else { } else {
keymode.isdefault = false; keymode.isdefault = false;
} }
printstatus(); printstatus(PRINT_KEYMODE);
return 1; return 1;
} }
@@ -866,7 +866,7 @@ int switch_keyboard_layout(const Arg *arg) {
wlr_seat_keyboard_notify_modifiers(seat, &tkb->modifiers); wlr_seat_keyboard_notify_modifiers(seat, &tkb->modifiers);
} }
printstatus(); printstatus(PRINT_KB_LAYOUT);
return 0; return 0;
} }
@@ -907,7 +907,7 @@ int switch_layout(const Arg *arg) {
} }
clear_fullscreen_and_maximized_state(selmon); clear_fullscreen_and_maximized_state(selmon);
arrange(selmon, false); arrange(selmon, false);
printstatus(); printstatus(PRINT_ALL);
return 0; return 0;
} }
@@ -918,7 +918,7 @@ int switch_layout(const Arg *arg) {
jk == LENGTH(layouts) - 1 ? &layouts[0] : &layouts[jk + 1]; jk == LENGTH(layouts) - 1 ? &layouts[0] : &layouts[jk + 1];
clear_fullscreen_and_maximized_state(selmon); clear_fullscreen_and_maximized_state(selmon);
arrange(selmon, false); arrange(selmon, false);
printstatus(); printstatus(PRINT_ALL);
return 0; return 0;
} }
} }
@@ -1260,7 +1260,7 @@ int toggletag(const Arg *arg) {
focusclient(focustop(selmon), 1); focusclient(focustop(selmon), 1);
arrange(selmon, false); arrange(selmon, false);
} }
printstatus(); printstatus(PRINT_ALL);
return 0; return 0;
} }
@@ -1278,7 +1278,7 @@ int toggleview(const Arg *arg) {
focusclient(focustop(selmon), 1); focusclient(focustop(selmon), 1);
arrange(selmon, false); arrange(selmon, false);
} }
printstatus(); printstatus(PRINT_ALL);
return 0; return 0;
} }
@@ -1398,7 +1398,7 @@ int comboview(const Arg *arg) {
view(&(Arg){.ui = newtags}, false); view(&(Arg){.ui = newtags}, false);
} }
printstatus(); printstatus(PRINT_ALL);
return 0; return 0;
} }

View File

@@ -10,8 +10,9 @@ static void dwl_ipc_manager_get_output(struct wl_client *client,
static void dwl_ipc_manager_release(struct wl_client *client, static void dwl_ipc_manager_release(struct wl_client *client,
struct wl_resource *resource); struct wl_resource *resource);
static void dwl_ipc_output_destroy(struct wl_resource *resource); static void dwl_ipc_output_destroy(struct wl_resource *resource);
static void dwl_ipc_output_printstatus(Monitor *monitor); static void dwl_ipc_output_printstatus(Monitor *monitor, uint32_t event_mask);
static void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output); static void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output,
uint32_t event_mask);
static void dwl_ipc_output_set_client_tags(struct wl_client *client, static void dwl_ipc_output_set_client_tags(struct wl_client *client,
struct wl_resource *resource, struct wl_resource *resource,
unsigned int and_tags, unsigned int and_tags,
@@ -87,7 +88,7 @@ void dwl_ipc_manager_get_output(struct wl_client *client,
wl_resource_set_implementation(output_resource, &dwl_output_implementation, wl_resource_set_implementation(output_resource, &dwl_output_implementation,
ipc_output, dwl_ipc_output_destroy); ipc_output, dwl_ipc_output_destroy);
wl_list_insert(&monitor->dwl_ipc_outputs, &ipc_output->link); wl_list_insert(&monitor->dwl_ipc_outputs, &ipc_output->link);
dwl_ipc_output_printstatus_to(ipc_output); dwl_ipc_output_printstatus_to(ipc_output, PRINT_ALL);
} }
void dwl_ipc_manager_release(struct wl_client *client, void dwl_ipc_manager_release(struct wl_client *client,
@@ -101,13 +102,16 @@ static void dwl_ipc_output_destroy(struct wl_resource *resource) {
free(ipc_output); free(ipc_output);
} }
void dwl_ipc_output_printstatus(Monitor *monitor) { // 修改IPC输出函数接受掩码参数
void dwl_ipc_output_printstatus(Monitor *monitor, uint32_t event_mask) {
DwlIpcOutput *ipc_output; DwlIpcOutput *ipc_output;
wl_list_for_each(ipc_output, &monitor->dwl_ipc_outputs, link) wl_list_for_each(ipc_output, &monitor->dwl_ipc_outputs, link)
dwl_ipc_output_printstatus_to(ipc_output); dwl_ipc_output_printstatus_to(ipc_output, event_mask);
} }
void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output) { // 修改主IPC输出函数根据掩码发送相应事件
void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output,
uint32_t event_mask) {
Monitor *monitor = ipc_output->mon; Monitor *monitor = ipc_output->mon;
Client *c = NULL, *focused = NULL; Client *c = NULL, *focused = NULL;
struct wlr_keyboard *keyboard; struct wlr_keyboard *keyboard;
@@ -115,14 +119,28 @@ void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output) {
int tagmask, state, numclients, focused_client, tag; int tagmask, state, numclients, focused_client, tag;
const char *title, *appid, *symbol; const char *title, *appid, *symbol;
char kb_layout[32]; char kb_layout[32];
focused = focustop(monitor);
zdwl_ipc_output_v2_send_active(ipc_output->resource, monitor == selmon);
// 只在需要时才获取这些数据
if (event_mask & (PRINT_ACTIVE | PRINT_TAG | PRINT_TITLE | PRINT_APPID |
PRINT_FULLSCREEN | PRINT_FLOATING | PRINT_X | PRINT_Y |
PRINT_WIDTH | PRINT_HEIGHT)) {
focused = focustop(monitor);
}
// 发送活动状态
if (event_mask & PRINT_ACTIVE) {
zdwl_ipc_output_v2_send_active(ipc_output->resource, monitor == selmon);
}
// 发送标签状态
if (event_mask & PRINT_TAG) {
for (tag = 0; tag < LENGTH(tags); tag++) { for (tag = 0; tag < LENGTH(tags); tag++) {
numclients = state = focused_client = 0; numclients = state = focused_client = 0;
tagmask = 1 << tag; tagmask = 1 << tag;
if ((tagmask & monitor->tagset[monitor->seltags]) != 0) if ((tagmask & monitor->tagset[monitor->seltags]) != 0)
state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE; state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE;
if (focused) {
wl_list_for_each(c, &clients, link) { wl_list_for_each(c, &clients, link) {
if (c->mon != monitor) if (c->mon != monitor)
continue; continue;
@@ -134,85 +152,143 @@ void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output) {
state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_URGENT; state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_URGENT;
numclients++; numclients++;
} }
}
zdwl_ipc_output_v2_send_tag(ipc_output->resource, tag, state, zdwl_ipc_output_v2_send_tag(ipc_output->resource, tag, state,
numclients, focused_client); numclients, focused_client);
} }
}
// 只在需要时才获取标题和应用ID
if (event_mask & (PRINT_TITLE | PRINT_APPID)) {
title = focused ? client_get_title(focused) : ""; title = focused ? client_get_title(focused) : "";
appid = focused ? client_get_appid(focused) : ""; appid = focused ? client_get_appid(focused) : "";
}
// 获取布局符号
if (event_mask & PRINT_LAYOUT_SYMBOL) {
if (monitor->isoverview) { if (monitor->isoverview) {
symbol = overviewlayout.symbol; symbol = overviewlayout.symbol;
} else { } else {
symbol = monitor->pertag->ltidxs[monitor->pertag->curtag]->symbol; symbol = monitor->pertag->ltidxs[monitor->pertag->curtag]->symbol;
} }
}
keyboard = &kb_group->wlr_group->keyboard; // 发送布局索引
current = xkb_state_serialize_layout(keyboard->xkb_state, if (event_mask & PRINT_LAYOUT) {
XKB_STATE_LAYOUT_EFFECTIVE);
get_layout_abbr(kb_layout,
xkb_keymap_layout_get_name(keyboard->keymap, current));
zdwl_ipc_output_v2_send_layout( zdwl_ipc_output_v2_send_layout(
ipc_output->resource, ipc_output->resource,
monitor->pertag->ltidxs[monitor->pertag->curtag] - layouts); monitor->pertag->ltidxs[monitor->pertag->curtag] - layouts);
zdwl_ipc_output_v2_send_title(ipc_output->resource, title ? title : broken); }
zdwl_ipc_output_v2_send_appid(ipc_output->resource, appid ? appid : broken);
// 发送标题
if (event_mask & PRINT_TITLE) {
zdwl_ipc_output_v2_send_title(ipc_output->resource,
title ? title : broken);
}
// 发送应用ID
if (event_mask & PRINT_APPID) {
zdwl_ipc_output_v2_send_appid(ipc_output->resource,
appid ? appid : broken);
}
// 发送布局符号
if (event_mask & PRINT_LAYOUT_SYMBOL) {
zdwl_ipc_output_v2_send_layout_symbol(ipc_output->resource, symbol); zdwl_ipc_output_v2_send_layout_symbol(ipc_output->resource, symbol);
if (wl_resource_get_version(ipc_output->resource) >= }
// 发送全屏状态
if ((event_mask & PRINT_FULLSCREEN) &&
wl_resource_get_version(ipc_output->resource) >=
ZDWL_IPC_OUTPUT_V2_FULLSCREEN_SINCE_VERSION) { ZDWL_IPC_OUTPUT_V2_FULLSCREEN_SINCE_VERSION) {
zdwl_ipc_output_v2_send_fullscreen(ipc_output->resource, zdwl_ipc_output_v2_send_fullscreen(ipc_output->resource,
focused ? focused->isfullscreen : 0); focused ? focused->isfullscreen : 0);
} }
if (wl_resource_get_version(ipc_output->resource) >=
// 发送浮动状态
if ((event_mask & PRINT_FLOATING) &&
wl_resource_get_version(ipc_output->resource) >=
ZDWL_IPC_OUTPUT_V2_FLOATING_SINCE_VERSION) { ZDWL_IPC_OUTPUT_V2_FLOATING_SINCE_VERSION) {
zdwl_ipc_output_v2_send_floating(ipc_output->resource, zdwl_ipc_output_v2_send_floating(ipc_output->resource,
focused ? focused->isfloating : 0); focused ? focused->isfloating : 0);
} }
if (wl_resource_get_version(ipc_output->resource) >=
// 发送X坐标
if ((event_mask & PRINT_X) &&
wl_resource_get_version(ipc_output->resource) >=
ZDWL_IPC_OUTPUT_V2_X_SINCE_VERSION) { ZDWL_IPC_OUTPUT_V2_X_SINCE_VERSION) {
zdwl_ipc_output_v2_send_x(ipc_output->resource, zdwl_ipc_output_v2_send_x(ipc_output->resource,
focused ? focused->geom.x : 0); focused ? focused->geom.x : 0);
} }
if (wl_resource_get_version(ipc_output->resource) >=
// 发送Y坐标
if ((event_mask & PRINT_Y) &&
wl_resource_get_version(ipc_output->resource) >=
ZDWL_IPC_OUTPUT_V2_Y_SINCE_VERSION) { ZDWL_IPC_OUTPUT_V2_Y_SINCE_VERSION) {
zdwl_ipc_output_v2_send_y(ipc_output->resource, zdwl_ipc_output_v2_send_y(ipc_output->resource,
focused ? focused->geom.y : 0); focused ? focused->geom.y : 0);
} }
if (wl_resource_get_version(ipc_output->resource) >=
// 发送宽度
if ((event_mask & PRINT_WIDTH) &&
wl_resource_get_version(ipc_output->resource) >=
ZDWL_IPC_OUTPUT_V2_WIDTH_SINCE_VERSION) { ZDWL_IPC_OUTPUT_V2_WIDTH_SINCE_VERSION) {
zdwl_ipc_output_v2_send_width(ipc_output->resource, zdwl_ipc_output_v2_send_width(ipc_output->resource,
focused ? focused->geom.width : 0); focused ? focused->geom.width : 0);
} }
if (wl_resource_get_version(ipc_output->resource) >=
// 发送高度
if ((event_mask & PRINT_HEIGHT) &&
wl_resource_get_version(ipc_output->resource) >=
ZDWL_IPC_OUTPUT_V2_HEIGHT_SINCE_VERSION) { ZDWL_IPC_OUTPUT_V2_HEIGHT_SINCE_VERSION) {
zdwl_ipc_output_v2_send_height(ipc_output->resource, zdwl_ipc_output_v2_send_height(ipc_output->resource,
focused ? focused->geom.height : 0); focused ? focused->geom.height : 0);
} }
if (wl_resource_get_version(ipc_output->resource) >=
// 发送最后图层
if ((event_mask & PRINT_LAST_LAYER) &&
wl_resource_get_version(ipc_output->resource) >=
ZDWL_IPC_OUTPUT_V2_LAST_LAYER_SINCE_VERSION) { ZDWL_IPC_OUTPUT_V2_LAST_LAYER_SINCE_VERSION) {
zdwl_ipc_output_v2_send_last_layer(ipc_output->resource, zdwl_ipc_output_v2_send_last_layer(ipc_output->resource,
monitor->last_surface_ws_name); monitor->last_surface_ws_name);
} }
if (wl_resource_get_version(ipc_output->resource) >= // 获取键盘布局(只在需要时)
if (event_mask & PRINT_KB_LAYOUT) {
keyboard = &kb_group->wlr_group->keyboard;
current = xkb_state_serialize_layout(keyboard->xkb_state,
XKB_STATE_LAYOUT_EFFECTIVE);
get_layout_abbr(kb_layout,
xkb_keymap_layout_get_name(keyboard->keymap, current));
}
// 发送键盘布局
if ((event_mask & PRINT_KB_LAYOUT) &&
wl_resource_get_version(ipc_output->resource) >=
ZDWL_IPC_OUTPUT_V2_KB_LAYOUT_SINCE_VERSION) { ZDWL_IPC_OUTPUT_V2_KB_LAYOUT_SINCE_VERSION) {
zdwl_ipc_output_v2_send_kb_layout(ipc_output->resource, kb_layout); zdwl_ipc_output_v2_send_kb_layout(ipc_output->resource, kb_layout);
} }
if (wl_resource_get_version(ipc_output->resource) >= // 发送键模式
if ((event_mask & PRINT_KEYMODE) &&
wl_resource_get_version(ipc_output->resource) >=
ZDWL_IPC_OUTPUT_V2_KEYMODE_SINCE_VERSION) { ZDWL_IPC_OUTPUT_V2_KEYMODE_SINCE_VERSION) {
zdwl_ipc_output_v2_send_keymode(ipc_output->resource, keymode.mode); zdwl_ipc_output_v2_send_keymode(ipc_output->resource, keymode.mode);
} }
if (wl_resource_get_version(ipc_output->resource) >= // 发送缩放因子
if ((event_mask & PRINT_SCALEFACTOR) &&
wl_resource_get_version(ipc_output->resource) >=
ZDWL_IPC_OUTPUT_V2_SCALEFACTOR_SINCE_VERSION) { ZDWL_IPC_OUTPUT_V2_SCALEFACTOR_SINCE_VERSION) {
zdwl_ipc_output_v2_send_scalefactor(ipc_output->resource, zdwl_ipc_output_v2_send_scalefactor(ipc_output->resource,
monitor->wlr_output->scale * 100); monitor->wlr_output->scale * 100);
} }
// 发送帧结束标记
if (event_mask & PRINT_FRAME) {
zdwl_ipc_output_v2_send_frame(ipc_output->resource); zdwl_ipc_output_v2_send_frame(ipc_output->resource);
} }
}
void dwl_ipc_output_set_client_tags(struct wl_client *client, void dwl_ipc_output_set_client_tags(struct wl_client *client,
struct wl_resource *resource, struct wl_resource *resource,
@@ -240,7 +316,7 @@ void dwl_ipc_output_set_client_tags(struct wl_client *client,
if (selmon == monitor) if (selmon == monitor)
focusclient(focustop(monitor), 1); focusclient(focustop(monitor), 1);
arrange(selmon, false); arrange(selmon, false);
printstatus(); printstatus(PRINT_ALL);
} }
void dwl_ipc_output_set_layout(struct wl_client *client, void dwl_ipc_output_set_layout(struct wl_client *client,
@@ -260,7 +336,7 @@ void dwl_ipc_output_set_layout(struct wl_client *client,
monitor->pertag->ltidxs[monitor->pertag->curtag] = &layouts[index]; monitor->pertag->ltidxs[monitor->pertag->curtag] = &layouts[index];
clear_fullscreen_and_maximized_state(monitor); clear_fullscreen_and_maximized_state(monitor);
arrange(monitor, false); arrange(monitor, false);
printstatus(); printstatus(PRINT_ALL);
} }
void dwl_ipc_output_set_tags(struct wl_client *client, void dwl_ipc_output_set_tags(struct wl_client *client,

View File

@@ -181,6 +181,28 @@ enum seat_config_shortcuts_inhibit {
SHORTCUTS_INHIBIT_ENABLE, SHORTCUTS_INHIBIT_ENABLE,
}; };
// 事件掩码枚举
enum print_event_type {
PRINT_ACTIVE = 1 << 0,
PRINT_TAG = 1 << 1,
PRINT_LAYOUT = 1 << 2,
PRINT_TITLE = 1 << 3,
PRINT_APPID = 1 << 4,
PRINT_LAYOUT_SYMBOL = 1 << 5,
PRINT_FULLSCREEN = 1 << 6,
PRINT_FLOATING = 1 << 7,
PRINT_X = 1 << 8,
PRINT_Y = 1 << 9,
PRINT_WIDTH = 1 << 10,
PRINT_HEIGHT = 1 << 11,
PRINT_LAST_LAYER = 1 << 12,
PRINT_KB_LAYOUT = 1 << 13,
PRINT_KEYMODE = 1 << 14,
PRINT_SCALEFACTOR = 1 << 15,
PRINT_FRAME = 1 << 16,
PRINT_ALL = (1 << 17) - 1 // 所有位都设为1
};
typedef struct Pertag Pertag; typedef struct Pertag Pertag;
typedef struct Monitor Monitor; typedef struct Monitor Monitor;
typedef struct Client Client; typedef struct Client Client;
@@ -612,7 +634,7 @@ static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config,
static void outputmgrtest(struct wl_listener *listener, void *data); static void outputmgrtest(struct wl_listener *listener, void *data);
static void pointerfocus(Client *c, struct wlr_surface *surface, double sx, static void pointerfocus(Client *c, struct wlr_surface *surface, double sx,
double sy, unsigned int time); double sy, unsigned int time);
static void printstatus(void); static void printstatus(unsigned int event_mask);
static void quitsignal(int signo); static void quitsignal(int signo);
static void powermgrsetmode(struct wl_listener *listener, void *data); static void powermgrsetmode(struct wl_listener *listener, void *data);
static void rendermon(struct wl_listener *listener, void *data); static void rendermon(struct wl_listener *listener, void *data);
@@ -2148,7 +2170,7 @@ void closemon(Monitor *m) {
} }
if (selmon) { if (selmon) {
focusclient(focustop(selmon), 1); focusclient(focustop(selmon), 1);
printstatus(); printstatus(PRINT_ALL);
} }
} }
@@ -2782,7 +2804,7 @@ void createmon(struct wl_listener *listener, void *data) {
add_workspace_by_tag(i, m); add_workspace_by_tag(i, m);
} }
printstatus(); printstatus(PRINT_ALL);
} }
void // fix for 0.5 void // fix for 0.5
@@ -3238,7 +3260,7 @@ void focusclient(Client *c, int lift) {
client_activate_surface(old_keyboard_focus_surface, 0); client_activate_surface(old_keyboard_focus_surface, 0);
} }
} }
printstatus(); printstatus(PRINT_ALL);
if (!c) { if (!c) {
@@ -3788,7 +3810,7 @@ mapnotify(struct wl_listener *listener, void *data) {
// make sure the animation is open type // make sure the animation is open type
c->is_pending_open_animation = true; c->is_pending_open_animation = true;
resize(c, c->geom, 0); resize(c, c->geom, 0);
printstatus(); printstatus(PRINT_ALL);
} }
void maximizenotify(struct wl_listener *listener, void *data) { void maximizenotify(struct wl_listener *listener, void *data) {
@@ -4143,8 +4165,10 @@ void pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
wlr_seat_pointer_notify_motion(seat, time, sx, sy); wlr_seat_pointer_notify_motion(seat, time, sx, sy);
} }
void printstatus(void) { // 修改printstatus函数,接受掩码参数
wl_signal_emit(&print_status_manager->print_status, NULL); void printstatus(unsigned int event_mask) {
wl_signal_emit(&print_status_manager->print_status,
(void *)(uintptr_t)event_mask);
} }
void powermgrsetmode(struct wl_listener *listener, void *data) { void powermgrsetmode(struct wl_listener *listener, void *data) {
@@ -4405,7 +4429,7 @@ run(char *startup_cmd) {
if (fd_set_nonblock(STDOUT_FILENO) < 0) if (fd_set_nonblock(STDOUT_FILENO) < 0)
close(STDOUT_FILENO); close(STDOUT_FILENO);
printstatus(); printstatus(PRINT_ALL);
/* At this point the outputs are initialized, choose initial selmon /* At this point the outputs are initialized, choose initial selmon
* based on cursor position, and set default cursor image */ * based on cursor position, and set default cursor image */
@@ -4540,7 +4564,7 @@ setfloating(Client *c, int floating) {
arrange(c->mon, false); arrange(c->mon, false);
setborder_color(c); setborder_color(c);
printstatus(); printstatus(PRINT_ALL);
} }
void reset_maximizescreen_size(Client *c) { void reset_maximizescreen_size(Client *c) {
@@ -4880,20 +4904,29 @@ struct mango_print_status_manager *mango_print_status_manager_create() {
return manager; return manager;
} }
// 修改信号处理函数,接收掩码参数
void handle_print_status(struct wl_listener *listener, void *data) { void handle_print_status(struct wl_listener *listener, void *data) {
struct mango_print_status_manager *manager = struct mango_print_status_manager *manager =
wl_container_of(listener, manager, print_status); wl_container_of(listener, manager, print_status);
// struct wlr_print_status *status = data;
uint32_t event_mask = (uintptr_t)data;
// 如果传入的是NULL旧代码或0使用默认的所有事件
if (!event_mask) {
event_mask = PRINT_ALL;
}
Monitor *m = NULL; Monitor *m = NULL;
wl_list_for_each(m, &mons, link) { wl_list_for_each(m, &mons, link) {
if (!m->wlr_output->enabled) { if (!m->wlr_output->enabled) {
continue; continue;
} }
// Update workspace active states // 更新workspace状态(根据掩码决定是否更新)
if (event_mask & PRINT_TAG || event_mask & PRINT_ACTIVE) {
dwl_ext_workspace_printstatus(m); dwl_ext_workspace_printstatus(m);
}
// Update IPC output status // 更新IPC输出状态传入掩码
dwl_ipc_output_printstatus(m); dwl_ipc_output_printstatus(m, event_mask);
} }
} }
@@ -5230,7 +5263,7 @@ void tag_client(const Arg *arg, Client *target_client) {
} }
focusclient(target_client, 1); focusclient(target_client, 1);
printstatus(); printstatus(PRINT_ALL);
} }
void overview(Monitor *m) { grid(m); } void overview(Monitor *m) { grid(m); }
@@ -5438,7 +5471,7 @@ void unmapnotify(struct wl_listener *listener, void *data) {
} }
wlr_scene_node_destroy(&c->scene->node); wlr_scene_node_destroy(&c->scene->node);
printstatus(); printstatus(PRINT_ALL);
motionnotify(0, NULL, 0, 0, 0, 0); motionnotify(0, NULL, 0, 0, 0, 0);
} }
@@ -5586,7 +5619,7 @@ void updatetitle(struct wl_listener *listener, void *data) {
if (title && c->foreign_toplevel) if (title && c->foreign_toplevel)
wlr_foreign_toplevel_handle_v1_set_title(c->foreign_toplevel, title); wlr_foreign_toplevel_handle_v1_set_title(c->foreign_toplevel, title);
if (c == focustop(c->mon)) if (c == focustop(c->mon))
printstatus(); printstatus(PRINT_TITLE);
} }
void // 17 fix to 0.5 void // 17 fix to 0.5
@@ -5606,7 +5639,7 @@ urgent(struct wl_listener *listener, void *data) {
c->isurgent = 1; c->isurgent = 1;
if (client_surface(c)->mapped) if (client_surface(c)->mapped)
setborder_color(c); setborder_color(c);
printstatus(); printstatus(PRINT_ALL);
} }
} }
@@ -5661,7 +5694,7 @@ toggleseltags:
if (changefocus) if (changefocus)
focusclient(focustop(m), 1); focusclient(focustop(m), 1);
arrange(m, want_animation); arrange(m, want_animation);
printstatus(); printstatus(PRINT_ALL);
} }
void view(const Arg *arg, bool want_animation) { void view(const Arg *arg, bool want_animation) {
@@ -5804,7 +5837,7 @@ void activatex11(struct wl_listener *listener, void *data) {
arrange(c->mon, false); arrange(c->mon, false);
} }
printstatus(); printstatus(PRINT_ALL);
} }
void configurex11(struct wl_listener *listener, void *data) { void configurex11(struct wl_listener *listener, void *data) {
@@ -5876,7 +5909,7 @@ void sethints(struct wl_listener *listener, void *data) {
return; return;
c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints); c->isurgent = xcb_icccm_wm_hints_get_urgency(c->surface.xwayland->hints);
printstatus(); printstatus(PRINT_ALL);
if (c->isurgent && surface && surface->mapped) if (c->isurgent && surface && surface->mapped)
setborder_color(c); setborder_color(c);