From a5a26cfa86fca47f73f09e1f958560af237c81e9 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 21 Mar 2019 18:15:58 -0500 Subject: [PATCH] powertop: patch to fix vertical scrolling From mailing list (thanks!). --- pkgs/os-specific/linux/powertop/default.nix | 5 ++++- .../linux/powertop/fix-vertical-scrolling.patch | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 pkgs/os-specific/linux/powertop/fix-vertical-scrolling.patch diff --git a/pkgs/os-specific/linux/powertop/default.nix b/pkgs/os-specific/linux/powertop/default.nix index 54fdfb354d1f..691b216073fd 100644 --- a/pkgs/os-specific/linux/powertop/default.nix +++ b/pkgs/os-specific/linux/powertop/default.nix @@ -20,7 +20,10 @@ stdenv.mkDerivation rec { url = "https://git.alpinelinux.org/cgit/aports/plain/main/powertop/strerror_r.patch?id=3b9214d436f1611f297b01f72469d66bfe729d6e"; sha256 = "1kzddhcrb0n2iah4lhgxwwy4mkhq09ch25jjngyq6pdj6pmfkpfw"; } - ); + ) ++ [ + # Fix vertical scrolling, see: https://lists.01.org/pipermail/powertop/2019-March/002046.html + ./fix-vertical-scrolling.patch + ]; postPatch = '' substituteInPlace src/main.cpp --replace "/sbin/modprobe" "modprobe" diff --git a/pkgs/os-specific/linux/powertop/fix-vertical-scrolling.patch b/pkgs/os-specific/linux/powertop/fix-vertical-scrolling.patch new file mode 100644 index 000000000000..b9b3fdbaf343 --- /dev/null +++ b/pkgs/os-specific/linux/powertop/fix-vertical-scrolling.patch @@ -0,0 +1,13 @@ +diff --git a/src/display.cpp b/src/display.cpp +index 07227c5..7b3a7a2 100644 +--- a/src/display.cpp ++++ b/src/display.cpp +@@ -244,7 +244,7 @@ void cursor_down(void) + w = tab_windows[tab_names[current_tab]]; + if (w) { + if (w->ypad_pos < 1000) { +- if (tab_names[current_tab] == "Tunables" || "WakeUp") { ++ if (tab_names[current_tab] == "Tunables" || tab_names[current_tab] == "WakeUp") { + if ((w->cursor_pos + 7) >= LINES) { + prefresh(w->win, ++w->ypad_pos, w->xpad_pos, + 1, 0, LINES - 3, COLS - 1);