render: csd: use a struct for positioning information

This commit is contained in:
Daniel Eklöf 2020-02-28 19:00:48 +01:00
parent 45c1585bfb
commit de9fcbc339
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -683,7 +683,12 @@ render_csd(struct terminal *term)
const int title_height = csd_title_size * term->scale; const int title_height = csd_title_size * term->scale;
const int geom[5][4] = { const struct {
int x;
int y;
int width;
int height;
} geom[] = {
/* X, Y, WIDTH, HEIGHT */ /* X, Y, WIDTH, HEIGHT */
#if FOOT_CSD_OUTSIDE #if FOOT_CSD_OUTSIDE
{ 0, -title_height, term->width, title_height}, /* title */ { 0, -title_height, term->width, title_height}, /* title */
@ -708,10 +713,10 @@ render_csd(struct terminal *term)
struct wl_surface *surf = term->window->csd.surface[i]; struct wl_surface *surf = term->window->csd.surface[i];
struct wl_subsurface *sub = term->window->csd.sub_surface[i]; struct wl_subsurface *sub = term->window->csd.sub_surface[i];
const int x = geom[i][0]; const int x = geom[i].x;
const int y = geom[i][1]; const int y = geom[i].y;
const int width = geom[i][2]; const int width = geom[i].width;
const int height = geom[i][3]; const int height = geom[i].height;
if (width == 0 || height == 0) { if (width == 0 || height == 0) {
/* CSD borders aren't rendered in maximized mode */ /* CSD borders aren't rendered in maximized mode */