mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-19 06:59:48 -05:00
Add view_resize
This commit is contained in:
parent
97679b8e12
commit
33a97576ca
5 changed files with 30 additions and 8 deletions
|
|
@ -30,10 +30,12 @@ void view_begin_move(struct roots_input *input, struct wlr_cursor *cursor,
|
|||
}
|
||||
|
||||
void view_begin_resize(struct roots_input *input, struct wlr_cursor *cursor,
|
||||
struct roots_view *view) {
|
||||
struct roots_view *view, uint32_t edges) {
|
||||
input->mode = ROOTS_CURSOR_RESIZE;
|
||||
input->offs_x = cursor->x - view->x;
|
||||
input->offs_y = cursor->y - view->y;
|
||||
wlr_log(L_DEBUG, "begin resize");
|
||||
input->offs_x = cursor->x - (double)view->wlr_surface->current.width - view->x;
|
||||
input->offs_y = cursor->y - (double)view->wlr_surface->current.height - view->y;
|
||||
input->resize_edges = edges;
|
||||
wlr_seat_pointer_clear_focus(input->wl_seat);
|
||||
}
|
||||
|
||||
|
|
@ -61,9 +63,11 @@ void cursor_update_position(struct roots_input *input, uint32_t time) {
|
|||
}
|
||||
break;
|
||||
case ROOTS_CURSOR_RESIZE:
|
||||
// TODO: this is just for testing
|
||||
if (input->active_view && input->active_view->type == ROOTS_XDG_SHELL_V6_VIEW) {
|
||||
wlr_xdg_toplevel_v6_set_size(input->active_view->xdg_surface_v6, input->cursor->x - input->offs_x, input->cursor->y - input->offs_y);
|
||||
if (input->active_view) {
|
||||
// TODO: edges
|
||||
uint32_t width = input->cursor->x - input->offs_x;
|
||||
uint32_t height = input->cursor->y - input->offs_y;
|
||||
view_resize(input->active_view, width, height);
|
||||
}
|
||||
break;
|
||||
case ROOTS_CURSOR_ROTATE:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue