Implement tiling drag

Hold floating_modifier and drag a tiling view to a new location.
This commit is contained in:
Ryan Dwyer 2018-09-11 21:34:21 +10:00
parent ec9c4de564
commit 8bb40c24c7
10 changed files with 274 additions and 6 deletions

View file

@ -891,6 +891,21 @@ static void render_floating(struct sway_output *soutput,
}
}
static void render_dropzones(struct sway_output *output,
pixman_region32_t *damage) {
struct sway_seat *seat;
wl_list_for_each(seat, &input_manager->seats, link) {
if (seat->operation == OP_MOVE_TILING && seat->op_target_node
&& node_get_output(seat->op_target_node) == output) {
float color[4];
memcpy(&color, config->border_colors.focused.indicator,
sizeof(float) * 4);
premultiply_alpha(color, 0.5);
render_rect(output->wlr_output, damage, &seat->op_drop_box, color);
}
}
}
void output_render(struct sway_output *output, struct timespec *when,
pixman_region32_t *damage) {
struct wlr_output *wlr_output = output->wlr_output;
@ -973,6 +988,8 @@ void output_render(struct sway_output *output, struct timespec *when,
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]);
}
render_dropzones(output, damage);
struct sway_seat *seat = input_manager_current_seat(input_manager);
struct sway_container *focus = seat_get_focused_container(seat);
if (focus && focus->view) {