mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-22 01:40:22 -05:00
opt: animations logic all use the int type
This commit is contained in:
parent
e5cfd4e4fc
commit
7d019b7032
21 changed files with 835 additions and 820 deletions
|
|
@ -1,4 +1,4 @@
|
|||
int bind_to_view(const Arg *arg) {
|
||||
int32_t bind_to_view(const Arg *arg) {
|
||||
|
||||
uint32_t target = arg->ui;
|
||||
|
||||
|
|
@ -15,14 +15,14 @@ int bind_to_view(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
if ((int)target == INT_MIN && selmon->pertag->curtag == 0) {
|
||||
if ((int32_t)target == INT_MIN && selmon->pertag->curtag == 0) {
|
||||
if (view_current_to_back && selmon->pertag->prevtag)
|
||||
target = 1 << (selmon->pertag->prevtag - 1);
|
||||
else
|
||||
target = 0;
|
||||
}
|
||||
|
||||
if (target == 0 || (int)target == INT_MIN) {
|
||||
if (target == 0 || (int32_t)target == INT_MIN) {
|
||||
view(&(Arg){.ui = ~0 & TAGMASK, .i = arg->i}, false);
|
||||
} else {
|
||||
view(&(Arg){.ui = target, .i = arg->i}, true);
|
||||
|
|
@ -30,7 +30,7 @@ int bind_to_view(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int chvt(const Arg *arg) {
|
||||
int32_t chvt(const Arg *arg) {
|
||||
|
||||
if (selmon) {
|
||||
chvt_backup_tag = selmon->pertag->curtag;
|
||||
|
|
@ -41,7 +41,7 @@ int chvt(const Arg *arg) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int create_virtual_output(const Arg *arg) {
|
||||
int32_t create_virtual_output(const Arg *arg) {
|
||||
|
||||
if (!wlr_backend_is_multi(backend)) {
|
||||
wlr_log(WLR_ERROR, "Expected a multi backend");
|
||||
|
|
@ -61,7 +61,7 @@ int create_virtual_output(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int destroy_all_virtual_output(const Arg *arg) {
|
||||
int32_t destroy_all_virtual_output(const Arg *arg) {
|
||||
|
||||
if (!wlr_backend_is_multi(backend)) {
|
||||
wlr_log(WLR_ERROR, "Expected a multi backend");
|
||||
|
|
@ -80,12 +80,12 @@ int destroy_all_virtual_output(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int defaultgaps(const Arg *arg) {
|
||||
int32_t defaultgaps(const Arg *arg) {
|
||||
setgaps(gappoh, gappov, gappih, gappiv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int exchange_client(const Arg *arg) {
|
||||
int32_t exchange_client(const Arg *arg) {
|
||||
Client *c = selmon->sel;
|
||||
if (!c || c->isfloating)
|
||||
return 0;
|
||||
|
|
@ -97,7 +97,7 @@ int exchange_client(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int exchange_stack_client(const Arg *arg) {
|
||||
int32_t exchange_stack_client(const Arg *arg) {
|
||||
Client *c = selmon->sel;
|
||||
Client *tc = NULL;
|
||||
if (!c || c->isfloating || c->isfullscreen || c->ismaximizescreen)
|
||||
|
|
@ -112,7 +112,7 @@ int exchange_stack_client(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int focusdir(const Arg *arg) {
|
||||
int32_t focusdir(const Arg *arg) {
|
||||
Client *c = NULL;
|
||||
c = direction_select(arg);
|
||||
if (c) {
|
||||
|
|
@ -132,7 +132,7 @@ int focusdir(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int focuslast(const Arg *arg) {
|
||||
int32_t focuslast(const Arg *arg) {
|
||||
|
||||
Client *c = NULL;
|
||||
Client *tc = NULL;
|
||||
|
|
@ -164,7 +164,7 @@ int focuslast(const Arg *arg) {
|
|||
if (!tc || !client_surface(tc)->mapped)
|
||||
return 0;
|
||||
|
||||
if ((int)tc->tags > 0) {
|
||||
if ((int32_t)tc->tags > 0) {
|
||||
focusclient(tc, 1);
|
||||
target = get_tags_first_tag(tc->tags);
|
||||
view(&(Arg){.ui = target}, true);
|
||||
|
|
@ -172,12 +172,12 @@ int focuslast(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int toggle_trackpad_enable(const Arg *arg) {
|
||||
int32_t toggle_trackpad_enable(const Arg *arg) {
|
||||
disable_trackpad = !disable_trackpad;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int focusmon(const Arg *arg) {
|
||||
int32_t focusmon(const Arg *arg) {
|
||||
Client *c = NULL;
|
||||
Monitor *m = NULL;
|
||||
Monitor *tm = NULL;
|
||||
|
|
@ -217,7 +217,7 @@ int focusmon(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int focusstack(const Arg *arg) {
|
||||
int32_t focusstack(const Arg *arg) {
|
||||
/* Focus the next or previous client (in tiling order) on selmon */
|
||||
Client *sel = focustop(selmon);
|
||||
Client *tc = NULL;
|
||||
|
|
@ -240,7 +240,7 @@ int focusstack(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int incnmaster(const Arg *arg) {
|
||||
int32_t incnmaster(const Arg *arg) {
|
||||
if (!arg || !selmon)
|
||||
return 0;
|
||||
selmon->pertag->nmasters[selmon->pertag->curtag] =
|
||||
|
|
@ -249,49 +249,49 @@ int incnmaster(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int incgaps(const Arg *arg) {
|
||||
int32_t incgaps(const Arg *arg) {
|
||||
setgaps(selmon->gappoh + arg->i, selmon->gappov + arg->i,
|
||||
selmon->gappih + arg->i, selmon->gappiv + arg->i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int incigaps(const Arg *arg) {
|
||||
int32_t incigaps(const Arg *arg) {
|
||||
setgaps(selmon->gappoh, selmon->gappov, selmon->gappih + arg->i,
|
||||
selmon->gappiv + arg->i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int incogaps(const Arg *arg) {
|
||||
int32_t incogaps(const Arg *arg) {
|
||||
setgaps(selmon->gappoh + arg->i, selmon->gappov + arg->i, selmon->gappih,
|
||||
selmon->gappiv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int incihgaps(const Arg *arg) {
|
||||
int32_t incihgaps(const Arg *arg) {
|
||||
setgaps(selmon->gappoh, selmon->gappov, selmon->gappih + arg->i,
|
||||
selmon->gappiv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int incivgaps(const Arg *arg) {
|
||||
int32_t incivgaps(const Arg *arg) {
|
||||
setgaps(selmon->gappoh, selmon->gappov, selmon->gappih,
|
||||
selmon->gappiv + arg->i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int incohgaps(const Arg *arg) {
|
||||
int32_t incohgaps(const Arg *arg) {
|
||||
setgaps(selmon->gappoh + arg->i, selmon->gappov, selmon->gappih,
|
||||
selmon->gappiv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int incovgaps(const Arg *arg) {
|
||||
int32_t incovgaps(const Arg *arg) {
|
||||
setgaps(selmon->gappoh, selmon->gappov + arg->i, selmon->gappih,
|
||||
selmon->gappiv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int setmfact(const Arg *arg) {
|
||||
int32_t setmfact(const Arg *arg) {
|
||||
float f;
|
||||
Client *c = NULL;
|
||||
|
||||
|
|
@ -313,7 +313,7 @@ int setmfact(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int killclient(const Arg *arg) {
|
||||
int32_t killclient(const Arg *arg) {
|
||||
Client *c = NULL;
|
||||
c = selmon->sel;
|
||||
if (c) {
|
||||
|
|
@ -322,7 +322,7 @@ int killclient(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int moveresize(const Arg *arg) {
|
||||
int32_t moveresize(const Arg *arg) {
|
||||
if (cursor_mode != CurNormal && cursor_mode != CurPressed)
|
||||
return 0;
|
||||
xytonode(cursor->x, cursor->y, NULL, &grabc, NULL, NULL, NULL);
|
||||
|
|
@ -360,7 +360,7 @@ int moveresize(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int movewin(const Arg *arg) {
|
||||
int32_t movewin(const Arg *arg) {
|
||||
Client *c = NULL;
|
||||
c = selmon->sel;
|
||||
if (!c || c->isfullscreen)
|
||||
|
|
@ -398,15 +398,15 @@ int movewin(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int quit(const Arg *arg) {
|
||||
int32_t quit(const Arg *arg) {
|
||||
wl_display_terminate(dpy);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int resizewin(const Arg *arg) {
|
||||
int32_t resizewin(const Arg *arg) {
|
||||
Client *c = NULL;
|
||||
c = selmon->sel;
|
||||
int offsetx = 0, offsety = 0;
|
||||
int32_t offsetx = 0, offsety = 0;
|
||||
|
||||
if (!c || c->isfullscreen || c->ismaximizescreen)
|
||||
return 0;
|
||||
|
|
@ -469,7 +469,7 @@ int resizewin(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int restore_minimized(const Arg *arg) {
|
||||
int32_t restore_minimized(const Arg *arg) {
|
||||
Client *c = NULL;
|
||||
|
||||
if (selmon && selmon->isoverview)
|
||||
|
|
@ -501,8 +501,8 @@ int restore_minimized(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int setlayout(const Arg *arg) {
|
||||
int jk;
|
||||
int32_t setlayout(const Arg *arg) {
|
||||
int32_t jk;
|
||||
|
||||
for (jk = 0; jk < LENGTH(layouts); jk++) {
|
||||
if (strcmp(layouts[jk].name, arg->v) == 0) {
|
||||
|
|
@ -516,7 +516,7 @@ int setlayout(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int setkeymode(const Arg *arg) {
|
||||
int32_t setkeymode(const Arg *arg) {
|
||||
snprintf(keymode.mode, sizeof(keymode.mode), "%.27s", arg->v);
|
||||
if (strcmp(keymode.mode, "default") == 0) {
|
||||
keymode.isdefault = true;
|
||||
|
|
@ -527,7 +527,7 @@ int setkeymode(const Arg *arg) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int set_proportion(const Arg *arg) {
|
||||
int32_t set_proportion(const Arg *arg) {
|
||||
|
||||
if (selmon->isoverview || !is_scroller_layout(selmon))
|
||||
return 0;
|
||||
|
|
@ -547,10 +547,10 @@ int set_proportion(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int smartmovewin(const Arg *arg) {
|
||||
int32_t smartmovewin(const Arg *arg) {
|
||||
Client *c = NULL, *tc = NULL;
|
||||
int nx, ny;
|
||||
int buttom, top, left, right, tar;
|
||||
int32_t nx, ny;
|
||||
int32_t buttom, top, left, right, tar;
|
||||
c = selmon->sel;
|
||||
if (!c || c->isfullscreen)
|
||||
return 0;
|
||||
|
|
@ -648,10 +648,10 @@ int smartmovewin(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int smartresizewin(const Arg *arg) {
|
||||
int32_t smartresizewin(const Arg *arg) {
|
||||
Client *c = NULL, *tc = NULL;
|
||||
int nw, nh;
|
||||
int buttom, top, left, right, tar;
|
||||
int32_t nw, nh;
|
||||
int32_t buttom, top, left, right, tar;
|
||||
c = selmon->sel;
|
||||
if (!c || c->isfullscreen)
|
||||
return 0;
|
||||
|
|
@ -718,7 +718,7 @@ int smartresizewin(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int centerwin(const Arg *arg) {
|
||||
int32_t centerwin(const Arg *arg) {
|
||||
Client *c = NULL;
|
||||
c = selmon->sel;
|
||||
|
||||
|
|
@ -745,7 +745,7 @@ int centerwin(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int spawn_shell(const Arg *arg) {
|
||||
int32_t spawn_shell(const Arg *arg) {
|
||||
if (!arg->v)
|
||||
return 0;
|
||||
|
||||
|
|
@ -772,7 +772,7 @@ int spawn_shell(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int spawn(const Arg *arg) {
|
||||
int32_t spawn(const Arg *arg) {
|
||||
|
||||
if (!arg->v)
|
||||
return 0;
|
||||
|
|
@ -788,7 +788,7 @@ int spawn(const Arg *arg) {
|
|||
|
||||
// 2. 解析参数
|
||||
char *argv[64];
|
||||
int argc = 0;
|
||||
int32_t argc = 0;
|
||||
char *token = strtok((char *)arg->v, " ");
|
||||
while (token != NULL && argc < 63) {
|
||||
wordexp_t p;
|
||||
|
|
@ -812,7 +812,7 @@ int spawn(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int spawn_on_empty(const Arg *arg) {
|
||||
int32_t spawn_on_empty(const Arg *arg) {
|
||||
bool is_empty = true;
|
||||
Client *c = NULL;
|
||||
|
||||
|
|
@ -832,7 +832,7 @@ int spawn_on_empty(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int switch_keyboard_layout(const Arg *arg) {
|
||||
int32_t switch_keyboard_layout(const Arg *arg) {
|
||||
if (!kb_group || !kb_group->wlr_group || !seat) {
|
||||
wlr_log(WLR_ERROR, "Invalid keyboard group or seat");
|
||||
return 0;
|
||||
|
|
@ -847,7 +847,7 @@ int switch_keyboard_layout(const Arg *arg) {
|
|||
// 1. 获取当前布局和计算下一个布局
|
||||
xkb_layout_index_t current = xkb_state_serialize_layout(
|
||||
keyboard->xkb_state, XKB_STATE_LAYOUT_EFFECTIVE);
|
||||
const int num_layouts = xkb_keymap_num_layouts(keyboard->keymap);
|
||||
const int32_t num_layouts = xkb_keymap_num_layouts(keyboard->keymap);
|
||||
if (num_layouts < 2) {
|
||||
wlr_log(WLR_INFO, "Only one layout available");
|
||||
return 0;
|
||||
|
|
@ -888,9 +888,9 @@ int switch_keyboard_layout(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int switch_layout(const Arg *arg) {
|
||||
int32_t switch_layout(const Arg *arg) {
|
||||
|
||||
int jk, ji;
|
||||
int32_t jk, ji;
|
||||
char *target_layout_name = NULL;
|
||||
uint32_t len;
|
||||
uint32_t target_tag = selmon->pertag->curtag ? selmon->pertag->curtag
|
||||
|
|
@ -943,7 +943,7 @@ int switch_layout(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int switch_proportion_preset(const Arg *arg) {
|
||||
int32_t switch_proportion_preset(const Arg *arg) {
|
||||
float target_proportion = 0;
|
||||
|
||||
if (config.scroller_proportion_preset_count == 0) {
|
||||
|
|
@ -959,7 +959,7 @@ int switch_proportion_preset(const Arg *arg) {
|
|||
|
||||
if (selmon->sel) {
|
||||
|
||||
for (int i = 0; i < config.scroller_proportion_preset_count; i++) {
|
||||
for (int32_t i = 0; i < config.scroller_proportion_preset_count; i++) {
|
||||
if (config.scroller_proportion_preset[i] ==
|
||||
selmon->sel->scroller_proportion) {
|
||||
if (i == config.scroller_proportion_preset_count - 1) {
|
||||
|
|
@ -987,13 +987,13 @@ int switch_proportion_preset(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int tag(const Arg *arg) {
|
||||
int32_t tag(const Arg *arg) {
|
||||
Client *target_client = selmon->sel;
|
||||
tag_client(arg, target_client);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tagmon(const Arg *arg) {
|
||||
int32_t tagmon(const Arg *arg) {
|
||||
Monitor *m = NULL, *cm = NULL;
|
||||
Client *c = focustop(selmon);
|
||||
|
||||
|
|
@ -1037,9 +1037,9 @@ int tagmon(const Arg *arg) {
|
|||
reset_foreign_tolevel(c);
|
||||
|
||||
c->float_geom.width =
|
||||
(int)(c->float_geom.width * c->mon->w.width / selmon->w.width);
|
||||
(int32_t)(c->float_geom.width * c->mon->w.width / selmon->w.width);
|
||||
c->float_geom.height =
|
||||
(int)(c->float_geom.height * c->mon->w.height / selmon->w.height);
|
||||
(int32_t)(c->float_geom.height * c->mon->w.height / selmon->w.height);
|
||||
selmon = c->mon;
|
||||
c->float_geom = setclient_coordinate_center(c, c->float_geom, 0, 0);
|
||||
|
||||
|
|
@ -1064,7 +1064,7 @@ int tagmon(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int tagsilent(const Arg *arg) {
|
||||
int32_t tagsilent(const Arg *arg) {
|
||||
Client *fc = NULL;
|
||||
Client *target_client = NULL;
|
||||
|
||||
|
|
@ -1084,7 +1084,7 @@ int tagsilent(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int tagtoleft(const Arg *arg) {
|
||||
int32_t tagtoleft(const Arg *arg) {
|
||||
if (selmon->sel != NULL &&
|
||||
__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 &&
|
||||
selmon->tagset[selmon->seltags] > 1) {
|
||||
|
|
@ -1093,7 +1093,7 @@ int tagtoleft(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int tagtoright(const Arg *arg) {
|
||||
int32_t tagtoright(const Arg *arg) {
|
||||
if (selmon->sel != NULL &&
|
||||
__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 &&
|
||||
selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
|
||||
|
|
@ -1102,7 +1102,7 @@ int tagtoright(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int toggle_named_scratchpad(const Arg *arg) {
|
||||
int32_t toggle_named_scratchpad(const Arg *arg) {
|
||||
Client *target_client = NULL;
|
||||
char *arg_id = arg->v;
|
||||
char *arg_title = arg->v2;
|
||||
|
|
@ -1121,13 +1121,13 @@ int toggle_named_scratchpad(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int toggle_render_border(const Arg *arg) {
|
||||
int32_t toggle_render_border(const Arg *arg) {
|
||||
render_border = !render_border;
|
||||
arrange(selmon, false, false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int toggle_scratchpad(const Arg *arg) {
|
||||
int32_t toggle_scratchpad(const Arg *arg) {
|
||||
Client *c = NULL;
|
||||
bool hit = false;
|
||||
Client *tmp = NULL;
|
||||
|
|
@ -1156,14 +1156,14 @@ int toggle_scratchpad(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int togglefakefullscreen(const Arg *arg) {
|
||||
int32_t togglefakefullscreen(const Arg *arg) {
|
||||
Client *sel = focustop(selmon);
|
||||
if (sel)
|
||||
setfakefullscreen(sel, !sel->isfakefullscreen);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int togglefloating(const Arg *arg) {
|
||||
int32_t togglefloating(const Arg *arg) {
|
||||
Client *sel = focustop(selmon);
|
||||
|
||||
if (selmon && selmon->isoverview)
|
||||
|
|
@ -1182,7 +1182,7 @@ int togglefloating(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int togglefullscreen(const Arg *arg) {
|
||||
int32_t togglefullscreen(const Arg *arg) {
|
||||
Client *sel = focustop(selmon);
|
||||
if (!sel)
|
||||
return 0;
|
||||
|
|
@ -1198,7 +1198,7 @@ int togglefullscreen(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int toggleglobal(const Arg *arg) {
|
||||
int32_t toggleglobal(const Arg *arg) {
|
||||
if (!selmon->sel)
|
||||
return 0;
|
||||
if (selmon->sel->is_in_scratchpad) {
|
||||
|
|
@ -1214,13 +1214,13 @@ int toggleglobal(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int togglegaps(const Arg *arg) {
|
||||
int32_t togglegaps(const Arg *arg) {
|
||||
enablegaps ^= 1;
|
||||
arrange(selmon, false, false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int togglemaximizescreen(const Arg *arg) {
|
||||
int32_t togglemaximizescreen(const Arg *arg) {
|
||||
Client *sel = focustop(selmon);
|
||||
if (!sel)
|
||||
return 0;
|
||||
|
|
@ -1238,7 +1238,7 @@ int togglemaximizescreen(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int toggleoverlay(const Arg *arg) {
|
||||
int32_t toggleoverlay(const Arg *arg) {
|
||||
if (!selmon->sel || !selmon->sel->mon || selmon->sel->isfullscreen) {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1259,15 +1259,15 @@ int toggleoverlay(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int toggletag(const Arg *arg) {
|
||||
int32_t toggletag(const Arg *arg) {
|
||||
uint32_t newtags;
|
||||
Client *sel = focustop(selmon);
|
||||
if (!sel)
|
||||
return 0;
|
||||
|
||||
if ((int)arg->ui == INT_MIN && sel->tags != (~0 & TAGMASK)) {
|
||||
if ((int32_t)arg->ui == INT_MIN && sel->tags != (~0 & TAGMASK)) {
|
||||
newtags = ~0 & TAGMASK;
|
||||
} else if ((int)arg->ui == INT_MIN && sel->tags == (~0 & TAGMASK)) {
|
||||
} else if ((int32_t)arg->ui == INT_MIN && sel->tags == (~0 & TAGMASK)) {
|
||||
newtags = 1 << (sel->mon->pertag->curtag - 1);
|
||||
} else {
|
||||
newtags = sel->tags ^ (arg->ui & TAGMASK);
|
||||
|
|
@ -1282,7 +1282,7 @@ int toggletag(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int toggleview(const Arg *arg) {
|
||||
int32_t toggleview(const Arg *arg) {
|
||||
uint32_t newtagset;
|
||||
uint32_t target;
|
||||
|
||||
|
|
@ -1300,7 +1300,7 @@ int toggleview(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int viewtoleft(const Arg *arg) {
|
||||
int32_t viewtoleft(const Arg *arg) {
|
||||
uint32_t target = selmon->tagset[selmon->seltags];
|
||||
|
||||
if (selmon->isoverview || selmon->pertag->curtag == 0) {
|
||||
|
|
@ -1320,7 +1320,7 @@ int viewtoleft(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int viewtoright(const Arg *arg) {
|
||||
int32_t viewtoright(const Arg *arg) {
|
||||
if (selmon->isoverview || selmon->pertag->curtag == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1337,7 +1337,7 @@ int viewtoright(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int viewtoleft_have_client(const Arg *arg) {
|
||||
int32_t viewtoleft_have_client(const Arg *arg) {
|
||||
uint32_t n;
|
||||
uint32_t current = get_tags_first_tag_num(selmon->tagset[selmon->seltags]);
|
||||
bool found = false;
|
||||
|
|
@ -1361,7 +1361,7 @@ int viewtoleft_have_client(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int viewtoright_have_client(const Arg *arg) {
|
||||
int32_t viewtoright_have_client(const Arg *arg) {
|
||||
uint32_t n;
|
||||
uint32_t current = get_tags_first_tag_num(selmon->tagset[selmon->seltags]);
|
||||
bool found = false;
|
||||
|
|
@ -1385,13 +1385,13 @@ int viewtoright_have_client(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int viewcrossmon(const Arg *arg) {
|
||||
int32_t viewcrossmon(const Arg *arg) {
|
||||
focusmon(&(Arg){.v = arg->v, .i = UNDIR});
|
||||
view_in_mon(arg, true, selmon, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tagcrossmon(const Arg *arg) {
|
||||
int32_t tagcrossmon(const Arg *arg) {
|
||||
if (!selmon->sel)
|
||||
return 0;
|
||||
|
||||
|
|
@ -1399,7 +1399,7 @@ int tagcrossmon(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int comboview(const Arg *arg) {
|
||||
int32_t comboview(const Arg *arg) {
|
||||
uint32_t newtags = arg->ui & TAGMASK;
|
||||
|
||||
if (!newtags || !selmon)
|
||||
|
|
@ -1418,7 +1418,7 @@ int comboview(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int zoom(const Arg *arg) {
|
||||
int32_t zoom(const Arg *arg) {
|
||||
Client *c = NULL, *sel = focustop(selmon);
|
||||
|
||||
if (!sel || !selmon ||
|
||||
|
|
@ -1451,14 +1451,14 @@ int zoom(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int setoption(const Arg *arg) {
|
||||
int32_t setoption(const Arg *arg) {
|
||||
parse_option(&config, arg->v, arg->v2);
|
||||
override_config();
|
||||
reset_option();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int minimized(const Arg *arg) {
|
||||
int32_t minimized(const Arg *arg) {
|
||||
|
||||
if (selmon && selmon->isoverview)
|
||||
return 0;
|
||||
|
|
@ -1469,7 +1469,7 @@ int minimized(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int toggleoverview(const Arg *arg) {
|
||||
int32_t toggleoverview(const Arg *arg) {
|
||||
Client *c = NULL;
|
||||
|
||||
if (selmon->isoverview && ov_tab_mode && arg->i != 1 && selmon->sel) {
|
||||
|
|
@ -1527,7 +1527,7 @@ int toggleoverview(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int disable_monitor(const Arg *arg) {
|
||||
int32_t disable_monitor(const Arg *arg) {
|
||||
Monitor *m = NULL;
|
||||
struct wlr_output_state state = {0};
|
||||
wl_list_for_each(m, &mons, link) {
|
||||
|
|
@ -1542,7 +1542,7 @@ int disable_monitor(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int enable_monitor(const Arg *arg) {
|
||||
int32_t enable_monitor(const Arg *arg) {
|
||||
Monitor *m = NULL;
|
||||
struct wlr_output_state state = {0};
|
||||
wl_list_for_each(m, &mons, link) {
|
||||
|
|
@ -1557,7 +1557,7 @@ int enable_monitor(const Arg *arg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int toggle_monitor(const Arg *arg) {
|
||||
int32_t toggle_monitor(const Arg *arg) {
|
||||
Monitor *m = NULL;
|
||||
struct wlr_output_state state = {0};
|
||||
wl_list_for_each(m, &mons, link) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue