aboutsummaryrefslogtreecommitdiff
path: root/rootston/seat.c
diff options
context:
space:
mode:
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..559a8b7f 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_cancel_transform(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;
+}