Rename OP_MOVE to OP_MOVE_FLOATING

In preparation for introducing OP_MOVE_TILING.
This commit is contained in:
Ryan Dwyer 2018-09-11 16:56:05 +10:00
parent 822b45f483
commit d4e80cf301
6 changed files with 14 additions and 14 deletions

View File

@ -38,7 +38,7 @@ struct sway_drag_icon {
enum sway_seat_operation { enum sway_seat_operation {
OP_NONE, OP_NONE,
OP_DOWN, OP_DOWN,
OP_MOVE, OP_MOVE_FLOATING,
OP_RESIZE_FLOATING, OP_RESIZE_FLOATING,
OP_RESIZE_TILING, OP_RESIZE_TILING,
}; };
@ -172,8 +172,8 @@ void drag_icon_update_position(struct sway_drag_icon *icon);
void seat_begin_down(struct sway_seat *seat, struct sway_container *con, void seat_begin_down(struct sway_seat *seat, struct sway_container *con,
uint32_t button, double sx, double sy); uint32_t button, double sx, double sy);
void seat_begin_move(struct sway_seat *seat, struct sway_container *con, void seat_begin_move_floating(struct sway_seat *seat,
uint32_t button); struct sway_container *con, uint32_t button);
void seat_begin_resize_floating(struct sway_seat *seat, void seat_begin_resize_floating(struct sway_seat *seat,
struct sway_container *con, uint32_t button, enum wlr_edges edge); struct sway_container *con, uint32_t button, enum wlr_edges edge);

View File

@ -333,7 +333,7 @@ static void handle_request_move(struct wl_listener *listener, void *data) {
struct wlr_xdg_toplevel_move_event *e = data; struct wlr_xdg_toplevel_move_event *e = data;
struct sway_seat *seat = e->seat->seat->data; struct sway_seat *seat = e->seat->seat->data;
if (e->serial == seat->last_button_serial) { if (e->serial == seat->last_button_serial) {
seat_begin_move(seat, view->container, seat->last_button); seat_begin_move_floating(seat, view->container, seat->last_button);
} }
} }

View File

@ -330,7 +330,7 @@ static void handle_request_move(struct wl_listener *listener, void *data) {
struct wlr_xdg_toplevel_v6_move_event *e = data; struct wlr_xdg_toplevel_v6_move_event *e = data;
struct sway_seat *seat = e->seat->seat->data; struct sway_seat *seat = e->seat->seat->data;
if (e->serial == seat->last_button_serial) { if (e->serial == seat->last_button_serial) {
seat_begin_move(seat, view->container, seat->last_button); seat_begin_move_floating(seat, view->container, seat->last_button);
} }
} }

View File

@ -449,7 +449,7 @@ static void handle_request_move(struct wl_listener *listener, void *data) {
return; return;
} }
struct sway_seat *seat = input_manager_current_seat(input_manager); struct sway_seat *seat = input_manager_current_seat(input_manager);
seat_begin_move(seat, view->container, seat->last_button); seat_begin_move_floating(seat, view->container, seat->last_button);
} }
static void handle_request_resize(struct wl_listener *listener, void *data) { static void handle_request_resize(struct wl_listener *listener, void *data) {

View File

@ -218,7 +218,7 @@ static void handle_down_motion(struct sway_seat *seat,
seat->op_moved = true; seat->op_moved = true;
} }
static void handle_move_motion(struct sway_seat *seat, static void handle_move_floating_motion(struct sway_seat *seat,
struct sway_cursor *cursor) { struct sway_cursor *cursor) {
struct sway_container *con = seat->op_container; struct sway_container *con = seat->op_container;
desktop_damage_whole_container(con); desktop_damage_whole_container(con);
@ -402,8 +402,8 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
case OP_DOWN: case OP_DOWN:
handle_down_motion(seat, cursor, time_msec); handle_down_motion(seat, cursor, time_msec);
break; break;
case OP_MOVE: case OP_MOVE_FLOATING:
handle_move_motion(seat, cursor); handle_move_floating_motion(seat, cursor);
break; break;
case OP_RESIZE_FLOATING: case OP_RESIZE_FLOATING:
handle_resize_floating_motion(seat, cursor); handle_resize_floating_motion(seat, cursor);
@ -719,7 +719,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
while (cont->parent) { while (cont->parent) {
cont = cont->parent; cont = cont->parent;
} }
seat_begin_move(seat, cont, button); seat_begin_move_floating(seat, cont, button);
return; return;
} }
} }

View File

@ -963,13 +963,13 @@ void seat_begin_down(struct sway_seat *seat, struct sway_container *con,
seat->op_moved = false; seat->op_moved = false;
} }
void seat_begin_move(struct sway_seat *seat, struct sway_container *con, void seat_begin_move_floating(struct sway_seat *seat,
uint32_t button) { struct sway_container *con, uint32_t button) {
if (!seat->cursor) { if (!seat->cursor) {
wlr_log(WLR_DEBUG, "Ignoring move request due to no cursor device"); wlr_log(WLR_DEBUG, "Ignoring move request due to no cursor device");
return; return;
} }
seat->operation = OP_MOVE; seat->operation = OP_MOVE_FLOATING;
seat->op_container = con; seat->op_container = con;
seat->op_button = button; seat->op_button = button;
cursor_set_image(seat->cursor, "grab", NULL); cursor_set_image(seat->cursor, "grab", NULL);
@ -1017,7 +1017,7 @@ void seat_begin_resize_tiling(struct sway_seat *seat,
void seat_end_mouse_operation(struct sway_seat *seat) { void seat_end_mouse_operation(struct sway_seat *seat) {
enum sway_seat_operation operation = seat->operation; enum sway_seat_operation operation = seat->operation;
if (seat->operation == OP_MOVE) { if (seat->operation == OP_MOVE_FLOATING) {
// We "move" the container to its own location so it discovers its // We "move" the container to its own location so it discovers its
// output again. // output again.
struct sway_container *con = seat->op_container; struct sway_container *con = seat->op_container;