summaryrefslogtreecommitdiffstats
path: root/ScreenManager.c
Commit message (Collapse)AuthorAgeFilesLines
* Abstract resize handling by adding a new Htop reactionChristian Göttsche2021-08-221-0/+4
|
* ScreenManager: reduce ScreenManager_resizeChristian Göttsche2021-08-221-13/+10
| | | | | | | | | | | | | The main change is the header hight being not included in y1. This is important if a sub-manager gets resized, e.g. a resize while editing the Settings or in a pickFromVector selection, and afterwards, then the sub-manager is closed, the super-ScreenManager gets resized, it uses the correct header hight. The header hight might have been changed since the last resize of the super-manager in the Settings by adding/removing some meters. This fixes new meters being hidden after added at runtime after a resize in the main window.
* ScreenManager: drop unused memberChristian Göttsche2021-08-101-1/+0
|
* netbsd: Support curses libraries without ncurses mouse supportnia2021-07-151-0/+2
| | | | | | | | | | | | This adds a configure check for the ncurses getmouse() function and disables mouse-related code paths when mouse support is not present in the curses library. This is necessary for stable versions of NetBSD's libcurses, the development version has stub mouse functions for compatibility with ncurses. Signed-off-by: Nia Alarie <nia@NetBSD.org>
* Check for set_escdelay in ncursesBenny Baumann2021-07-041-0/+4
|
* Request the realtime and monotonic clock times once per sampleNathan Scott2021-04-051-3/+3
| | | | | | | | | | | | | | | | Refactor the sample time code to make one call to gettimeofday (aka the realtime clock in clock_gettime, when available) and one to the monotonic clock. Stores each in more appropriately named ProcessList fields for ready access when needed. Every platform gets the opportunity to provide their own clock code, and the existing Mac OS X specific code is moved below darwin instead of in Compat. A couple of leftover time(2) calls are converted to use these ProcessList fields as well, instead of yet again sampling the system clock. Related to https://github.com/htop-dev/htop/pull/574
* Reorder the header update and process scanningNathan Scott2021-03-311-1/+2
| | | | | | | | BenBE points out that some header meters use values calculated during process scanning - make sure we scan processes first in order that current values are displayed. Related to https://github.com/htop-dev/htop/pull/574
* Separate data-update and drawing of headerChristian Göttsche2021-03-041-0/+2
|
* Use MainPanel type in State structChristian Göttsche2021-02-051-1/+5
| | | | | | | | The State struct holds a pointer to the main process panel. Use the distinct MainPanel type, to improve maintainability regrading its usage. This avoids usages of down-casts from Panel to MainPanel, only up-casts from MainPanel to Panel are now required.
* Check for sortTimeout to not run towards -infDaniel Lange2021-02-011-1/+2
| | | | | Seems to happen on Mac OS "Big Sur" (~forced application sleep) Partial fix for #510
* Mark several non-modified pointer variables constChristian Göttsche2021-01-111-3/+3
|
* Fix clearing the last line in setup on function bar change (thanks cgzones)Daniel Lange2021-01-111-1/+1
|
* Add option to hide the Function BarChristian Göttsche2021-01-041-1/+1
| | | | | | | | | | 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
* Panel: rework hight logicChristian Göttsche2021-01-041-1/+1
| | | | | | | The hight of a Panel dpends on whether the Panel has a header or not. Also the header migth not be set on Panel creation, like in the MainPanel. This currently causes the cursor to get hidden behind the FunctionBar on down-scrolling.
* Restore highlighted header of current sorted process columnChristian Göttsche2020-12-231-1/+1
|
* Rework drawing of FunctionBarChristian Göttsche2020-12-201-18/+14
| | | | | | | | | | | 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
* Fix pause mode ("Z") in tree viewDaniel Lange2020-12-091-1/+1
|
* Common order for ESC/q/F10Benny Baumann2020-12-031-2/+2
|
* Hide process selection on ESCChristian Göttsche2020-11-281-1/+1
| | | | | | Do not highlight the current process line after pressing ESC in the main screen. Restore after pressing any key.
* Drop unneeded parameters to the ScreenManager constructorNathan Scott2020-11-261-34/+25
| | | | | | | | | | All calls to ScreenManager_new always pass the same first five values, the orientation is always HORIZONTAL and the y1 parameter is always the height of the passed-in header struct pointer. I think its safe to assert at this point that no VERTICAL orientation will arrive (if it does, its no harm in re-adding this then) - so we can remove unused conditionals (and TODOs) based on orientation too.
* Merge branch 'hili-new-old' of adsr/htop into highlight-new-old-processesDaniel Lange2020-11-161-0/+1
|\
| * Highlight new and old processes (#74)Adam Saponara2020-10-301-0/+1
| |
* | Embracing branchesBenny Baumann2020-11-021-15/+37
| |
* | Spacing around operatorsBenny Baumann2020-11-021-8/+8
|/
* Continue to update generic data in paused modeChristian Göttsche2020-10-191-2/+2
| | | | | | | | | Generic data, as CPU and memory usage, are used by Meters. In paused mode they would stop receiving updates and especially Graph Meters would stop showing continuous data. Improves: #214 Closes: #253
* Make all required includes explicitBenny Baumann2020-10-181-7/+8
| | | | Information as seen by IWYU 0.12 + clang 9 on Linux
* Add key to pause process list updatesChristian Göttsche2020-10-121-10/+16
|
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Do not drop qualifier in castChristian Göttsche2020-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ListItem.c:73:33: warning: cast from 'const void *' to 'struct ListItem_ *' drops const qualifier [-Wcast-qual] ListItem* obj1 = (ListItem*) cast1; ^ ListItem.c:74:33: warning: cast from 'const void *' to 'struct ListItem_ *' drops const qualifier [-Wcast-qual] ListItem* obj2 = (ListItem*) cast2; ^ Process.c:434:28: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual] Process* p1 = (Process*)v1; ^ Process.c:435:28: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual] Process* p2 = (Process*)v2; ^ Process.c:441:36: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual] Settings *settings = ((Process*)v1)->settings; ^ Process.c:443:22: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual] p1 = (Process*)v1; ^ Process.c:444:22: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual] p2 = (Process*)v2; ^ Process.c:446:22: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual] p2 = (Process*)v1; ^ Process.c:447:22: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual] p1 = (Process*)v2; ^ AffinityPanel.c:37:16: warning: cast from 'const char *' to 'void *' drops const qualifier [-Wcast-qual] free((void*)this->text); ^ AffinityPanel.c:39:19: warning: cast from 'const char *' to 'void *' drops const qualifier [-Wcast-qual] free((void*)this->indent); ^ linux/LinuxProcess.c:294:36: warning: cast from 'const void *' to 'struct Process_ *' drops const qualifier [-Wcast-qual] Settings *settings = ((Process*)v1)->settings; ^ linux/LinuxProcess.c:296:27: warning: cast from 'const void *' to 'struct LinuxProcess_ *' drops const qualifier [-Wcast-qual] p1 = (LinuxProcess*)v1; ^ linux/LinuxProcess.c:297:27: warning: cast from 'const void *' to 'struct LinuxProcess_ *' drops const qualifier [-Wcast-qual] p2 = (LinuxProcess*)v2; ^ linux/LinuxProcess.c:299:27: warning: cast from 'const void *' to 'struct LinuxProcess_ *' drops const qualifier [-Wcast-qual] p2 = (LinuxProcess*)v1; ^ linux/LinuxProcess.c:300:27: warning: cast from 'const void *' to 'struct LinuxProcess_ *' drops const qualifier [-Wcast-qual] p1 = (LinuxProcess*)v2; ^ linux/LinuxProcessList.c:62:32: warning: cast from 'const void *' to 'struct TtyDriver_ *' drops const qualifier [-Wcast-qual] TtyDriver* a = (TtyDriver*) va; ^ linux/LinuxProcessList.c:63:32: warning: cast from 'const void *' to 'struct TtyDriver_ *' drops const qualifier [-Wcast-qual] TtyDriver* b = (TtyDriver*) vb; ^ linux/Battery.c:130:21: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual] free((char *) isOnline); ^ linux/Battery.c:197:26: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual] xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/type", entryName); ^ linux/Battery.c:209:29: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual] xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/uevent", entryName); ^ linux/Battery.c:262:29: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual] xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/online", entryName); ^
* Revert the vim_mode setting for now, needs a rethinkNathan Scott2020-09-151-16/+0
| | | | | | | | | | | | | There have been too many bugs reported in vim_mode, and the proposed fixes are increasingly fragile - hence we have decided to back it out for now. For reference: https://github.com/htop-dev/htop/issues/69 https://github.com/htop-dev/htop/pull/37 https://github.com/htop-dev/htop/pull/106 The whitespace changes also arrived in commit 12805f61d not sure what that was about, but backed out as well.
* Axe automated header generation.Zev Weiss2020-09-031-27/+0
| | | | | | | | | | | | | | 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.
* Merge branch 'hishamhm-pull-959'Nathan Scott2020-08-201-0/+16
|\
| * Add simple vim modeDaniel Flanagan2019-10-311-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a "vim_mode" setting (false/`0` by default) that causes keys to be remapped in the following way by the `ScreenManager`: + h -> LEFT + j -> DOWN + k -> UP + l -> RIGHT + LEFT -> h (toggle help) + DOWN -> j (noop) + UP -> k (open kill menu) + RIGHT -> l (lsof current process) + K (Shift+K) -> k (open kill menu) + J (Shift+J) -> K (toggle show/hide kernel threads) + L (Shift+L) -> l (lsof current process) I couldn't figure out where the manpage documentation is in the repo, though I admittedly did not look particularly hard. I believe this change would be a welcome option for heavy vim users like myself who would like a familiar way to get around in htop.
* | Added an option to disable the mouse.MartinJM2019-07-121-4/+4
|/
* Remove duplicated if conditionAlan Barr2019-02-101-5/+3
| | | | | | The for loop already handles i being < nPanels Raised by cppcheck
* Added Ctrl+A and Ctrl+E to go to beginning and end of line.Hisham2016-06-151-2/+9
| | | | | (Also, '^' and '$') Closes #508.
* Use set_escdelay() to avoid problems with ESCDELAY as a macro.Hisham2016-05-191-1/+1
|
* Fix behavior of ESC key, getting rid of the annoying delay.Hisham2016-02-191-22/+6
| | | | | Thank you @Explorer09 for the push! Closes #417.
* Check for failure in allocations.Hisham2016-02-021-1/+1
|
* vi keys: translate ALT-h/j/k/l to arrow keysMichael Klein2016-01-121-0/+23
|
* Add expand/collapse on additional clicks!Hisham Muhammad2015-08-191-1/+5
|
* Support for NCurses 6.0 and mouse wheelHisham Muhammad2015-08-191-16/+25
|
* handle clicks on panel header lineHisham Muhammad2015-03-241-28/+34
|
* incremental search and filter reintegrated!Hisham Muhammad2015-03-231-5/+9
|
* Move FunctionBar inside PanelHisham Muhammad2015-03-231-21/+3
|
* Working on integration of IncSet in new branch.Hisham Muhammad2015-03-221-7/+5
|
* Refactor state control variables.Hisham Muhammad2015-03-221-46/+53
|
* Fix allocation of processes. Closes #166.Hisham Muhammad2015-02-201-12/+0
|
* Complete cursor-based movement of headers.Hisham Muhammad2015-02-031-1/+3
|
* Another mega-patch for the refactoring process.Hisham Muhammad2015-01-231-19/+35
| | | | | Kinda runs, but functionality from the original main loop is still missing. Patience.

© 2014-2024 Faster IT GmbH | imprint | privacy policy