mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-09 08:21:01 -04:00
wayland: refactor: surface_scale(): pass wl_window pointer, instead of wayland global
This commit is contained in:
parent
c309c9f572
commit
d71e588800
3 changed files with 13 additions and 13 deletions
11
wayland.c
11
wayland.c
|
|
@ -1891,7 +1891,7 @@ wayl_fractional_scaling(const struct wayland *wayl)
|
|||
|
||||
void
|
||||
wayl_surface_scale_explicit_width_height(
|
||||
const struct wayland *wayl, const struct wayl_surface *surf,
|
||||
const struct wl_window *win, const struct wayl_surface *surf,
|
||||
int width, int height, float scale)
|
||||
{
|
||||
|
||||
|
|
@ -1915,26 +1915,25 @@ wayl_surface_scale_explicit_width_height(
|
|||
xassert(width % iscale == 0);
|
||||
xassert(height % iscale == 0);
|
||||
|
||||
wl_surface_set_buffer_scale(surf->surf, (int)scale);
|
||||
wl_surface_set_buffer_scale(surf->surf, iscale);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
wayl_surface_scale(const struct wayland *wayl, const struct wayl_surface *surf,
|
||||
wayl_surface_scale(const struct wl_window *win, const struct wayl_surface *surf,
|
||||
const struct buffer *buf, float scale)
|
||||
{
|
||||
wayl_surface_scale_explicit_width_height(
|
||||
wayl, surf, buf->width, buf->height, scale);
|
||||
win, surf, buf->width, buf->height, scale);
|
||||
}
|
||||
|
||||
void
|
||||
wayl_win_scale(struct wl_window *win, const struct buffer *buf)
|
||||
{
|
||||
const struct terminal *term = win->term;
|
||||
const struct wayland *wayl = term->wl;
|
||||
const float scale = term->scale;
|
||||
|
||||
wayl_surface_scale(wayl, &win->surface, buf, scale);
|
||||
wayl_surface_scale(win, &win->surface, buf, scale);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue