swayfx/sway/desktop/desktop.c
Ryan Dwyer be9348d25c 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.
2018-11-17 21:29:42 +10:00

38 lines
1.2 KiB
C

#include "sway/tree/container.h"
#include "sway/desktop.h"
#include "sway/output.h"
void desktop_damage_surface(struct wlr_surface *surface, double lx, double ly,
bool whole) {
for (int i = 0; i < root->outputs->length; ++i) {
struct sway_output *output = root->outputs->items[i];
output_damage_surface(output, lx - output->wlr_output->lx,
ly - output->wlr_output->ly, surface, whole);
}
}
void desktop_damage_whole_container(struct sway_container *con) {
for (int i = 0; i < root->outputs->length; ++i) {
struct sway_output *output = root->outputs->items[i];
output_damage_whole_container(output, con);
}
}
void desktop_damage_box(struct wlr_box *box) {
for (int i = 0; i < root->outputs->length; ++i) {
struct sway_output *output = root->outputs->items[i];
output_damage_box(output, box);
}
}
void desktop_damage_view(struct sway_view *view) {
desktop_damage_whole_container(view->container);
struct wlr_box box = {
.x = view->container->current.content_x - view->geometry.x,
.y = view->container->current.content_y - view->geometry.y,
.width = view->surface->current.width,
.height = view->surface->current.height,
};
desktop_damage_box(&box);
}