render_data only needs coordinates, not Client

This commit is contained in:
Devin J. Pohly 2020-04-21 14:57:27 -05:00
parent 7056fbe101
commit 599bec5583
1 changed files with 4 additions and 4 deletions

8
dwl.c
View File

@ -86,8 +86,8 @@ typedef struct {
* frame handler to the per-surface render function. */ * frame handler to the per-surface render function. */
struct render_data { struct render_data {
struct wlr_output *output; struct wlr_output *output;
Client *client;
struct timespec *when; struct timespec *when;
int x, y;
}; };
/* function declarations */ /* function declarations */
@ -634,7 +634,6 @@ render(struct wlr_surface *surface, int sx, int sy, void *data)
{ {
/* This function is called for every surface that needs to be rendered. */ /* This function is called for every surface that needs to be rendered. */
struct render_data *rdata = data; struct render_data *rdata = data;
Client *c = rdata->client;
struct wlr_output *output = rdata->output; struct wlr_output *output = rdata->output;
/* We first obtain a wlr_texture, which is a GPU resource. wlroots /* We first obtain a wlr_texture, which is a GPU resource. wlroots
@ -654,7 +653,7 @@ render(struct wlr_surface *surface, int sx, int sy, void *data)
double ox = 0, oy = 0; double ox = 0, oy = 0;
wlr_output_layout_output_coords( wlr_output_layout_output_coords(
output_layout, output, &ox, &oy); output_layout, output, &ox, &oy);
ox += c->x + sx, oy += c->y + sy; ox += rdata->x + sx, oy += rdata->y + sy;
/* We also have to apply the scale factor for HiDPI outputs. This is only /* We also have to apply the scale factor for HiDPI outputs. This is only
* part of the puzzle, dwl does not fully support HiDPI. */ * part of the puzzle, dwl does not fully support HiDPI. */
@ -724,8 +723,9 @@ rendermon(struct wl_listener *listener, void *data)
} }
struct render_data rdata = { struct render_data rdata = {
.output = m->wlr_output, .output = m->wlr_output,
.client = c,
.when = &now, .when = &now,
.x = c->x,
.y = c->y,
}; };
/* This calls our render function for each surface among the /* This calls our render function for each surface among the
* xdg_surface's toplevel and popups. */ * xdg_surface's toplevel and popups. */