summaryrefslogtreecommitdiffstats
path: root/MainPanel.c
AgeCommit message (Collapse)Author
2024-01-17Clicking on column headers needs to also update the sort direction arrowDaniel Lange
2023-12-26Update includes based on IWYUBenny Baumann
2023-12-26Add includes for config.h as per the discussion in PR #1337Daniel Lange
Many thanks to @Explorer09 Kang-Che Sung (宋岡哲). Also add a #error stanza to XUtils.h in case somebody forgets the beautiful mess GNU forces on us.
2023-08-30Support dynamic screens with 'top-most' entities beyond processesSohaib Mohamed
This implements our concept of 'dynamic screens' in htop, with a first use-case of pcp-htop displaying things like top-filesystem and top-cgroups under new screen tabs. However the idea is more general than use in pcp-htop and we've paved the way here for us to collectively build mroe general tabular screens in core htop, as well. From the pcp-htop side of things, dynamic screens are configured using text-based configuration files that define the mapping for PCP metrics to columns (and metric instances to rows). Metrics are defined either directly (via metric names) or indirectly via PCP derived metric specifications. Value scaling and the units displayed is automatic based on PCP metric units and data types. This commit represents a collaborative effort of several months, primarily between myself, Nathan and BenBE. Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com> Signed-off-by: Nathan Scott <nathans@redhat.com>
2023-08-30Introduce Row and Table classes for screens beyond top-processesNathan Scott
This commit refactors the Process and ProcessList structures such they each have a new parent - Row and Table, respectively. These new classes handle screen updates relating to anything that could be represented in tabular format, e.g. cgroups, filesystems, etc, without us having to reimplement the display logic repeatedly for each new entity.
2023-05-08Introduce Machine class for host-specific info (split from ProcessList)Nathan Scott
First stage in sanitizing the process list structure so that htop can support other types of lists too (cgroups, filesystems, ...), in the not-too-distant future. This introduces struct Machine for system-wide information while keeping process-list information in ProcessList (now much less). Next step is to propogate this separation into each platform, to match these core changes.
2023-05-08Drop references to 'Process' in generic screen codeNathan Scott
Prepare the way for making screen tabs more generalised, able to cater to entities other than processes. 'actionTogglePauseProcessUpdate' -> 'actionTogglePauseUpdate' 'pauseProcessUpdate' -> 'pauseUpdate' 'hideProcessSelection' -> 'hideSelection' 'hideProcessSelection' -> 'hideSelection' Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
2022-10-20Check for action flags correctlyChristian Göttsche
Actions are not simple flags with a single bit set, but might have multiple bits set for implying actions. Do not handle an action if only an implying bit is set. Fixes: edc3de7cb597 ("Action: specify implication in code not in comments")
2022-08-09Please Clang 15Christian Göttsche
CRT.c:1015:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] void CRT_done() { ^ void
2022-03-25Improve MainPanel Label on active inc filter (Filter <-> FILTER)Daniel Lange
2021-12-07Introduce screen tabsHisham Muhammad
This is a forward port (by nathans) of Hisham's original code.
2021-09-29Adds a missing HAVE_GETMOUSE check.fraggerfox
Fixes builds failing with error MainPanel.c:65:62: error: 'Settings {aka struct Settings_}' has no member named 'enableMouse' if (ch != ERR && (ch != KEY_MOUSE || this->state->settings->enableMouse))
2021-09-22Update license headers to explicitly say GPLv2+Daniel Lange
2021-09-18MainPanel: do not reset on disabled mouse eventsChristian Göttsche
Do not reset the hidden process selection (and hidden function bar) on mouse events, when mouse support is disabled.
2021-08-22Abstract resize handling by adding a new Htop reactionChristian Göttsche
2021-04-21Make MainPanel_pidSearch a static functionChristian Göttsche
Not used elsewhere.
2021-04-14Add read-only optionChristian Göttsche
Add command line option to disable all system and process changing features.
2021-01-11Mark several non-modified pointer variables constChristian Göttsche
2021-01-06Avoid function cast by refactoring callback prototypeChristian Göttsche
2021-01-04IncSet: do not resize on our own and do not search on resizeChristian Göttsche
The supervising ScreenManager will resize all Panels. Also do not start the search on resize.
2021-01-04Add option to hide the Function BarChristian Göttsche
Support three settings: - Always show Function Bar - Always hide the Function Bar, except in Infoscreens (Env/Locks...) and when editing the search and filter mode - Hide the Function Bar on ESC until the next user input Closes: #439
2020-12-23Restore highlighted header of current sorted process columnChristian Göttsche
2020-12-20Rework drawing of FunctionBarChristian Göttsche
Draw the FunctionBar within Panel_draw instead of manually throughout the code. Add an optional PanelClass function drawFunctionBar, to allow specific panels to override the default FunctionBar_draw call. Rework the code on color change, to really change all colors (selection markers and panel headers). Closes: #402
2020-12-19Separate tree and list sort ordersHisham Muhammad
Implements the suggestion from https://github.com/htop-dev/htop/issues/399#issuecomment-747861013 Thanks to the refactors from 0bd5c8fb5da and 6393baa74e5, this was really easy and clean to do. It maintains the "Tree view always by PID" option in the Settings, which results in some specific behaviors such as "clicking on the column header to exit tree view" and "picking a new sort order to exit tree view", for the sake of the muscle memory of long time htop users. :)
2020-12-19Add "Tree view is always sorted by PID" option to mimic htop 2 behaviorHisham Muhammad
2020-12-16MainPanel: use actual KEY_RESIZE instead of KEY_SHUFFLEChristian Göttsche
KEY_RESIZE (0632) is equal to KEY_SHUFFLE (0x19a)
2020-12-15MainPanel: do not reset hideProcessSelection on KEY_SHUFFLEChristian Göttsche
KEY_SHUFFLE might get send from time to time, e.g. in a tmux session.
2020-12-02Minor code streamliningBenny Baumann
2020-12-02Implement sorting in tree modeMaxim Zhiburt
2020-11-28Hide process selection on ESCChristian Göttsche
Do not highlight the current process line after pressing ESC in the main screen. Restore after pressing any key.
2020-11-24Improving Command display/sortNarendran Gopalakrishnan
2020-11-15Mark ProcessList_keyAt argument constChristian Göttsche
2020-11-02Embracing branchesBenny Baumann
2020-11-02Spacing around operatorsBenny Baumann
2020-10-18Make all required includes explicitBenny Baumann
Information as seen by IWYU 0.12 + clang 9 on Linux
2020-10-12Add key to pause process list updatesChristian Göttsche
2020-10-12Compress size of default FunctionBarChristian Göttsche
2020-10-07Mark Object instances constChristian Göttsche
2020-10-05Update License consistently to GPLv2 as per COPYING fileDaniel Lange
2020-09-17Call character checking function with unsigned charChristian Göttsche
See https://wiki.sei.cmu.edu/confluence/display/c/STR37-C.+Arguments+to+character-handling+functions+must+be+representable+as+an+unsigned+char
2020-09-03Axe automated header generation.Zev Weiss
Reasoning: - implementation was unsound -- broke down when I added a fairly basic macro definition expanding to a struct initializer in a *.c file. - made it way too easy (e.g. via otherwise totally innocuous git commands) to end up with timestamps such that it always ran MakeHeader.py but never used its output, leading to overbuild noise when running what should be a null 'make'. - but mostly: it's just an awkward way of dealing with C code.
2020-08-20Merge branch 'hishamhm-pull-949'Nathan Scott
2020-08-20Merge branch 'hishamhm-pull-960'Nathan Scott
2020-08-20Resolve compiler warnings and errors relating to the Arg unionNathan Scott
Promote the Arg union to a core data type in Object.c such that it is visible everywhere (many source files need it), and correct declarations of several functions that use it. The Process_sendSignal function is also corrected to have the expected return type (bool, not void) - an error being masked by ignoring this not-quite-harmless warning. I've also added error checking to the kill(2) call here, which was previously overlooked / missing (?).
2019-10-31Clean up existing whitespaceDaniel Flanagan
2019-09-12MainPanel: add seventh char to main functionsduchampdev
reason: currently, for example 'search' and 'filter' look very densely packed
2018-02-18Replace size_t with int/void* unionHisham Muhammad
I was occasionally passing negative values to size_t. Plus, this better reflects the intent of the variant argument. Reported by Coverity: https://scan8.coverity.com/reports.htm#v13253/p10402/fileInstanceId=22093891&defectInstanceId=7543346&mergedDefectId=174179&fileStart=251&fileEnd=500
2017-07-22Mark some things as constRichard
Several string pointer arrays pointed to const strings but were not const themselves. A few various structures and arrays were also marked const.
2016-07-28'Follow' only if element is found in searchHisham
2016-06-15Added Ctrl+A and Ctrl+E to go to beginning and end of line.Hisham
(Also, '^' and '$') Closes #508.