aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-11-17 11:04:34 -0500
committerLibravatar GitHub <noreply@github.com>2018-11-17 11:04:34 -0500
commiteda3bfeed5097c71634332bfe998188b028abf02 (patch)
treea5fb241142cf6815a8fce76eb9b5faf101d69ff9 /sway/input/cursor.c
parentMerge pull request #3143 from colemickens/grow (diff)
parentMove view {x,y,width,height} into container struct (diff)
downloadsway-eda3bfeed5097c71634332bfe998188b028abf02.tar.gz
sway-eda3bfeed5097c71634332bfe998188b028abf02.tar.zst
sway-eda3bfeed5097c71634332bfe998188b028abf02.zip
Merge pull request #3142 from RyanDwyer/move-view-properties
Move view {x,y,width,height} into container struct
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 81b82abc..c81e9ab1 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -348,7 +348,7 @@ static void handle_move_tiling_motion(struct sway_seat *seat,
348 } 348 }
349 349
350 // Find the closest edge 350 // Find the closest edge
351 size_t thickness = fmin(con->view->width, con->view->height) * 0.3; 351 size_t thickness = fmin(con->content_width, con->content_height) * 0.3;
352 size_t closest_dist = INT_MAX; 352 size_t closest_dist = INT_MAX;
353 size_t dist; 353 size_t dist;
354 seat->op_target_edge = WLR_EDGE_NONE; 354 seat->op_target_edge = WLR_EDGE_NONE;
@@ -374,10 +374,10 @@ static void handle_move_tiling_motion(struct sway_seat *seat,
374 } 374 }
375 375
376 seat->op_target_node = node; 376 seat->op_target_node = node;
377 seat->op_drop_box.x = con->view->x; 377 seat->op_drop_box.x = con->content_x;
378 seat->op_drop_box.y = con->view->y; 378 seat->op_drop_box.y = con->content_y;
379 seat->op_drop_box.width = con->view->width; 379 seat->op_drop_box.width = con->content_width;
380 seat->op_drop_box.height = con->view->height; 380 seat->op_drop_box.height = con->content_height;
381 resize_box(&seat->op_drop_box, seat->op_target_edge, thickness); 381 resize_box(&seat->op_drop_box, seat->op_target_edge, thickness);
382 desktop_damage_box(&seat->op_drop_box); 382 desktop_damage_box(&seat->op_drop_box);
383} 383}
@@ -498,13 +498,10 @@ static void handle_resize_floating_motion(struct sway_seat *seat,
498 con->width += relative_grow_width; 498 con->width += relative_grow_width;
499 con->height += relative_grow_height; 499 con->height += relative_grow_height;
500 500
501 if (con->view) { 501 con->content_x += relative_grow_x;
502 struct sway_view *view = con->view; 502 con->content_y += relative_grow_y;
503 view->x += relative_grow_x; 503 con->content_width += relative_grow_width;
504 view->y += relative_grow_y; 504 con->content_height += relative_grow_height;
505 view->width += relative_grow_width;
506 view->height += relative_grow_height;
507 }
508 505
509 arrange_container(con); 506 arrange_container(con);
510} 507}