MemAvailable is in /proc/meminfo since Linux 3.14.
This aligns the reported memory usage with the memory usage
reported by xfce4-systemload-plugin.
Closes!10
- Do more lazy updates
- More robust to quick process creation/deletion
- Use bsearch to look in the sorted list of processes.
Should consume less resources..
- move the percentage calculation to init_timeout(), use g_format_size() here too
- carry memory/swap used vs total all around
- make the XtmProcessStatusbar swap and memory properties strings instead of float
Based on a diff from Ján Sucan, thanks!
Note to translators: this changes some strings, mostly removing % in format printing
Fixes a SIGABRT at startup on OpenBSD, for some reason deep in the glib/libc
stack the va_list arg p is lost.. g_strlcpy() is equivalent here, and even faster.
Add missing include for geteuid() missing declaration
xtm_process_window_show_swap_usage() in process-window.
Fix various compiler warnings from main.c task-manager.c and
app-manager.c.
Add optional link on libwnck (default=yes) and build a new object from
app-manager.c to keep an up to date list of applications with their name
and icon. Use it inside the task manager object to display inside the
tree view.
A leak occured in the timer code, and thus the memory was growing over
time. Cf. src/task-manager.c(model_update_tree_iter), the old_state
variable was not free'd.
Plugged other static leaks at the same time.
Fixed old-style function definitions, dropped unused variables, renamed
signal to xtm_signal (it shadowed a previous global declaration from
signal.h,) dropped the G_UN/LIKELY calls, missing includes and casted
here and there.
The task-manager-*.c files /would/ have to be individually fixed.
The functions send_signal_to_pid() and set_priority_to_pid() are using
POSIX functions and “should” be safe in task-manager.c. Still keep the
enumeration as a bridge between virtual values and real values, there is
no benefit removing them (wasting minutes) and it won't make the code
look better (or worse).
The functions have been removed from the Linux and BSD implementations.
Switched the get_hostname() get_owner_uid() public in task-manager.c,
the owner uid is needed in the tree view class in order to filter out
user processes from others.
Base signals and priorities are defined inside the task-manager.h file
to be reused as general values inside the interface. The different OS
implementations have to do the conversion from the enumeration to real
values.
The code to update the model has been moved inside the XtmTaskManager
class and this in order to enhance performance. In fact all the rows of
the model were udpdated everytime (150~ processes × 9 columns calls on
gtk_list_store_set per seconds) which represented a big CPU hog. Now
that the model is being updated within the same class that pulls the
processes information it is possible to run low check routines and
update only the rows that have updated information.
Also big surprise, the new tasks weren't added, well they did but not
the right data. The pointer's location was copied instead of the
pointer's content.