aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-26 16:26:10 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-06-01 23:14:58 +1000
commite4e912ea91a5a36d9f17c1730ffbf29707984399 (patch)
tree7efb328eeabe0154294e6ef4fee216590df04c9c /sway/input/cursor.c
parentAdd L_FLOATING back to debug tree (diff)
downloadsway-e4e912ea91a5a36d9f17c1730ffbf29707984399.tar.gz
sway-e4e912ea91a5a36d9f17c1730ffbf29707984399.tar.zst
sway-e4e912ea91a5a36d9f17c1730ffbf29707984399.zip
Store swayc coordinates as layout-local
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 96bf574c..16e5427b 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -46,7 +46,7 @@ static struct wlr_surface *layer_surface_at(struct sway_output *output,
46 * location, it is stored in **surface (it may not be a view). 46 * location, it is stored in **surface (it may not be a view).
47 */ 47 */
48static struct sway_container *container_at_coords( 48static struct sway_container *container_at_coords(
49 struct sway_seat *seat, double x, double y, 49 struct sway_seat *seat, double lx, double ly,
50 struct wlr_surface **surface, double *sx, double *sy) { 50 struct wlr_surface **surface, double *sx, double *sy) {
51 // check for unmanaged views first 51 // check for unmanaged views first
52 struct wl_list *unmanaged = &root_container.sway_root->xwayland_unmanaged; 52 struct wl_list *unmanaged = &root_container.sway_root->xwayland_unmanaged;
@@ -55,8 +55,8 @@ static struct sway_container *container_at_coords(
55 struct wlr_xwayland_surface *xsurface = 55 struct wlr_xwayland_surface *xsurface =
56 unmanaged_surface->wlr_xwayland_surface; 56 unmanaged_surface->wlr_xwayland_surface;
57 57
58 double _sx = x - unmanaged_surface->lx; 58 double _sx = lx - unmanaged_surface->lx;
59 double _sy = y - unmanaged_surface->ly; 59 double _sy = ly - unmanaged_surface->ly;
60 if (wlr_surface_point_accepts_input(xsurface->surface, _sx, _sy)) { 60 if (wlr_surface_point_accepts_input(xsurface->surface, _sx, _sy)) {
61 *surface = xsurface->surface; 61 *surface = xsurface->surface;
62 *sx = _sx; 62 *sx = _sx;
@@ -69,12 +69,12 @@ static struct sway_container *container_at_coords(
69 struct wlr_output_layout *output_layout = 69 struct wlr_output_layout *output_layout =
70 root_container.sway_root->output_layout; 70 root_container.sway_root->output_layout;
71 struct wlr_output *wlr_output = wlr_output_layout_output_at( 71 struct wlr_output *wlr_output = wlr_output_layout_output_at(
72 output_layout, x, y); 72 output_layout, lx, ly);
73 if (wlr_output == NULL) { 73 if (wlr_output == NULL) {
74 return NULL; 74 return NULL;
75 } 75 }
76 struct sway_output *output = wlr_output->data; 76 struct sway_output *output = wlr_output->data;
77 double ox = x, oy = y; 77 double ox = lx, oy = ly;
78 wlr_output_layout_output_coords(output_layout, wlr_output, &ox, &oy); 78 wlr_output_layout_output_coords(output_layout, wlr_output, &ox, &oy);
79 79
80 // find the focused workspace on the output for this seat 80 // find the focused workspace on the output for this seat
@@ -108,10 +108,10 @@ static struct sway_container *container_at_coords(
108 } 108 }
109 109
110 struct sway_container *c; 110 struct sway_container *c;
111 if ((c = floating_container_at(x, y, surface, sx, sy))) { 111 if ((c = floating_container_at(lx, ly, surface, sx, sy))) {
112 return c; 112 return c;
113 } 113 }
114 if ((c = container_at(ws, ox, oy, surface, sx, sy))) { 114 if ((c = container_at(ws, lx, ly, surface, sx, sy))) {
115 return c; 115 return c;
116 } 116 }
117 117