mirror of
https://github.com/swaywm/sway.git
synced 2024-11-22 07:51:28 +00:00
desktop/layer_shell: provide fractional scale on creation
Also, send a matching wl_surface.preferred_buffer_scale event.
This commit is contained in:
parent
30f5c3a911
commit
dcdb72757a
|
@ -2,6 +2,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <wayland-server-core.h>
|
#include <wayland-server-core.h>
|
||||||
|
#include <wlr/types/wlr_fractional_scale_v1.h>
|
||||||
#include <wlr/types/wlr_layer_shell_v1.h>
|
#include <wlr/types/wlr_layer_shell_v1.h>
|
||||||
#include <wlr/types/wlr_output.h>
|
#include <wlr/types/wlr_output.h>
|
||||||
#include <wlr/types/wlr_scene.h>
|
#include <wlr/types/wlr_scene.h>
|
||||||
|
@ -432,6 +433,12 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
|
||||||
|
|
||||||
surface->output = output;
|
surface->output = output;
|
||||||
|
|
||||||
|
// now that the surface's output is known, we can advertise its scale
|
||||||
|
wlr_fractional_scale_v1_notify_scale(surface->layer_surface->surface,
|
||||||
|
layer_surface->output->scale);
|
||||||
|
wlr_surface_set_preferred_buffer_scale(surface->layer_surface->surface,
|
||||||
|
ceil(layer_surface->output->scale));
|
||||||
|
|
||||||
surface->surface_commit.notify = handle_surface_commit;
|
surface->surface_commit.notify = handle_surface_commit;
|
||||||
wl_signal_add(&layer_surface->surface->events.commit,
|
wl_signal_add(&layer_surface->surface->events.commit,
|
||||||
&surface->surface_commit);
|
&surface->surface_commit);
|
||||||
|
|
Loading…
Reference in a new issue