Merge branch 'master' into feature/multiseat

This commit is contained in:
Tony Crisci 2017-11-05 08:09:45 -05:00
commit b74c4cf974
17 changed files with 314 additions and 130 deletions

View file

@ -119,8 +119,8 @@ void cursor_update_position(struct roots_input *input, uint32_t time) {
if (input->active_view) {
double dx = input->cursor->x - input->offs_x;
double dy = input->cursor->y - input->offs_y;
view_set_position(input->active_view,
input->view_x + dx, input->view_y + dy);
view_move(input->active_view, input->view_x + dx,
input->view_y + dy);
}
break;
case ROOTS_CURSOR_RESIZE:
@ -134,15 +134,19 @@ void cursor_update_position(struct roots_input *input, uint32_t time) {
if (input->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_TOP) {
active_y = input->view_y + dy;
height -= dy;
}
if (input->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_BOTTOM) {
if (height < 0) {
active_y += height;
}
} else if (input->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_BOTTOM) {
height += dy;
}
if (input->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_LEFT) {
active_x = input->view_x + dx;
width -= dx;
}
if (input->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_RIGHT) {
if (width < 0) {
active_x += width;
}
} else if (input->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_RIGHT) {
width += dx;
}
@ -153,12 +157,13 @@ void cursor_update_position(struct roots_input *input, uint32_t time) {
height = 0;
}
// TODO we might need one configure event for this
if (active_x != input->active_view->x ||
active_y != input->active_view->y) {
view_set_position(input->active_view, active_x, active_y);
view_move_resize(input->active_view, active_x, active_y,
width, height);
} else {
view_resize(input->active_view, width, height);
}
view_resize(input->active_view, width, height);
}
break;
case ROOTS_CURSOR_ROTATE: