aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seatop_move_floating.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/seatop_move_floating.c')
-rw-r--r--sway/input/seatop_move_floating.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sway/input/seatop_move_floating.c b/sway/input/seatop_move_floating.c
index 7f501fc9..83668d88 100644
--- a/sway/input/seatop_move_floating.c
+++ b/sway/input/seatop_move_floating.c
@@ -1,6 +1,5 @@
1#define _POSIX_C_SOURCE 200809L
2#include <wlr/types/wlr_cursor.h> 1#include <wlr/types/wlr_cursor.h>
3#include "sway/desktop.h" 2#include "sway/desktop/transaction.h"
4#include "sway/input/cursor.h" 3#include "sway/input/cursor.h"
5#include "sway/input/seat.h" 4#include "sway/input/seat.h"
6 5
@@ -14,14 +13,15 @@ static void finalize_move(struct sway_seat *seat) {
14 13
15 // We "move" the container to its own location 14 // We "move" the container to its own location
16 // so it discovers its output again. 15 // so it discovers its output again.
17 container_floating_move_to(e->con, e->con->x, e->con->y); 16 container_floating_move_to(e->con, e->con->pending.x, e->con->pending.y);
17 transaction_commit_dirty();
18 18
19 seatop_begin_default(seat); 19 seatop_begin_default(seat);
20} 20}
21 21
22static void handle_button(struct sway_seat *seat, uint32_t time_msec, 22static void handle_button(struct sway_seat *seat, uint32_t time_msec,
23 struct wlr_input_device *device, uint32_t button, 23 struct wlr_input_device *device, uint32_t button,
24 enum wlr_button_state state) { 24 enum wl_pointer_button_state state) {
25 if (seat->cursor->pressed_button_count == 0) { 25 if (seat->cursor->pressed_button_count == 0) {
26 finalize_move(seat); 26 finalize_move(seat);
27 } 27 }
@@ -37,9 +37,8 @@ static void handle_tablet_tool_tip(struct sway_seat *seat,
37static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) { 37static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) {
38 struct seatop_move_floating_event *e = seat->seatop_data; 38 struct seatop_move_floating_event *e = seat->seatop_data;
39 struct wlr_cursor *cursor = seat->cursor->cursor; 39 struct wlr_cursor *cursor = seat->cursor->cursor;
40 desktop_damage_whole_container(e->con);
41 container_floating_move_to(e->con, cursor->x - e->dx, cursor->y - e->dy); 40 container_floating_move_to(e->con, cursor->x - e->dx, cursor->y - e->dy);
42 desktop_damage_whole_container(e->con); 41 transaction_commit_dirty();
43} 42}
44 43
45static void handle_unref(struct sway_seat *seat, struct sway_container *con) { 44static void handle_unref(struct sway_seat *seat, struct sway_container *con) {
@@ -67,13 +66,14 @@ void seatop_begin_move_floating(struct sway_seat *seat,
67 return; 66 return;
68 } 67 }
69 e->con = con; 68 e->con = con;
70 e->dx = cursor->cursor->x - con->x; 69 e->dx = cursor->cursor->x - con->pending.x;
71 e->dy = cursor->cursor->y - con->y; 70 e->dy = cursor->cursor->y - con->pending.y;
72 71
73 seat->seatop_impl = &seatop_impl; 72 seat->seatop_impl = &seatop_impl;
74 seat->seatop_data = e; 73 seat->seatop_data = e;
75 74
76 container_raise_floating(con); 75 container_raise_floating(con);
76 transaction_commit_dirty();
77 77
78 cursor_set_image(cursor, "grab", NULL); 78 cursor_set_image(cursor, "grab", NULL);
79 wlr_seat_pointer_notify_clear_focus(seat->wlr_seat); 79 wlr_seat_pointer_notify_clear_focus(seat->wlr_seat);