aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index f418785d..03ed638e 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -772,7 +772,9 @@ void seat_set_focus_warp(struct sway_seat *seat, struct sway_node *node,
772 } 772 }
773 773
774 if (last_focus) { 774 if (last_focus) {
775 if (config->mouse_warping && warp && new_output != last_output) { 775 if (config->mouse_warping && warp &&
776 (new_output != last_output ||
777 config->mouse_warping == WARP_CONTAINER)) {
776 double x = 0; 778 double x = 0;
777 double y = 0; 779 double y = 0;
778 if (container) { 780 if (container) {
@@ -782,9 +784,11 @@ void seat_set_focus_warp(struct sway_seat *seat, struct sway_node *node,
782 x = new_workspace->x + new_workspace->width / 2.0; 784 x = new_workspace->x + new_workspace->width / 2.0;
783 y = new_workspace->y + new_workspace->height / 2.0; 785 y = new_workspace->y + new_workspace->height / 2.0;
784 } 786 }
787
785 if (!wlr_output_layout_contains_point(root->output_layout, 788 if (!wlr_output_layout_contains_point(root->output_layout,
786 new_output->wlr_output, seat->cursor->cursor->x, 789 new_output->wlr_output, seat->cursor->cursor->x,
787 seat->cursor->cursor->y)) { 790 seat->cursor->cursor->y)
791 || config->mouse_warping == WARP_CONTAINER) {
788 wlr_cursor_warp(seat->cursor->cursor, NULL, x, y); 792 wlr_cursor_warp(seat->cursor->cursor, NULL, x, y);
789 cursor_send_pointer_motion(seat->cursor, 0, true); 793 cursor_send_pointer_motion(seat->cursor, 0, true);
790 } 794 }
@@ -1038,7 +1042,7 @@ void seat_begin_down(struct sway_seat *seat, struct sway_container *con,
1038 seat->op_moved = false; 1042 seat->op_moved = false;
1039 1043
1040 // In case the container was not raised by gaining focus, raise on click 1044 // In case the container was not raised by gaining focus, raise on click
1041 if (con && !config->raise_floating) { 1045 if (!config->raise_floating) {
1042 container_raise_floating(con); 1046 container_raise_floating(con);
1043 } 1047 }
1044} 1048}
@@ -1052,6 +1056,12 @@ void seat_begin_move_floating(struct sway_seat *seat,
1052 seat->operation = OP_MOVE_FLOATING; 1056 seat->operation = OP_MOVE_FLOATING;
1053 seat->op_container = con; 1057 seat->op_container = con;
1054 seat->op_button = button; 1058 seat->op_button = button;
1059
1060 // In case the container was not raised by gaining focus, raise on click
1061 if (!config->raise_floating) {
1062 container_raise_floating(con);
1063 }
1064
1055 cursor_set_image(seat->cursor, "grab", NULL); 1065 cursor_set_image(seat->cursor, "grab", NULL);
1056} 1066}
1057 1067
@@ -1085,6 +1095,11 @@ void seat_begin_resize_floating(struct sway_seat *seat,
1085 seat->op_ref_con_ly = con->y; 1095 seat->op_ref_con_ly = con->y;
1086 seat->op_ref_width = con->width; 1096 seat->op_ref_width = con->width;
1087 seat->op_ref_height = con->height; 1097 seat->op_ref_height = con->height;
1098 //
1099 // In case the container was not raised by gaining focus, raise on click
1100 if (!config->raise_floating) {
1101 container_raise_floating(con);
1102 }
1088 1103
1089 const char *image = edge == WLR_EDGE_NONE ? 1104 const char *image = edge == WLR_EDGE_NONE ?
1090 "se-resize" : wlr_xcursor_get_resize_name(edge); 1105 "se-resize" : wlr_xcursor_get_resize_name(edge);