diff options
| author | Alexander Orzechowski <alex@ozal.ski> | 2024-03-07 18:03:40 -0500 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2024-03-09 11:47:42 +0100 |
| commit | 2e951163c5a5f24fe9cf7ee348e56b09719a99a9 (patch) | |
| tree | 4280fd944e8e77d0e5ee20eb54be2b45a094328b | |
| parent | 23389ebd1f301403e4b2331855a224dff89e1ad1 (diff) | |
Force bilinear scaling when scaling down
| -rw-r--r-- | sway/desktop/output.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 600423bc..b8f2d32d 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -183,7 +183,15 @@ static void send_frame_done_iterator(struct wlr_scene_buffer *buffer, } } -static enum wlr_scale_filter_mode get_scale_filter(struct sway_output *output) { +static enum wlr_scale_filter_mode get_scale_filter(struct sway_output *output, + struct wlr_scene_buffer *buffer) { + // if we are scaling down, we should always choose linear + if (buffer->dst_width > 0 && buffer->dst_height > 0 && ( + buffer->dst_width < buffer->buffer_width || + buffer->dst_height < buffer->buffer_height)) { + return WLR_SCALE_FILTER_BILINEAR; + } + switch (output->scale_filter) { case SCALE_FILTER_LINEAR: return WLR_SCALE_FILTER_BILINEAR; @@ -212,7 +220,7 @@ static void output_configure_scene(struct sway_output *output, // hack: don't call the scene setter because that will damage all outputs // We don't want to damage outputs that aren't our current output that // we're configuring - buffer->filter_mode = get_scale_filter(output); + buffer->filter_mode = get_scale_filter(output, buffer); wlr_scene_buffer_set_opacity(buffer, opacity); } else if (node->type == WLR_SCENE_NODE_TREE) { |
