Basic maximization implementation for xdg-shell

This commit is contained in:
emersion 2017-11-05 16:29:43 +01:00
parent 74a45ee776
commit 03d3fdc158
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
4 changed files with 87 additions and 2 deletions

View file

@ -39,6 +39,8 @@ static void cursor_set_xcursor_image(struct roots_input *input,
void view_begin_move(struct roots_input *input, struct wlr_cursor *cursor,
struct roots_view *view) {
view_maximize(view, false);
input->mode = ROOTS_CURSOR_MOVE;
input->offs_x = cursor->x;
input->offs_y = cursor->y;
@ -54,6 +56,8 @@ 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, uint32_t edges) {
view_maximize(view, false);
input->mode = ROOTS_CURSOR_RESIZE;
input->offs_x = cursor->x;
input->offs_y = cursor->y;
@ -74,6 +78,8 @@ void view_begin_resize(struct roots_input *input, struct wlr_cursor *cursor,
void view_begin_rotate(struct roots_input *input, struct wlr_cursor *cursor,
struct roots_view *view) {
view_maximize(view, false);
input->mode = ROOTS_CURSOR_ROTATE;
input->offs_x = cursor->x;
input->offs_y = cursor->y;
@ -102,7 +108,8 @@ void cursor_update_position(struct roots_input *input, uint32_t time) {
set_compositor_cursor = view_client != input->cursor_client;
}
if (set_compositor_cursor) {
struct wlr_xcursor *xcursor = get_default_xcursor(input->xcursor_theme);
struct wlr_xcursor *xcursor =
get_default_xcursor(input->xcursor_theme);
cursor_set_xcursor_image(input, xcursor->images[0]);
input->cursor_client = NULL;
}