From: Arnaldo Carvalho de Melo Date: Wed, 9 Apr 2025 19:02:43 +0000 (-0300) Subject: perf ui browser: Accept the left arrow key as a Zoom out if done on the first column X-Git-Tag: v6.16-rc1~57^2~191 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=92c48ec231e2e73356418bdece2b8af855cf85b2;p=thirdparty%2Flinux.git perf ui browser: Accept the left arrow key as a Zoom out if done on the first column In the past (like before 2015) we had the familiar workflow of using ENTER to get the menu and then zoom on a pid or DSO, kernel, etc and then use UP and DOWN to navigate further, etc, and then when wanting to go to the previous level, i.e. to Zoom out, use the LEFT arrow key. This way the right hand stays in the arrow keys block that is near the enter and we can go around real quickly. But then, when we started supporting horizontal scrolling by columns to support things like 'perf c2c report' that has lots of columns, we switched to using the LEFT key exclusively for that, horizontal scrolling, requiring the user to press 'm' to get a "context menu" that then would allow users to select the Zoom out operation. Ingo recently reported this as not intuitive, which is true, so lets overload the LEFT key with both meanings, by doing a Zoom out operation if the LEFT key is pressed when we're on the first column, but use it also for horizontal scrolling if it is pressed when the cursor is on column > 1. Reported-by: Ingo Molnar Tested-by: Ingo Molnar Cc: Adrian Hunter Cc: Ian Rogers Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Namhyung Kim Link: https://lore.kernel.org/r/Z_TYux5fUg2pW-pF@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c index 115aa1af5a021..dc88427b4ae5a 100644 --- a/tools/perf/ui/browser.c +++ b/tools/perf/ui/browser.c @@ -459,6 +459,8 @@ int ui_browser__run(struct ui_browser *browser, int delay_secs) goto out; if (browser->horiz_scroll != 0) --browser->horiz_scroll; + else + goto out; break; case K_PGDN: case ' ':