mirror of
https://github.com/swaywm/sway.git
synced 2026-04-22 06:46:27 -04:00
Delete old damage tracking code
The new scene graph abstraction handles this for us.
This commit is contained in:
parent
3616f804c2
commit
1a09cfd95d
21 changed files with 0 additions and 455 deletions
|
|
@ -1,13 +0,0 @@
|
|||
#include <wlr/types/wlr_compositor.h>
|
||||
|
||||
struct sway_container;
|
||||
struct sway_view;
|
||||
|
||||
void desktop_damage_surface(struct wlr_surface *surface, double lx, double ly,
|
||||
bool whole);
|
||||
|
||||
void desktop_damage_whole_container(struct sway_container *con);
|
||||
|
||||
void desktop_damage_box(struct wlr_box *box);
|
||||
|
||||
void desktop_damage_view(struct sway_view *view);
|
||||
|
|
@ -45,7 +45,6 @@ struct sway_output {
|
|||
struct wlr_box usable_area;
|
||||
|
||||
struct timespec last_frame;
|
||||
struct wlr_output_damage *damage;
|
||||
|
||||
int lx, ly; // layout coords
|
||||
int width, height; // transformed buffer size
|
||||
|
|
@ -63,8 +62,6 @@ struct sway_output {
|
|||
struct wl_listener commit;
|
||||
struct wl_listener mode;
|
||||
struct wl_listener present;
|
||||
struct wl_listener damage_destroy;
|
||||
struct wl_listener damage_frame;
|
||||
struct wl_listener frame_request;
|
||||
|
||||
struct {
|
||||
|
|
@ -101,19 +98,6 @@ typedef void (*sway_surface_iterator_func_t)(struct sway_output *output,
|
|||
struct sway_view *view, struct wlr_surface *surface, struct wlr_box *box,
|
||||
void *user_data);
|
||||
|
||||
void output_damage_whole(struct sway_output *output);
|
||||
|
||||
void output_damage_surface(struct sway_output *output, double ox, double oy,
|
||||
struct wlr_surface *surface, bool whole);
|
||||
|
||||
void output_damage_from_view(struct sway_output *output,
|
||||
struct sway_view *view);
|
||||
|
||||
void output_damage_box(struct sway_output *output, struct wlr_box *box);
|
||||
|
||||
void output_damage_whole_container(struct sway_output *output,
|
||||
struct sway_container *con);
|
||||
|
||||
// this ONLY includes the enabled outputs
|
||||
struct sway_output *output_by_name_or_id(const char *name_or_id);
|
||||
|
||||
|
|
@ -128,21 +112,6 @@ void output_disable(struct sway_output *output);
|
|||
|
||||
struct sway_workspace *output_get_active_workspace(struct sway_output *output);
|
||||
|
||||
void output_render(struct sway_output *output, struct timespec *when,
|
||||
pixman_region32_t *damage);
|
||||
|
||||
void output_surface_for_each_surface(struct sway_output *output,
|
||||
struct wlr_surface *surface, double ox, double oy,
|
||||
sway_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
void output_view_for_each_surface(struct sway_output *output,
|
||||
struct sway_view *view, sway_surface_iterator_func_t iterator,
|
||||
void *user_data);
|
||||
|
||||
void output_view_for_each_popup_surface(struct sway_output *output,
|
||||
struct sway_view *view, sway_surface_iterator_func_t iterator,
|
||||
void *user_data);
|
||||
|
||||
void output_for_each_workspace(struct sway_output *output,
|
||||
void (*f)(struct sway_workspace *ws, void *data), void *data);
|
||||
|
||||
|
|
@ -160,8 +129,6 @@ void output_get_box(struct sway_output *output, struct wlr_box *box);
|
|||
enum sway_container_layout output_get_default_layout(
|
||||
struct sway_output *output);
|
||||
|
||||
void scale_box(struct wlr_box *box, float scale);
|
||||
|
||||
enum wlr_direction opposite_direction(enum wlr_direction d);
|
||||
|
||||
void handle_output_layout_change(struct wl_listener *listener, void *data);
|
||||
|
|
|
|||
|
|
@ -125,11 +125,6 @@ struct sway_container {
|
|||
double child_total_width;
|
||||
double child_total_height;
|
||||
|
||||
// In most cases this is the same as the content x and y, but if the view
|
||||
// refuses to resize to the content dimensions then it can be smaller.
|
||||
// These are in layout coordinates.
|
||||
double surface_x, surface_y;
|
||||
|
||||
// Outputs currently being intersected
|
||||
list_t *outputs; // struct sway_output
|
||||
|
||||
|
|
@ -176,8 +171,6 @@ bool container_has_ancestor(struct sway_container *container,
|
|||
|
||||
void container_update_textures_recursive(struct sway_container *con);
|
||||
|
||||
void container_damage_whole(struct sway_container *container);
|
||||
|
||||
void container_reap_empty(struct sway_container *con);
|
||||
|
||||
struct sway_container *container_flatten(struct sway_container *container);
|
||||
|
|
|
|||
|
|
@ -46,10 +46,6 @@ struct sway_view_impl {
|
|||
void (*set_fullscreen)(struct sway_view *view, bool fullscreen);
|
||||
void (*set_resizing)(struct sway_view *view, bool resizing);
|
||||
bool (*wants_floating)(struct sway_view *view);
|
||||
void (*for_each_surface)(struct sway_view *view,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
void (*for_each_popup_surface)(struct sway_view *view,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
bool (*is_transient_for)(struct sway_view *child,
|
||||
struct sway_view *ancestor);
|
||||
void (*close)(struct sway_view *view);
|
||||
|
|
@ -264,20 +260,6 @@ void view_close(struct sway_view *view);
|
|||
|
||||
void view_close_popups(struct sway_view *view);
|
||||
|
||||
void view_damage_from(struct sway_view *view);
|
||||
|
||||
/**
|
||||
* Iterate all surfaces of a view (toplevels + popups).
|
||||
*/
|
||||
void view_for_each_surface(struct sway_view *view,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
/**
|
||||
* Iterate all popup surfaces of a view.
|
||||
*/
|
||||
void view_for_each_popup_surface(struct sway_view *view,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
// view implementation
|
||||
|
||||
bool view_init(struct sway_view *view, enum sway_view_type type,
|
||||
|
|
|
|||
|
|
@ -51,11 +51,6 @@ static struct cmd_results *handle_command(int argc, char **argv, char *cmd_name,
|
|||
|
||||
if (config->active) {
|
||||
root_for_each_container(title_bar_update_iterator, NULL);
|
||||
|
||||
for (int i = 0; i < root->outputs->length; ++i) {
|
||||
struct sway_output *output = root->outputs->items[i];
|
||||
output_damage_whole(output);
|
||||
}
|
||||
}
|
||||
|
||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||
|
|
|
|||
|
|
@ -37,6 +37,5 @@ struct cmd_results *cmd_opacity(int argc, char **argv) {
|
|||
}
|
||||
|
||||
con->alpha = val;
|
||||
container_damage_whole(con);
|
||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,10 +26,5 @@ struct cmd_results *cmd_show_marks(int argc, char **argv) {
|
|||
root_for_each_container(title_bar_update_iterator, NULL);
|
||||
}
|
||||
|
||||
for (int i = 0; i < root->outputs->length; ++i) {
|
||||
struct sway_output *output = root->outputs->items[i];
|
||||
output_damage_whole(output);
|
||||
}
|
||||
|
||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,10 +27,5 @@ struct cmd_results *cmd_title_align(int argc, char **argv) {
|
|||
|
||||
root_for_each_container(arrange_title_bar_iterator, NULL);
|
||||
|
||||
for (int i = 0; i < root->outputs->length; ++i) {
|
||||
struct sway_output *output = root->outputs->items[i];
|
||||
output_damage_whole(output);
|
||||
}
|
||||
|
||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ struct cmd_results *cmd_titlebar_border_thickness(int argc, char **argv) {
|
|||
"Expected output to have a workspace");
|
||||
}
|
||||
arrange_workspace(ws);
|
||||
output_damage_whole(output);
|
||||
}
|
||||
|
||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ struct cmd_results *cmd_titlebar_padding(int argc, char **argv) {
|
|||
for (int i = 0; i < root->outputs->length; ++i) {
|
||||
struct sway_output *output = root->outputs->items[i];
|
||||
arrange_workspace(output_get_active_workspace(output));
|
||||
output_damage_whole(output);
|
||||
}
|
||||
|
||||
return cmd_results_new(CMD_SUCCESS, NULL);
|
||||
|
|
|
|||
|
|
@ -524,10 +524,6 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (config->reloading) {
|
||||
output_damage_whole(output);
|
||||
}
|
||||
|
||||
if (oc) {
|
||||
enum scale_filter_mode scale_filter_old = output->scale_filter;
|
||||
switch (oc->scale_filter) {
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
#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];
|
||||
struct wlr_box output_box;
|
||||
wlr_output_layout_get_box(root->output_layout,
|
||||
output->wlr_output, &output_box);
|
||||
output_damage_surface(output, lx - output_box.x,
|
||||
ly - output_box.y, 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);
|
||||
}
|
||||
|
|
@ -10,7 +10,6 @@
|
|||
#include <wlr/types/wlr_buffer.h>
|
||||
#include <wlr/types/wlr_drm_lease_v1.h>
|
||||
#include <wlr/types/wlr_matrix.h>
|
||||
#include <wlr/types/wlr_output_damage.h>
|
||||
#include <wlr/types/wlr_output_layout.h>
|
||||
#include <wlr/types/wlr_output.h>
|
||||
#include <wlr/types/wlr_presentation_time.h>
|
||||
|
|
@ -58,127 +57,6 @@ struct sway_output *all_output_by_name_or_id(const char *name_or_id) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct surface_iterator_data {
|
||||
sway_surface_iterator_func_t user_iterator;
|
||||
void *user_data;
|
||||
|
||||
struct sway_output *output;
|
||||
struct sway_view *view;
|
||||
double ox, oy;
|
||||
int width, height;
|
||||
};
|
||||
|
||||
static bool get_surface_box(struct surface_iterator_data *data,
|
||||
struct wlr_surface *surface, int sx, int sy,
|
||||
struct wlr_box *surface_box) {
|
||||
struct sway_output *output = data->output;
|
||||
|
||||
if (!wlr_surface_has_buffer(surface)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int sw = surface->current.width;
|
||||
int sh = surface->current.height;
|
||||
|
||||
struct wlr_box box = {
|
||||
.x = floor(data->ox + sx),
|
||||
.y = floor(data->oy + sy),
|
||||
.width = sw,
|
||||
.height = sh,
|
||||
};
|
||||
if (surface_box != NULL) {
|
||||
memcpy(surface_box, &box, sizeof(struct wlr_box));
|
||||
}
|
||||
|
||||
struct wlr_box output_box = {
|
||||
.width = output->width,
|
||||
.height = output->height,
|
||||
};
|
||||
|
||||
struct wlr_box intersection;
|
||||
return wlr_box_intersection(&intersection, &output_box, &box);
|
||||
}
|
||||
|
||||
static void output_for_each_surface_iterator(struct wlr_surface *surface,
|
||||
int sx, int sy, void *_data) {
|
||||
struct surface_iterator_data *data = _data;
|
||||
|
||||
struct wlr_box box;
|
||||
bool intersects = get_surface_box(data, surface, sx, sy, &box);
|
||||
if (!intersects) {
|
||||
return;
|
||||
}
|
||||
|
||||
data->user_iterator(data->output, data->view, surface, &box,
|
||||
data->user_data);
|
||||
}
|
||||
|
||||
void output_surface_for_each_surface(struct sway_output *output,
|
||||
struct wlr_surface *surface, double ox, double oy,
|
||||
sway_surface_iterator_func_t iterator, void *user_data) {
|
||||
struct surface_iterator_data data = {
|
||||
.user_iterator = iterator,
|
||||
.user_data = user_data,
|
||||
.output = output,
|
||||
.view = NULL,
|
||||
.ox = ox,
|
||||
.oy = oy,
|
||||
.width = surface->current.width,
|
||||
.height = surface->current.height,
|
||||
};
|
||||
|
||||
wlr_surface_for_each_surface(surface,
|
||||
output_for_each_surface_iterator, &data);
|
||||
}
|
||||
|
||||
void output_view_for_each_surface(struct sway_output *output,
|
||||
struct sway_view *view, sway_surface_iterator_func_t iterator,
|
||||
void *user_data) {
|
||||
struct surface_iterator_data data = {
|
||||
.user_iterator = iterator,
|
||||
.user_data = user_data,
|
||||
.output = output,
|
||||
.view = view,
|
||||
.ox = view->container->surface_x - output->lx
|
||||
- view->geometry.x,
|
||||
.oy = view->container->surface_y - output->ly
|
||||
- view->geometry.y,
|
||||
.width = view->container->current.content_width,
|
||||
.height = view->container->current.content_height,
|
||||
};
|
||||
|
||||
view_for_each_surface(view, output_for_each_surface_iterator, &data);
|
||||
}
|
||||
|
||||
void output_view_for_each_popup_surface(struct sway_output *output,
|
||||
struct sway_view *view, sway_surface_iterator_func_t iterator,
|
||||
void *user_data) {
|
||||
struct surface_iterator_data data = {
|
||||
.user_iterator = iterator,
|
||||
.user_data = user_data,
|
||||
.output = output,
|
||||
.view = view,
|
||||
.ox = view->container->surface_x - output->lx
|
||||
- view->geometry.x,
|
||||
.oy = view->container->surface_y - output->ly
|
||||
- view->geometry.y,
|
||||
.width = view->container->current.content_width,
|
||||
.height = view->container->current.content_height,
|
||||
};
|
||||
|
||||
view_for_each_popup_surface(view, output_for_each_surface_iterator, &data);
|
||||
}
|
||||
|
||||
static int scale_length(int length, int offset, float scale) {
|
||||
return round((offset + length) * scale) - round(offset * scale);
|
||||
}
|
||||
|
||||
void scale_box(struct wlr_box *box, float scale) {
|
||||
box->width = scale_length(box->width, box->x, scale);
|
||||
box->height = scale_length(box->height, box->y, scale);
|
||||
box->x = round(box->x * scale);
|
||||
box->y = round(box->y * scale);
|
||||
}
|
||||
|
||||
struct sway_workspace *output_get_active_workspace(struct sway_output *output) {
|
||||
struct sway_seat *seat = input_manager_current_seat();
|
||||
|
|
@ -379,115 +257,6 @@ static void handle_frame_request(struct wl_listener *listener, void *user_data)
|
|||
wlr_scene_output_for_each_buffer(output->scene_output, send_frame_done_iterator, &data);
|
||||
}
|
||||
|
||||
void output_damage_whole(struct sway_output *output) {
|
||||
// The output can exist with no wlr_output if it's just been disconnected
|
||||
// and the transaction to evacuate it has't completed yet.
|
||||
if (output && output->wlr_output && output->damage) {
|
||||
wlr_output_damage_add_whole(output->damage);
|
||||
}
|
||||
}
|
||||
|
||||
static void damage_surface_iterator(struct sway_output *output,
|
||||
struct sway_view *view, struct wlr_surface *surface,
|
||||
struct wlr_box *_box, void *_data) {
|
||||
bool *data = _data;
|
||||
bool whole = *data;
|
||||
|
||||
struct wlr_box box = *_box;
|
||||
scale_box(&box, output->wlr_output->scale);
|
||||
|
||||
pixman_region32_t damage;
|
||||
pixman_region32_init(&damage);
|
||||
wlr_surface_get_effective_damage(surface, &damage);
|
||||
wlr_region_scale(&damage, &damage, output->wlr_output->scale);
|
||||
if (ceil(output->wlr_output->scale) > surface->current.scale) {
|
||||
// When scaling up a surface, it'll become blurry so we need to
|
||||
// expand the damage region
|
||||
wlr_region_expand(&damage, &damage,
|
||||
ceil(output->wlr_output->scale) - surface->current.scale);
|
||||
}
|
||||
pixman_region32_translate(&damage, box.x, box.y);
|
||||
wlr_output_damage_add(output->damage, &damage);
|
||||
pixman_region32_fini(&damage);
|
||||
|
||||
if (whole) {
|
||||
wlr_output_damage_add_box(output->damage, &box);
|
||||
}
|
||||
|
||||
if (!wl_list_empty(&surface->current.frame_callback_list)) {
|
||||
wlr_output_schedule_frame(output->wlr_output);
|
||||
}
|
||||
}
|
||||
|
||||
void output_damage_surface(struct sway_output *output, double ox, double oy,
|
||||
struct wlr_surface *surface, bool whole) {
|
||||
output_surface_for_each_surface(output, surface, ox, oy,
|
||||
damage_surface_iterator, &whole);
|
||||
}
|
||||
|
||||
void output_damage_from_view(struct sway_output *output,
|
||||
struct sway_view *view) {
|
||||
if (!view_is_visible(view)) {
|
||||
return;
|
||||
}
|
||||
bool whole = false;
|
||||
output_view_for_each_surface(output, view, damage_surface_iterator, &whole);
|
||||
}
|
||||
|
||||
// Expecting an unscaled box in layout coordinates
|
||||
void output_damage_box(struct sway_output *output, struct wlr_box *_box) {
|
||||
struct wlr_box box;
|
||||
memcpy(&box, _box, sizeof(struct wlr_box));
|
||||
box.x -= output->lx;
|
||||
box.y -= output->ly;
|
||||
scale_box(&box, output->wlr_output->scale);
|
||||
wlr_output_damage_add_box(output->damage, &box);
|
||||
}
|
||||
|
||||
static void damage_child_views_iterator(struct sway_container *con,
|
||||
void *data) {
|
||||
if (!con->view || !view_is_visible(con->view)) {
|
||||
return;
|
||||
}
|
||||
struct sway_output *output = data;
|
||||
bool whole = true;
|
||||
output_view_for_each_surface(output, con->view, damage_surface_iterator,
|
||||
&whole);
|
||||
}
|
||||
|
||||
void output_damage_whole_container(struct sway_output *output,
|
||||
struct sway_container *con) {
|
||||
// Pad the box by 1px, because the width is a double and might be a fraction
|
||||
struct wlr_box box = {
|
||||
.x = con->current.x - output->lx - 1,
|
||||
.y = con->current.y - output->ly - 1,
|
||||
.width = con->current.width + 2,
|
||||
.height = con->current.height + 2,
|
||||
};
|
||||
scale_box(&box, output->wlr_output->scale);
|
||||
wlr_output_damage_add_box(output->damage, &box);
|
||||
// Damage subsurfaces as well, which may extend outside the box
|
||||
if (con->view) {
|
||||
damage_child_views_iterator(con, output);
|
||||
} else {
|
||||
container_for_each_child(con, damage_child_views_iterator, output);
|
||||
}
|
||||
}
|
||||
|
||||
static void damage_handle_destroy(struct wl_listener *listener, void *data) {
|
||||
struct sway_output *output =
|
||||
wl_container_of(listener, output, damage_destroy);
|
||||
if (!output->enabled) {
|
||||
return;
|
||||
}
|
||||
output_disable(output);
|
||||
|
||||
wl_list_remove(&output->damage_destroy.link);
|
||||
wl_list_remove(&output->damage_frame.link);
|
||||
|
||||
transaction_commit_dirty();
|
||||
}
|
||||
|
||||
static void update_output_manager_config(struct sway_server *server) {
|
||||
struct wlr_output_configuration_v1 *config =
|
||||
wlr_output_configuration_v1_create();
|
||||
|
|
@ -566,10 +335,6 @@ static void handle_mode(struct wl_listener *listener, void *data) {
|
|||
update_output_manager_config(output->server);
|
||||
}
|
||||
|
||||
static void update_textures(struct sway_container *con, void *data) {
|
||||
container_update_title_textures(con);
|
||||
}
|
||||
|
||||
static void handle_commit(struct wl_listener *listener, void *data) {
|
||||
struct sway_output *output = wl_container_of(listener, output, commit);
|
||||
struct wlr_output_event_commit *event = data;
|
||||
|
|
@ -578,10 +343,6 @@ static void handle_commit(struct wl_listener *listener, void *data) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (event->committed & WLR_OUTPUT_STATE_SCALE) {
|
||||
output_for_each_container(output, update_textures, NULL);
|
||||
}
|
||||
|
||||
if (event->committed & (WLR_OUTPUT_STATE_TRANSFORM | WLR_OUTPUT_STATE_SCALE)) {
|
||||
arrange_layers(output);
|
||||
arrange_output(output);
|
||||
|
|
@ -657,7 +418,6 @@ void handle_new_output(struct wl_listener *listener, void *data) {
|
|||
|
||||
output->server = server;
|
||||
output->scene_output = scene_output;
|
||||
output->damage = wlr_output_damage_create(wlr_output);
|
||||
|
||||
wl_signal_add(&wlr_output->events.destroy, &output->destroy);
|
||||
output->destroy.notify = handle_destroy;
|
||||
|
|
@ -669,8 +429,6 @@ void handle_new_output(struct wl_listener *listener, void *data) {
|
|||
output->present.notify = handle_present;
|
||||
wl_signal_add(&wlr_output->events.frame, &output->frame_request);
|
||||
output->frame_request.notify = handle_frame_request;
|
||||
wl_signal_add(&output->damage->events.destroy, &output->damage_destroy);
|
||||
output->damage_destroy.notify = damage_handle_destroy;
|
||||
|
||||
output->repaint_timer = wl_event_loop_add_timer(server->wl_event_loop,
|
||||
output_repaint_timer_handler, output);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
#include <time.h>
|
||||
#include <wlr/types/wlr_buffer.h>
|
||||
#include "sway/config.h"
|
||||
#include "sway/desktop.h"
|
||||
#include "sway/desktop/idle_inhibit_v1.h"
|
||||
#include "sway/desktop/transaction.h"
|
||||
#include "sway/input/cursor.h"
|
||||
|
|
@ -214,19 +213,15 @@ static void transaction_add_node(struct sway_transaction *transaction,
|
|||
|
||||
static void apply_output_state(struct sway_output *output,
|
||||
struct sway_output_state *state) {
|
||||
output_damage_whole(output);
|
||||
list_free(output->current.workspaces);
|
||||
memcpy(&output->current, state, sizeof(struct sway_output_state));
|
||||
output_damage_whole(output);
|
||||
}
|
||||
|
||||
static void apply_workspace_state(struct sway_workspace *ws,
|
||||
struct sway_workspace_state *state) {
|
||||
output_damage_whole(ws->current.output);
|
||||
list_free(ws->current.floating);
|
||||
list_free(ws->current.tiling);
|
||||
memcpy(&ws->current, state, sizeof(struct sway_workspace_state));
|
||||
output_damage_whole(ws->current.output);
|
||||
}
|
||||
|
||||
static void apply_container_state(struct sway_container *container,
|
||||
|
|
@ -256,19 +251,6 @@ static void apply_container_state(struct sway_container *container,
|
|||
}
|
||||
}
|
||||
|
||||
// Damage the new location
|
||||
desktop_damage_whole_container(container);
|
||||
if (view && view->surface) {
|
||||
struct wlr_surface *surface = view->surface;
|
||||
struct wlr_box box = {
|
||||
.x = container->current.content_x - view->geometry.x,
|
||||
.y = container->current.content_y - view->geometry.y,
|
||||
.width = surface->current.width,
|
||||
.height = surface->current.height,
|
||||
};
|
||||
desktop_damage_box(&box);
|
||||
}
|
||||
|
||||
if (!container->node.destroying) {
|
||||
container_discover_outputs(container);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,24 +198,6 @@ static bool wants_floating(struct sway_view *view) {
|
|||
|| toplevel->parent;
|
||||
}
|
||||
|
||||
static void for_each_surface(struct sway_view *view,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data) {
|
||||
if (xdg_shell_view_from_view(view) == NULL) {
|
||||
return;
|
||||
}
|
||||
wlr_xdg_surface_for_each_surface(view->wlr_xdg_toplevel->base, iterator,
|
||||
user_data);
|
||||
}
|
||||
|
||||
static void for_each_popup_surface(struct sway_view *view,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data) {
|
||||
if (xdg_shell_view_from_view(view) == NULL) {
|
||||
return;
|
||||
}
|
||||
wlr_xdg_surface_for_each_popup_surface(view->wlr_xdg_toplevel->base,
|
||||
iterator, user_data);
|
||||
}
|
||||
|
||||
static bool is_transient_for(struct sway_view *child,
|
||||
struct sway_view *ancestor) {
|
||||
if (xdg_shell_view_from_view(child) == NULL) {
|
||||
|
|
@ -263,8 +245,6 @@ static const struct sway_view_impl view_impl = {
|
|||
.set_fullscreen = set_fullscreen,
|
||||
.set_resizing = set_resizing,
|
||||
.wants_floating = wants_floating,
|
||||
.for_each_surface = for_each_surface,
|
||||
.for_each_popup_surface = for_each_popup_surface,
|
||||
.is_transient_for = is_transient_for,
|
||||
.close = _close,
|
||||
.close_popups = close_popups,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#define _POSIX_C_SOURCE 200809L
|
||||
#include <wlr/types/wlr_cursor.h>
|
||||
#include "sway/desktop.h"
|
||||
#include "sway/desktop/transaction.h"
|
||||
#include "sway/input/cursor.h"
|
||||
#include "sway/input/seat.h"
|
||||
|
|
@ -39,9 +38,7 @@ static void handle_tablet_tool_tip(struct sway_seat *seat,
|
|||
static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) {
|
||||
struct seatop_move_floating_event *e = seat->seatop_data;
|
||||
struct wlr_cursor *cursor = seat->cursor->cursor;
|
||||
desktop_damage_whole_container(e->con);
|
||||
container_floating_move_to(e->con, cursor->x - e->dx, cursor->y - e->dy);
|
||||
desktop_damage_whole_container(e->con);
|
||||
transaction_commit_dirty();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ sway_sources = files(
|
|||
'xdg_activation_v1.c',
|
||||
'xdg_decoration.c',
|
||||
|
||||
'desktop/desktop.c',
|
||||
'desktop/idle_inhibit_v1.c',
|
||||
'desktop/layer_shell.c',
|
||||
'desktop/output.c',
|
||||
|
|
|
|||
|
|
@ -515,12 +515,6 @@ bool container_has_ancestor(struct sway_container *descendant,
|
|||
return false;
|
||||
}
|
||||
|
||||
void container_damage_whole(struct sway_container *container) {
|
||||
for (int i = 0; i < root->outputs->length; ++i) {
|
||||
struct sway_output *output = root->outputs->items[i];
|
||||
output_damage_whole_container(output, container);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the output which will be used for scale purposes.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <wlr/types/wlr_output_damage.h>
|
||||
#include "sway/ipc-server.h"
|
||||
#include "sway/layers.h"
|
||||
#include "sway/output.h"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
#include "log.h"
|
||||
#include "sway/criteria.h"
|
||||
#include "sway/commands.h"
|
||||
#include "sway/desktop.h"
|
||||
#include "sway/desktop/transaction.h"
|
||||
#include "sway/desktop/idle_inhibit_v1.h"
|
||||
#include "sway/input/cursor.h"
|
||||
|
|
@ -440,34 +439,6 @@ void view_close_popups(struct sway_view *view) {
|
|||
}
|
||||
}
|
||||
|
||||
void view_damage_from(struct sway_view *view) {
|
||||
for (int i = 0; i < root->outputs->length; ++i) {
|
||||
struct sway_output *output = root->outputs->items[i];
|
||||
output_damage_from_view(output, view);
|
||||
}
|
||||
}
|
||||
|
||||
void view_for_each_surface(struct sway_view *view,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data) {
|
||||
if (!view->surface) {
|
||||
return;
|
||||
}
|
||||
if (view->impl->for_each_surface) {
|
||||
view->impl->for_each_surface(view, iterator, user_data);
|
||||
} else {
|
||||
wlr_surface_for_each_surface(view->surface, iterator, user_data);
|
||||
}
|
||||
}
|
||||
|
||||
void view_for_each_popup_surface(struct sway_view *view,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data) {
|
||||
if (!view->surface) {
|
||||
return;
|
||||
}
|
||||
if (view->impl->for_each_popup_surface) {
|
||||
view->impl->for_each_popup_surface(view, iterator, user_data);
|
||||
}
|
||||
}
|
||||
static bool view_has_executed_criteria(struct sway_view *view,
|
||||
struct criteria *criteria) {
|
||||
for (int i = 0; i < view->executed_criteria->length; ++i) {
|
||||
|
|
@ -1144,7 +1115,6 @@ void view_set_urgent(struct sway_view *view, bool enable) {
|
|||
view->urgent_timer = NULL;
|
||||
}
|
||||
}
|
||||
container_damage_whole(view->container);
|
||||
|
||||
ipc_event_window(view->container, "urgent");
|
||||
|
||||
|
|
|
|||
|
|
@ -701,7 +701,6 @@ void workspace_detect_urgent(struct sway_workspace *workspace) {
|
|||
if (workspace->urgent != new_urgent) {
|
||||
workspace->urgent = new_urgent;
|
||||
ipc_event_workspace(NULL, workspace, "urgent");
|
||||
output_damage_whole(workspace->output);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue