diff options
author | Manuel Stoeckl <code@mstoeckl.com> | 2024-04-29 21:01:44 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2024-05-07 16:18:43 +0200 |
commit | dcdb72757a5ec591c692df5e96c57c51758dbd8f (patch) | |
tree | 593098c3313e0aefd617ff0ee5fe0490f28982f3 | |
parent | tree/container: ensure pixman rect is valid in container_arrange_title_bar() (diff) | |
download | sway-dcdb72757a5ec591c692df5e96c57c51758dbd8f.tar.gz sway-dcdb72757a5ec591c692df5e96c57c51758dbd8f.tar.zst sway-dcdb72757a5ec591c692df5e96c57c51758dbd8f.zip |
desktop/layer_shell: provide fractional scale on creation
Also, send a matching wl_surface.preferred_buffer_scale event.
-rw-r--r-- | sway/desktop/layer_shell.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index 4b2584b6..6221b7b9 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | #include <string.h> | 3 | #include <string.h> |
4 | #include <wayland-server-core.h> | 4 | #include <wayland-server-core.h> |
5 | #include <wlr/types/wlr_fractional_scale_v1.h> | ||
5 | #include <wlr/types/wlr_layer_shell_v1.h> | 6 | #include <wlr/types/wlr_layer_shell_v1.h> |
6 | #include <wlr/types/wlr_output.h> | 7 | #include <wlr/types/wlr_output.h> |
7 | #include <wlr/types/wlr_scene.h> | 8 | #include <wlr/types/wlr_scene.h> |
@@ -432,6 +433,12 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { | |||
432 | 433 | ||
433 | surface->output = output; | 434 | surface->output = output; |
434 | 435 | ||
436 | // now that the surface's output is known, we can advertise its scale | ||
437 | wlr_fractional_scale_v1_notify_scale(surface->layer_surface->surface, | ||
438 | layer_surface->output->scale); | ||
439 | wlr_surface_set_preferred_buffer_scale(surface->layer_surface->surface, | ||
440 | ceil(layer_surface->output->scale)); | ||
441 | |||
435 | surface->surface_commit.notify = handle_surface_commit; | 442 | surface->surface_commit.notify = handle_surface_commit; |
436 | wl_signal_add(&layer_surface->surface->events.commit, | 443 | wl_signal_add(&layer_surface->surface->events.commit, |
437 | &surface->surface_commit); | 444 | &surface->surface_commit); |