aboutsummaryrefslogtreecommitdiff
path: root/rootston/seat.c
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-02-08 13:38:50 -0500
committerGitHub <noreply@github.com>2018-02-08 13:38:50 -0500
commit09c2626e32fd0eadc4b95a4f36b34f6bde79f6f4 (patch)
treeac3cf204cecb11f8faec7f477dc17cb6f90a2517 /rootston/seat.c
parent78dc0c7de13c19257c6f186f9d7cf1d211c310e8 (diff)
parent74264d4f6243fc8ff87e66faf1940d3dd9d5b501 (diff)
Merge pull request #609 from VincentVanlaer/cancel-grab
Cancel rootson move/resize/rotate on escape
Diffstat (limited to 'rootston/seat.c')
-rw-r--r--rootston/seat.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/rootston/seat.c b/rootston/seat.c
index d7353d1e..edb98095 100644
--- a/rootston/seat.c
+++ b/rootston/seat.c
@@ -778,3 +778,28 @@ void roots_seat_begin_rotate(struct roots_seat *seat, struct roots_view *view) {
wlr_xcursor_manager_set_cursor_image(seat->cursor->xcursor_manager,
ROOTS_XCURSOR_ROTATE, seat->cursor->cursor);
}
+
+void roots_seat_end_compositor_grab(struct roots_seat *seat) {
+ struct roots_cursor *cursor = seat->cursor;
+ struct roots_view *view = roots_seat_get_focus(seat);
+
+ if (view == NULL) {
+ return;
+ }
+
+ switch(cursor->mode) {
+ case ROOTS_CURSOR_MOVE:
+ view_move(view, cursor->view_x, cursor->view_y);
+ break;
+ case ROOTS_CURSOR_RESIZE:
+ view_move_resize(view, cursor->view_x, cursor->view_y, cursor->view_width, cursor->view_height);
+ break;
+ case ROOTS_CURSOR_ROTATE:
+ view->rotation = cursor->view_rotation;
+ break;
+ case ROOTS_CURSOR_PASSTHROUGH:
+ break;
+ }
+
+ cursor->mode = ROOTS_CURSOR_PASSTHROUGH;
+}