mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
feat: add comboview dispatch
This commit is contained in:
parent
6947ed3d3c
commit
2a11357ead
4 changed files with 24 additions and 0 deletions
|
|
@ -836,6 +836,9 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
|
||||||
} else if (strcmp(func_name, "toggleview") == 0) {
|
} else if (strcmp(func_name, "toggleview") == 0) {
|
||||||
func = toggleview;
|
func = toggleview;
|
||||||
(*arg).ui = 1 << (atoi(arg_value) - 1);
|
(*arg).ui = 1 << (atoi(arg_value) - 1);
|
||||||
|
} else if (strcmp(func_name, "comboview") == 0) {
|
||||||
|
func = comboview;
|
||||||
|
(*arg).ui = 1 << (atoi(arg_value) - 1);
|
||||||
} else if (strcmp(func_name, "smartmovewin") == 0) {
|
} else if (strcmp(func_name, "smartmovewin") == 0) {
|
||||||
func = smartmovewin;
|
func = smartmovewin;
|
||||||
(*arg).i = parse_direction(arg_value);
|
(*arg).i = parse_direction(arg_value);
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ void bind_to_view(const Arg *arg);
|
||||||
void toggletag(const Arg *arg);
|
void toggletag(const Arg *arg);
|
||||||
void toggleview(const Arg *arg);
|
void toggleview(const Arg *arg);
|
||||||
void tag(const Arg *arg);
|
void tag(const Arg *arg);
|
||||||
|
void comboview(const Arg *arg);
|
||||||
void incgaps(const Arg *arg);
|
void incgaps(const Arg *arg);
|
||||||
void incigaps(const Arg *arg);
|
void incigaps(const Arg *arg);
|
||||||
void incihgaps(const Arg *arg);
|
void incihgaps(const Arg *arg);
|
||||||
|
|
|
||||||
|
|
@ -1280,6 +1280,22 @@ void viewtoright_have_client(const Arg *arg) {
|
||||||
view(&(Arg){.ui = (1 << (n - 1)) & TAGMASK, .i = arg->i}, true);
|
view(&(Arg){.ui = (1 << (n - 1)) & TAGMASK, .i = arg->i}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void comboview(const Arg *arg) {
|
||||||
|
uint32_t newtags = arg->ui & TAGMASK;
|
||||||
|
if (!newtags || !selmon)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (tag_combo)
|
||||||
|
selmon->tagset[selmon->seltags] |= newtags;
|
||||||
|
else {
|
||||||
|
tag_combo = true;
|
||||||
|
selmon->tagset[selmon->seltags] = newtags;
|
||||||
|
}
|
||||||
|
focusclient(focustop(selmon), 1);
|
||||||
|
arrange(selmon, false);
|
||||||
|
printstatus();
|
||||||
|
}
|
||||||
|
|
||||||
void zoom(const Arg *arg) {
|
void zoom(const Arg *arg) {
|
||||||
Client *c, *sel = focustop(selmon);
|
Client *c, *sel = focustop(selmon);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -784,6 +784,8 @@ struct dvec2 *baked_points_close;
|
||||||
|
|
||||||
static struct wl_event_source *hide_source;
|
static struct wl_event_source *hide_source;
|
||||||
static bool cursor_hidden = false;
|
static bool cursor_hidden = false;
|
||||||
|
static bool tag_combo = false;
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
enum wp_cursor_shape_device_v1_shape shape;
|
enum wp_cursor_shape_device_v1_shape shape;
|
||||||
struct wlr_surface *surface;
|
struct wlr_surface *surface;
|
||||||
|
|
@ -3323,6 +3325,8 @@ void keypress(struct wl_listener *listener, void *data) {
|
||||||
if (!locked && event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
if (!locked && event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
|
||||||
for (i = 0; i < nsyms; i++)
|
for (i = 0; i < nsyms; i++)
|
||||||
handled = keybinding(mods, syms[i], keycode) || handled;
|
handled = keybinding(mods, syms[i], keycode) || handled;
|
||||||
|
} else if (event->state == WL_KEYBOARD_KEY_STATE_RELEASED) {
|
||||||
|
tag_combo = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handled && group->wlr_group->keyboard.repeat_info.delay > 0) {
|
if (handled && group->wlr_group->keyboard.repeat_info.delay > 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue