diff options
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r-- | sway/input/seat.c | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index d8d2f3a4..60ee27d0 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -640,13 +640,13 @@ void seat_set_raw_focus(struct sway_seat *seat, struct sway_node *node) { | |||
640 | node_set_dirty(node_get_parent(node)); | 640 | node_set_dirty(node_get_parent(node)); |
641 | } | 641 | } |
642 | 642 | ||
643 | void seat_set_focus_warp(struct sway_seat *seat, struct sway_node *node, | 643 | void seat_set_focus(struct sway_seat *seat, struct sway_node *node) { |
644 | bool warp) { | ||
645 | if (seat->focused_layer) { | 644 | if (seat->focused_layer) { |
646 | return; | 645 | return; |
647 | } | 646 | } |
648 | 647 | ||
649 | struct sway_node *last_focus = seat_get_focus(seat); | 648 | struct sway_node *last_focus = seat_get_focus(seat); |
649 | seat->prev_focus = last_focus; | ||
650 | if (last_focus == node) { | 650 | if (last_focus == node) { |
651 | return; | 651 | return; |
652 | } | 652 | } |
@@ -678,8 +678,6 @@ void seat_set_focus_warp(struct sway_seat *seat, struct sway_node *node, | |||
678 | } | 678 | } |
679 | } | 679 | } |
680 | 680 | ||
681 | struct sway_output *last_output = last_workspace ? | ||
682 | last_workspace->output : NULL; | ||
683 | struct sway_output *new_output = new_workspace->output; | 681 | struct sway_output *new_output = new_workspace->output; |
684 | 682 | ||
685 | if (last_workspace != new_workspace && new_output) { | 683 | if (last_workspace != new_workspace && new_output) { |
@@ -774,21 +772,6 @@ void seat_set_focus_warp(struct sway_seat *seat, struct sway_node *node, | |||
774 | workspace_consider_destroy(last_workspace); | 772 | workspace_consider_destroy(last_workspace); |
775 | } | 773 | } |
776 | 774 | ||
777 | if (last_focus && warp) { | ||
778 | if (container && config->mouse_warping == WARP_CONTAINER) { | ||
779 | cursor_warp_to_container(seat->cursor, container); | ||
780 | cursor_send_pointer_motion(seat->cursor, 0, true); | ||
781 | } else if (new_output != last_output && | ||
782 | config->mouse_warping >= WARP_OUTPUT) { | ||
783 | if (container) { | ||
784 | cursor_warp_to_container(seat->cursor, container); | ||
785 | } else { | ||
786 | cursor_warp_to_workspace(seat->cursor, new_workspace); | ||
787 | } | ||
788 | cursor_send_pointer_motion(seat->cursor, 0, true); | ||
789 | } | ||
790 | } | ||
791 | |||
792 | seat->has_focus = true; | 775 | seat->has_focus = true; |
793 | 776 | ||
794 | if (config->smart_gaps) { | 777 | if (config->smart_gaps) { |
@@ -800,18 +783,14 @@ void seat_set_focus_warp(struct sway_seat *seat, struct sway_node *node, | |||
800 | update_debug_tree(); | 783 | update_debug_tree(); |
801 | } | 784 | } |
802 | 785 | ||
803 | void seat_set_focus(struct sway_seat *seat, struct sway_node *node) { | ||
804 | seat_set_focus_warp(seat, node, true); | ||
805 | } | ||
806 | |||
807 | void seat_set_focus_container(struct sway_seat *seat, | 786 | void seat_set_focus_container(struct sway_seat *seat, |
808 | struct sway_container *con) { | 787 | struct sway_container *con) { |
809 | seat_set_focus_warp(seat, con ? &con->node : NULL, true); | 788 | seat_set_focus(seat, con ? &con->node : NULL); |
810 | } | 789 | } |
811 | 790 | ||
812 | void seat_set_focus_workspace(struct sway_seat *seat, | 791 | void seat_set_focus_workspace(struct sway_seat *seat, |
813 | struct sway_workspace *ws) { | 792 | struct sway_workspace *ws) { |
814 | seat_set_focus_warp(seat, ws ? &ws->node : NULL, true); | 793 | seat_set_focus(seat, ws ? &ws->node : NULL); |
815 | } | 794 | } |
816 | 795 | ||
817 | void seat_set_focus_surface(struct sway_seat *seat, | 796 | void seat_set_focus_surface(struct sway_seat *seat, |