diff --git a/src/ext-protocol/ext-workspace.h b/src/ext-protocol/ext-workspace.h index 1f7cc24..ad8f94e 100644 --- a/src/ext-protocol/ext-workspace.h +++ b/src/ext-protocol/ext-workspace.h @@ -86,42 +86,6 @@ static void add_workspace_by_tag(int tag, Monitor *m) { &workspace->activate); } -unsigned int get_tag_status(unsigned int tag, Monitor *m) { - Client *c; - unsigned int status = 0; - wl_list_for_each(c, &clients, link) { - if (c->mon == m && c->tags & 1 << (tag - 1) & TAGMASK) { - if (c->isurgent) { - status = 2; - break; - } - status = 1; - } - } - return status; -} - -unsigned int get_tags_first_tag_num(unsigned int source_tags) { - unsigned int i, tag; - tag = 0; - - if (!source_tags) { - return selmon->pertag->curtag; - } - - for (i = 0; !(tag & 1) && source_tags != 0 && i < LENGTH(tags); i++) { - tag = source_tags >> i; - } - - if (i == 1) { - return 1; - } else if (i > 9) { - return 9; - } else { - return i; - } -} - void dwl_ext_workspace_printstatus(Monitor *m) { struct workspace *w; unsigned int tag_status = 0; diff --git a/src/fetch/monitor.h b/src/fetch/monitor.h index 9058128..d2f3144 100644 --- a/src/fetch/monitor.h +++ b/src/fetch/monitor.h @@ -34,6 +34,42 @@ bool is_scroller_layout(Monitor *m) { return false; } +unsigned int get_tag_status(unsigned int tag, Monitor *m) { + Client *c; + unsigned int status = 0; + wl_list_for_each(c, &clients, link) { + if (c->mon == m && c->tags & 1 << (tag - 1) & TAGMASK) { + if (c->isurgent) { + status = 2; + break; + } + status = 1; + } + } + return status; +} + +unsigned int get_tags_first_tag_num(unsigned int source_tags) { + unsigned int i, tag; + tag = 0; + + if (!source_tags) { + return selmon->pertag->curtag; + } + + for (i = 0; !(tag & 1) && source_tags != 0 && i < LENGTH(tags); i++) { + tag = source_tags >> i; + } + + if (i == 1) { + return 1; + } else if (i > 9) { + return 9; + } else { + return i; + } +} + // 获取tags中最前面的tag的tagmask unsigned int get_tags_first_tag(unsigned int source_tags) { unsigned int i, tag;