aboutsummaryrefslogtreecommitdiff
path: root/wayland.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2023-06-26 15:05:16 +0000
committerDaniel Eklöf <daniel@ekloef.se>2023-06-29 13:38:23 +0000
commit5a60bbc119397c2993fc1895bae75c2c1e69fe1d (patch)
tree6b8e3f891cad4341d6fe244134bb5c4afbcea825 /wayland.c
parentwayland: refactor: wayl_surface_scale(): pass wayl_surface pointer (diff)
wayland: refactor: add a buffer argument to wayl_*_scale() functions
This will be needed later, when using fractional scaling + viewporter to scale.
Diffstat (limited to 'wayland.c')
-rw-r--r--wayland.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/wayland.c b/wayland.c
index cd1a4c68..43f85066 100644
--- a/wayland.c
+++ b/wayland.c
@@ -1865,8 +1865,9 @@ wayl_fractional_scaling(const struct wayland *wayl)
}
void
-wayl_surface_scale(const struct wayland *wayl, const struct wayl_surface *surf,
- float scale)
+wayl_surface_scale_explicit_width_height(
+ const struct wayland *wayl, const struct wayl_surface *surf,
+ int width, int height, float scale)
{
LOG_WARN("scaling by a factor of %.2f (legacy)", scale);
@@ -1878,13 +1879,21 @@ wayl_surface_scale(const struct wayland *wayl, const struct wayl_surface *surf,
}
void
-wayl_win_scale(struct wl_window *win)
+wayl_surface_scale(const struct wayland *wayl, const struct wayl_surface *surf,
+ const struct buffer *buf, float scale)
+{
+ wayl_surface_scale_explicit_width_height(
+ wayl, 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, scale);
+ wayl_surface_scale(wayl, &win->surface, buf, scale);
}
void