feat: 添加 focus_next_monitor 操作用于切换当前 monitor
This commit is contained in:
10
src/action.c
10
src/action.c
@@ -43,6 +43,16 @@ void send_client_to_next_monitor(const user_action_arg_t *arg) {
|
|||||||
client_send_to_monitor(wm.client_focused, next_monitor);
|
client_send_to_monitor(wm.client_focused, next_monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void focus_next_monitor(const user_action_arg_t *arg) {
|
||||||
|
monitor_t *next_monitor = wm_get_next_monitor(wm.current_monitor);
|
||||||
|
if (next_monitor == wm.current_monitor) return;
|
||||||
|
|
||||||
|
wm_set_current_monitor(next_monitor, true);
|
||||||
|
if (wm.current_monitor->selected_tag->task_list) {
|
||||||
|
monitor_deal_focus(wm.current_monitor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void spawn(const user_action_arg_t *arg) {
|
void spawn(const user_action_arg_t *arg) {
|
||||||
const char *cmd = (const char *)arg->ptr;
|
const char *cmd = (const char *)arg->ptr;
|
||||||
if (cmd == nullptr || strlen(cmd) == 0) return;
|
if (cmd == nullptr || strlen(cmd) == 0) return;
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ void focus_client_in_same_tag(const user_action_arg_t *arg);
|
|||||||
void select_tag_of_current_monitor(const user_action_arg_t *arg);
|
void select_tag_of_current_monitor(const user_action_arg_t *arg);
|
||||||
void send_client_to_tag(const user_action_arg_t *arg);
|
void send_client_to_tag(const user_action_arg_t *arg);
|
||||||
void send_client_to_next_monitor(const user_action_arg_t *arg);
|
void send_client_to_next_monitor(const user_action_arg_t *arg);
|
||||||
|
void focus_next_monitor(const user_action_arg_t *arg);
|
||||||
void spawn(const user_action_arg_t *arg);
|
void spawn(const user_action_arg_t *arg);
|
||||||
void quit(const user_action_arg_t *arg);
|
void quit(const user_action_arg_t *arg);
|
||||||
void raise_or_run(const user_action_arg_t *arg);
|
void raise_or_run(const user_action_arg_t *arg);
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ static const keyboard_t key_list[] = {
|
|||||||
|
|
||||||
{modifier_super, XK_o, send_client_to_next_monitor, {0}},
|
{modifier_super, XK_o, send_client_to_next_monitor, {0}},
|
||||||
|
|
||||||
|
{modifier_super | modifier_control, XK_j, focus_next_monitor, {0}},
|
||||||
{modifier_super | modifier_control, XK_space, toggle_client_floating, {0}},
|
{modifier_super | modifier_control, XK_space, toggle_client_floating, {0}},
|
||||||
{modifier_super, XK_f, toggle_client_fullscreen, {0}},
|
{modifier_super, XK_f, toggle_client_fullscreen, {0}},
|
||||||
{modifier_super, XK_m, toggle_client_maximize, {0}},
|
{modifier_super, XK_m, toggle_client_maximize, {0}},
|
||||||
|
|||||||
Reference in New Issue
Block a user