aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-25 09:26:23 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-06-01 23:14:58 +1000
commitaaba7642b3e4e9a63aea49412b10221f399b17af (patch)
tree7e7c2f6fcd80a6a48e07e07e03c5f2dc0d248240 /sway/tree/view.c
parentUse L_FLOATING instead of reapable boolean (diff)
downloadsway-aaba7642b3e4e9a63aea49412b10221f399b17af.tar.gz
sway-aaba7642b3e4e9a63aea49412b10221f399b17af.tar.zst
sway-aaba7642b3e4e9a63aea49412b10221f399b17af.zip
Replace is_floating boolean with function
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 651a2be6..8548d9b8 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -458,7 +458,7 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) {
458 } 458 }
459 // If we're about to launch the view into the floating container, then 459 // If we're about to launch the view into the floating container, then
460 // launch it as a tiled view in the root of the workspace instead. 460 // launch it as a tiled view in the root of the workspace instead.
461 if (focus->is_floating) { 461 if (container_is_floating(focus)) {
462 focus = focus->parent->parent; 462 focus = focus->parent->parent;
463 } 463 }
464 free(criterias); 464 free(criterias);
@@ -531,7 +531,7 @@ void view_unmap(struct sway_view *view) {
531} 531}
532 532
533void view_update_position(struct sway_view *view, double lx, double ly) { 533void view_update_position(struct sway_view *view, double lx, double ly) {
534 if (!view->swayc->is_floating) { 534 if (!container_is_floating(view->swayc)) {
535 return; 535 return;
536 } 536 }
537 container_damage_whole(view->swayc); 537 container_damage_whole(view->swayc);
@@ -548,7 +548,7 @@ void view_update_size(struct sway_view *view, int width, int height) {
548 container_damage_whole(view->swayc); 548 container_damage_whole(view->swayc);
549 view->width = width; 549 view->width = width;
550 view->height = height; 550 view->height = height;
551 if (view->swayc->is_floating) { 551 if (container_is_floating(view->swayc)) {
552 container_set_geometry_from_view(view->swayc); 552 container_set_geometry_from_view(view->swayc);
553 } 553 }
554 container_damage_whole(view->swayc); 554 container_damage_whole(view->swayc);
@@ -904,15 +904,15 @@ bool view_is_visible(struct sway_view *view) {
904 container_parent(view->swayc, C_WORKSPACE); 904 container_parent(view->swayc, C_WORKSPACE);
905 // Determine if view is nested inside a floating container which is sticky. 905 // Determine if view is nested inside a floating container which is sticky.
906 // A simple floating view will have this ancestry: 906 // A simple floating view will have this ancestry:
907 // C_VIEW (is_floating=true) -> floating -> workspace 907 // C_VIEW -> floating -> workspace
908 // A more complex ancestry could be: 908 // A more complex ancestry could be:
909 // C_VIEW -> C_CONTAINER (tabbed and is_floating) -> floating -> workspace 909 // C_VIEW -> C_CONTAINER (tabbed) -> floating -> workspace
910 struct sway_container *floater = view->swayc; 910 struct sway_container *floater = view->swayc;
911 while (floater->parent->type != C_WORKSPACE 911 while (floater->parent->type != C_WORKSPACE
912 && floater->parent->parent->type != C_WORKSPACE) { 912 && floater->parent->parent->type != C_WORKSPACE) {
913 floater = floater->parent; 913 floater = floater->parent;
914 } 914 }
915 bool is_sticky = floater->is_floating && floater->is_sticky; 915 bool is_sticky = container_is_floating(floater) && floater->is_sticky;
916 // Check view isn't in a tabbed or stacked container on an inactive tab 916 // Check view isn't in a tabbed or stacked container on an inactive tab
917 struct sway_seat *seat = input_manager_current_seat(input_manager); 917 struct sway_seat *seat = input_manager_current_seat(input_manager);
918 struct sway_container *container = view->swayc; 918 struct sway_container *container = view->swayc;