aboutsummaryrefslogtreecommitdiff
path: root/rootston/seat.c
diff options
context:
space:
mode:
Diffstat (limited to 'rootston/seat.c')
-rw-r--r--rootston/seat.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/rootston/seat.c b/rootston/seat.c
index d7353d1e..a97f66ba 100644
--- a/rootston/seat.c
+++ b/rootston/seat.c
@@ -738,6 +738,18 @@ void roots_seat_begin_move(struct roots_seat *seat, struct roots_view *view) {
ROOTS_XCURSOR_MOVE, seat->cursor->cursor);
}
+void roots_seat_cancel_move(struct roots_seat *seat) {
+ struct roots_cursor *cursor = seat->cursor;
+ struct roots_view *view = roots_seat_get_focus(seat);
+
+ if (cursor->mode != ROOTS_CURSOR_MOVE || view == NULL) {
+ return;
+ }
+
+ cursor->mode = ROOTS_CURSOR_PASSTHROUGH;
+ view_move(view, cursor->view_x, cursor->view_y);
+}
+
void roots_seat_begin_resize(struct roots_seat *seat, struct roots_view *view,
uint32_t edges) {
struct roots_cursor *cursor = seat->cursor;
@@ -766,6 +778,18 @@ void roots_seat_begin_resize(struct roots_seat *seat, struct roots_view *view,
resize_name, seat->cursor->cursor);
}
+void roots_seat_cancel_resize(struct roots_seat *seat) {
+ struct roots_cursor *cursor = seat->cursor;
+ struct roots_view *view = roots_seat_get_focus(seat);
+
+ if (cursor->mode != ROOTS_CURSOR_RESIZE || view == NULL) {
+ return;
+ }
+
+ cursor->mode = ROOTS_CURSOR_PASSTHROUGH;
+ view_move_resize(view, cursor->view_x, cursor->view_y, cursor->view_width, cursor->view_height);
+}
+
void roots_seat_begin_rotate(struct roots_seat *seat, struct roots_view *view) {
struct roots_cursor *cursor = seat->cursor;
cursor->mode = ROOTS_CURSOR_ROTATE;
@@ -778,3 +802,15 @@ 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_rotate(struct roots_seat *seat) {
+ struct roots_cursor *cursor = seat->cursor;
+ struct roots_view *view = roots_seat_get_focus(seat);
+
+ if (cursor->mode != ROOTS_CURSOR_ROTATE || view == NULL) {
+ return;
+ }
+
+ cursor->mode = ROOTS_CURSOR_PASSTHROUGH;
+ view->rotation = cursor->view_rotation;
+}