mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-04 01:40:21 -05:00
render: csd: use a struct for positioning information
This commit is contained in:
parent
45c1585bfb
commit
de9fcbc339
1 changed files with 10 additions and 5 deletions
15
render.c
15
render.c
|
|
@ -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 */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue