diff options
-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 @@ | |||
6 | #include <wlr/types/wlr_buffer.h> | 6 | #include <wlr/types/wlr_buffer.h> |
7 | #include <wlr/types/wlr_ext_foreign_toplevel_list_v1.h> | 7 | #include <wlr/types/wlr_ext_foreign_toplevel_list_v1.h> |
8 | #include <wlr/types/wlr_foreign_toplevel_management_v1.h> | 8 | #include <wlr/types/wlr_foreign_toplevel_management_v1.h> |
9 | #include <wlr/types/wlr_fractional_scale_v1.h> | ||
9 | #include <wlr/types/wlr_output_layout.h> | 10 | #include <wlr/types/wlr_output_layout.h> |
10 | #include <wlr/types/wlr_server_decoration.h> | 11 | #include <wlr/types/wlr_server_decoration.h> |
11 | #include <wlr/types/wlr_subcompositor.h> | 12 | #include <wlr/types/wlr_subcompositor.h> |
@@ -741,6 +742,14 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface, | |||
741 | ws = select_workspace(view); | 742 | ws = select_workspace(view); |
742 | } | 743 | } |
743 | 744 | ||
745 | if (ws && ws->output) { | ||
746 | // Once the output is determined, we can notify the client early about | ||
747 | // scale to reduce startup jitter. | ||
748 | float scale = ws->output->wlr_output->scale; | ||
749 | wlr_fractional_scale_v1_notify_scale(wlr_surface, scale); | ||
750 | wlr_surface_set_preferred_buffer_scale(wlr_surface, ceil(scale)); | ||
751 | } | ||
752 | |||
744 | struct sway_seat *seat = input_manager_current_seat(); | 753 | struct sway_seat *seat = input_manager_current_seat(); |
745 | struct sway_node *node = | 754 | struct sway_node *node = |
746 | seat_get_focus_inactive(seat, ws ? &ws->node : &root->node); | 755 | seat_get_focus_inactive(seat, ws ? &ws->node : &root->node); |