diff options
| author | Ronan Pigott <ronan@rjp.ie> | 2023-07-31 12:20:07 -0700 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2024-06-29 14:53:00 +0200 |
| commit | 5d237679f5d433b6a6c3b489298c42d40f217db4 (patch) | |
| tree | 96a54f96b3de6748f71e50ef12f5b614dead7dca | |
| parent | cdde0165dad94e4522f8f6f040e9d30145fbb14f (diff) | |
view: send scale notification when the output is known
| -rw-r--r-- | sway/tree/view.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 086a8ff3..4f757acf 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -6,6 +6,7 @@ #include <wlr/types/wlr_buffer.h> #include <wlr/types/wlr_ext_foreign_toplevel_list_v1.h> #include <wlr/types/wlr_foreign_toplevel_management_v1.h> +#include <wlr/types/wlr_fractional_scale_v1.h> #include <wlr/types/wlr_output_layout.h> #include <wlr/types/wlr_server_decoration.h> #include <wlr/types/wlr_subcompositor.h> @@ -741,6 +742,14 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface, ws = select_workspace(view); } + if (ws && ws->output) { + // Once the output is determined, we can notify the client early about + // scale to reduce startup jitter. + float scale = ws->output->wlr_output->scale; + wlr_fractional_scale_v1_notify_scale(wlr_surface, scale); + wlr_surface_set_preferred_buffer_scale(wlr_surface, ceil(scale)); + } + struct sway_seat *seat = input_manager_current_seat(); struct sway_node *node = seat_get_focus_inactive(seat, ws ? &ws->node : &root->node); |
