summaryrefslogtreecommitdiffstats
path: root/desktop-wayland/patches
diff options
context:
space:
mode:
authorWolfgang Müller2022-10-15 18:21:15 +0200
committerWolfgang Müller2022-10-15 18:21:15 +0200
commit65e0ca998cb6c02559b8d2bb2357ee2a5248c2ca (patch)
treea322b358bd426165d879ad62fc26ff949e6ea886 /desktop-wayland/patches
parentb1abe448392d465bd1dffcf25931ecfd99b385db (diff)
downloadportage-roles-65e0ca998cb6c02559b8d2bb2357ee2a5248c2ca.tar.gz
desktop-wayland: Patch gui-wm/hikari to use high refresh rates
hikari by default does not pick the highest refresh rate for any given display, instead falling back to the first mode it finds. This patch adds rudimentary support for finding the highest supported refresh rate for the preferred resolution.
Diffstat (limited to 'desktop-wayland/patches')
-rw-r--r--desktop-wayland/patches/gui-wm/hikari/0001-Pick-highest-refresh-rate-for-preferred-resolution.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/desktop-wayland/patches/gui-wm/hikari/0001-Pick-highest-refresh-rate-for-preferred-resolution.patch b/desktop-wayland/patches/gui-wm/hikari/0001-Pick-highest-refresh-rate-for-preferred-resolution.patch
new file mode 100644
index 0000000..ab707ea
--- /dev/null
+++ b/desktop-wayland/patches/gui-wm/hikari/0001-Pick-highest-refresh-rate-for-preferred-resolution.patch
@@ -0,0 +1,45 @@
+From b15060d4191fde43e599e1fdf1beaf4a1d238075 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Wolfgang=20M=C3=BCller?= <wolf@oriole.systems>
+Date: Sun, 15 May 2022 18:20:38 +0200
+Subject: [PATCH] Pick highest refresh rate for preferred resolution
+
+When configuring an output, hikari uses the first mode it finds. This
+means that we may not end up with the highest refresh rate for a given
+resolution. Since we usually want to make use of higher refresh rates,
+find the monitor's preferred resolution and pick a corresponding mode
+with the highest refresh rate.
+---
+ src/output.c | 17 +++++++++++++----
+ 1 file changed, 13 insertions(+), 4 deletions(-)
+
+diff --git a/src/output.c b/src/output.c
+index 5b0fd56..b2a7dc6 100644
+--- a/src/output.c
++++ b/src/output.c
+@@ -254,10 +254,19 @@ hikari_output_init(struct hikari_output *output, struct wlr_output *wlr_output)
+ output->damage_destroy.notify = damage_destroy_handler;
+ wl_signal_add(&output->damage->events.destroy, &output->damage_destroy);
+
+- if (!wl_list_empty(&wlr_output->modes)) {
+- struct wlr_output_mode *mode =
+- wl_container_of(wlr_output->modes.next, mode, link);
+- wlr_output_set_mode(wlr_output, mode);
++ struct wlr_output_mode *preferred = wlr_output_preferred_mode(wlr_output);
++
++ if (preferred) {
++ struct wlr_output_mode *mode, *best = preferred;
++
++ wl_list_for_each(mode, &wlr_output->modes, link) {
++ if (mode->width == preferred->width &&
++ mode->height == preferred->height &&
++ mode->refresh > best->refresh)
++ best = mode;
++ }
++
++ wlr_output_set_mode(wlr_output, best);
+ }
+
+ wl_list_init(&output->damage_frame.link);
+--
+2.35.1
+