aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-11-17 18:32:03 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-11-17 21:29:42 +1000
commitbe9348d25c9556bdabb83d964a8761f920fc4a11 (patch)
treec06bde3d10e9bfea04acdd9b055cd596f13d4522 /sway/desktop/xwayland.c
parentMerge pull request #3132 from emersion/dispatch-cursor-btn-segfault (diff)
downloadsway-be9348d25c9556bdabb83d964a8761f920fc4a11.tar.gz
sway-be9348d25c9556bdabb83d964a8761f920fc4a11.tar.zst
sway-be9348d25c9556bdabb83d964a8761f920fc4a11.zip
Move view {x,y,width,height} into container struct
This renames/moves the following properties: * sway_view.{x,y,width,height} -> sway_container.content_{x,y,width,height} * This is required to support placeholder containers as they don't have a view. * sway_container_state.view_{x,y,width,height} -> sway_container_state.content_{x,y,width,height} * To remain consistent with the above. * sway_container_state.con_{x,y,width,height} -> sway_container_state.{x,y,width,height} * The con prefix was there to give it contrast from the view properties, and is no longer useful. The function container_set_geometry_from_floating_view has also been renamed to container_set_geometry_from_content.
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 0c41d960..1838ad32 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -332,9 +332,11 @@ static void handle_commit(struct wl_listener *listener, void *data) {
332 } else { 332 } else {
333 struct wlr_box new_geo; 333 struct wlr_box new_geo;
334 get_geometry(view, &new_geo); 334 get_geometry(view, &new_geo);
335 struct sway_container *con = view->container;
335 336
336 if ((new_geo.width != view->width || new_geo.height != view->height) && 337 if ((new_geo.width != con->content_width ||
337 container_is_floating(view->container)) { 338 new_geo.height != con->content_height) &&
339 container_is_floating(con)) {
338 // A floating view has unexpectedly sent a new size 340 // A floating view has unexpectedly sent a new size
339 // eg. The Firefox "Save As" dialog when downloading a file 341 // eg. The Firefox "Save As" dialog when downloading a file
340 desktop_damage_view(view); 342 desktop_damage_view(view);
@@ -432,13 +434,13 @@ static void handle_request_configure(struct wl_listener *listener, void *data) {
432 return; 434 return;
433 } 435 }
434 if (container_is_floating(view->container)) { 436 if (container_is_floating(view->container)) {
435 configure(view, view->container->current.view_x, 437 configure(view, view->container->current.content_x,
436 view->container->current.view_y, ev->width, ev->height); 438 view->container->current.content_y, ev->width, ev->height);
437 } else { 439 } else {
438 configure(view, view->container->current.view_x, 440 configure(view, view->container->current.content_x,
439 view->container->current.view_y, 441 view->container->current.content_y,
440 view->container->current.view_width, 442 view->container->current.content_width,
441 view->container->current.view_height); 443 view->container->current.content_height);
442 } 444 }
443} 445}
444 446