Implement tiling_drag_threshold

Implements `tiling_drag_threshold <threshold>` to prevent accidental
dragging of tiling containers. If a container (and all of its
descendants) are unfocused and the tile bar is pressed, a threshold
will be used before actually starting the drag. Once the threshold has
been exceeded, the cursor will change to the grab icon and the operation
will switch from `OP_MOVE_TILING_THRESHOLD` to `OP_MOVE_TILING`.
This commit is contained in:
Brian Ashworth 2019-01-01 08:45:21 -05:00 committed by emersion
parent a96e86744f
commit 5bf4daf263
10 changed files with 91 additions and 2 deletions

View file

@ -1052,6 +1052,17 @@ void seat_begin_move_floating(struct sway_seat *seat,
cursor_set_image(seat->cursor, "grab", NULL);
}
void seat_begin_move_tiling_threshold(struct sway_seat *seat,
struct sway_container *con, uint32_t button) {
seat->operation = OP_MOVE_TILING_THRESHOLD;
seat->op_container = con;
seat->op_button = button;
seat->op_target_node = NULL;
seat->op_target_edge = 0;
seat->op_ref_lx = seat->cursor->cursor->x;
seat->op_ref_ly = seat->cursor->cursor->y;
}
void seat_begin_move_tiling(struct sway_seat *seat,
struct sway_container *con, uint32_t button) {
seat->operation = OP_MOVE_TILING;