Compare commits
2 Commits
9fbd7f45e9
...
4ccdc9c23d
| Author | SHA1 | Date | |
|---|---|---|---|
|
4ccdc9c23d
|
|||
|
ac4cfc1ed3
|
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}},
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "xcursor.h"
|
#include "xcursor.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <xcb/xcb.h>
|
||||||
#include <xcb/xcb_cursor.h>
|
#include <xcb/xcb_cursor.h>
|
||||||
#include <xcb/xproto.h>
|
#include <xcb/xproto.h>
|
||||||
|
|
||||||
@@ -143,4 +144,5 @@ void xcursor_set_pointer_position(point_t point) {
|
|||||||
xcb_window_t window = XCB_WINDOW_NONE;
|
xcb_window_t window = XCB_WINDOW_NONE;
|
||||||
xcb_window_t root = wm.screen->root;
|
xcb_window_t root = wm.screen->root;
|
||||||
xcb_warp_pointer(wm.xcb_conn, window, root, 0, 0, 1, 1, point.x, point.y);
|
xcb_warp_pointer(wm.xcb_conn, window, root, 0, 0, 1, 1, point.x, point.y);
|
||||||
|
xcb_flush(wm.xcb_conn);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user