diff options
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 7370d3b9..3756b628 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -426,17 +426,16 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct | |||
426 | changed_tiling = true; | 426 | changed_tiling = true; |
427 | valid = false; | 427 | valid = false; |
428 | if (view->type != C_WORKSPACE) { | 428 | if (view->type != C_WORKSPACE) { |
429 | if (view->x < pointer_state.tiling.init_view->x) { | 429 | if (get_swayc_in_direction(pointer_state.tiling.init_view, MOVE_LEFT) == view) { |
430 | pointer_state.tiling.lock_pos.x = pointer_state.tiling.init_view->x + 20; | 430 | pointer_state.tiling.lock_pos.x = pointer_state.tiling.init_view->x + 20; |
431 | pointer_state.lock.temp_left = true; | 431 | pointer_state.lock.temp_left = true; |
432 | } else if (view->x > pointer_state.tiling.init_view->x) { | 432 | } else if (get_swayc_in_direction(pointer_state.tiling.init_view, MOVE_RIGHT) == view) { |
433 | pointer_state.tiling.lock_pos.x = pointer_state.tiling.init_view->x + pointer_state.tiling.init_view->width - 20; | 433 | pointer_state.tiling.lock_pos.x = pointer_state.tiling.init_view->x + pointer_state.tiling.init_view->width - 20; |
434 | pointer_state.lock.temp_right = true; | 434 | pointer_state.lock.temp_right = true; |
435 | } | 435 | } else if (get_swayc_in_direction(pointer_state.tiling.init_view, MOVE_UP) == view) { |
436 | if (view->y < pointer_state.tiling.init_view->y) { | ||
437 | pointer_state.tiling.lock_pos.y = pointer_state.tiling.init_view->y + 20; | 436 | pointer_state.tiling.lock_pos.y = pointer_state.tiling.init_view->y + 20; |
438 | pointer_state.lock.temp_up = true; | 437 | pointer_state.lock.temp_up = true; |
439 | } else if (view->y > pointer_state.tiling.init_view->y) { | 438 | } else if (get_swayc_in_direction(pointer_state.tiling.init_view, MOVE_UP) == view) { |
440 | pointer_state.tiling.lock_pos.y = pointer_state.tiling.init_view->y + pointer_state.tiling.init_view->height - 20; | 439 | pointer_state.tiling.lock_pos.y = pointer_state.tiling.init_view->y + pointer_state.tiling.init_view->height - 20; |
441 | pointer_state.lock.temp_down = true; | 440 | pointer_state.lock.temp_down = true; |
442 | } | 441 | } |