Commit Graph

49 Commits

Author SHA1 Message Date
Mikhail Efremov
c6e33f3048 Fix mem size calculation once more
A terminating null byte should be moved too.
Fixes commit b4266a20f8.
2018-12-11 18:43:21 +01:00
Landry Breuil
203514ff96 add proper casts around gsize calculation 2018-12-10 08:01:33 +01:00
rim
b4266a20f8 Make valngrind happy: correct calculate mem size to move 2018-12-10 07:58:01 +01:00
rim
b89684865d Better utf-8 normalization (bug 14172) 2018-08-02 08:47:51 +02:00
Landry Breuil
993ef78b81 Switch back all bzero() calls to use memset()
Even if it's uglier to use memset, bzero seems deprecated.
2018-06-03 17:56:31 +02:00
rim
f51c2b18f7 Rework the way model is iterated through (bug 14401) 2018-05-30 21:56:48 +02:00
rim
3d7f9fd794 parenthesis around addition (bug 14401) 2018-05-30 21:53:33 +02:00
rim
1c09b7329b Use the proper types, add casts where necessary (bug 14401) 2018-05-30 21:46:29 +02:00
rim
0111851b4d Stop displaying 'Running as <uid> on <hostname>' and remove corresponding code (bug 14401) 2018-05-30 21:31:52 +02:00
rim
8e1b48f8de Move getpwuid() from backends to gui, use getpwuid_r(), call only once on task add. (bug 14401) 2018-05-30 21:31:01 +02:00
rim
66a0d4bfc9 Mark unused params, remove unused macro and args (bug 14401) 2018-05-30 21:29:28 +02:00
rim
ceb5a7d347 Make pid type: GPid (bug 14401) 2018-05-30 21:28:35 +02:00
Landry Breuil
c507f13d86 declarations at the beginning of functions (ISO C90 forbids mixed declarations and code) 2018-05-28 21:06:39 +02:00
rim
8d4f013877 Simplify WNCK #ifdefs 2018-05-28 21:05:17 +02:00
Rozhuk Ivan
fd9e313e2e Make sure only printable characters are used in the pretty cmdline display (bug 14172) 2018-05-27 12:00:01 +02:00
Rozhuk Ivan
fd149b63df Rework the way the model is updated (bug 14403)
- 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..
2018-05-27 11:35:00 +02:00
rim
a76b13057c Use sizeof in get_hostname (bug 14401) 2018-05-27 11:04:42 +02:00
rim
4d4d0b5073 Add a function comparing tasks (bug 14403) 2018-05-26 23:48:46 +02:00
rim
5e0fb6f4bc Use sizeof() when appropriate instead of hardcoding values (bug 14401, bug 14403) 2018-05-26 23:19:55 +02:00
Simon Steinbeiss
c1de490489 Tone down the colors in the treeview 2014-12-18 13:28:04 +01:00
Harald Judt
134e0c278f Use g_format_size_full with G_FORMAT_SIZE_IEC_UNITS for RAM
This makes it more consistent with what other tools report.
2014-12-07 13:37:53 +01:00
Landry Breuil
c6c74cd959 Display the memory usage as bytes instead of a percentage when show-memory-in-xbytes is set (#6503)
- 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
2014-12-04 20:52:12 +01:00
Landry Breuil
76dd1025e9 Remove memory_human_size and use g_format_size instead 2014-12-04 20:39:26 +01:00
Landry Breuil
59ed589b26 Use g_strlcpy() instead of g_snprintf(dest, strlen(dest), "%s", src)
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.
2014-11-29 11:48:38 +01:00
Landry Breuil
92675eba53 Use g_utf8_strlen(text, -1) to check for text length, not sizeof(text) which is the size of a pointer and always > 3 2014-11-29 11:41:58 +01:00
Nick Schermer
b367fdd1a9 Fix compiler warnings. 2014-01-08 19:35:17 +01:00
Mike Massonnet
81bdc6d2ba Fix compiler warnings (original patches from Enrico Tröger)
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.
2010-06-08 22:41:50 +02:00
Mike Massonnet
2f995e8226 Display window icons/names
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.
2010-06-04 15:31:45 +02:00
Mike Massonnet
bb4c139c73 Fix g_snprintf call for task name
Don't pass task name as format, instead call g_snprintf safely with "%s"
and pass the task name as an argument.
2010-06-03 23:46:55 +02:00
Mike Massonnet
46174f188c Update command line when needed 2010-06-02 16:27:47 +02:00
Mike Massonnet
06921c3ac1 Plug a dynamic leak
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.
2010-06-02 01:02:40 +02:00
Mike Massonnet
8d32b99253 Replace carriage returns against spaces in commands 2010-05-28 15:48:08 +02:00
Mike Massonnet
ad3391bb95 Show tasks with changed status with a yellow background 2010-05-28 01:32:02 +02:00
Mike Massonnet
fe31827852 Show terminated tasks with a red background 2010-05-27 01:21:26 +02:00
Mike Massonnet
e3d3aa2e18 Show started tasks with a green background 2010-05-26 22:35:34 +02:00
Mike Massonnet
ede8aa2580 Drop foced debug output of initial tasks 2010-05-24 02:27:19 +02:00
Mike Massonnet
4dc36d296a Hide Swap usage from statusbar when swap total equals zero 2010-05-23 19:57:25 +02:00
Mike Massonnet
9a26498a8b Implement option “Full command line” 2010-05-23 13:08:45 +02:00
Mike Massonnet
f5e7344a8b Implement option “More precision” 2010-05-23 00:47:02 +02:00
Mike Massonnet
d212ce6b43 Fix compiler warnings from --enable-debug=yes
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.
2010-05-21 15:14:32 +02:00
Mike Massonnet
b961822ba4 Move POSIX code to task-manager.c
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.
2010-05-16 12:30:37 +02:00
Mike Massonnet
7239d4bbb0 Display memory values < 1 MiB
Fixed the MB “typo” and show values for memory in KiB or B if needed.
The threshold for displaying KiB (< 4 MiB) or B (< 9 KiB) are based on
impulse.
2010-05-10 17:57:51 +02:00
Mike Massonnet
9a6cdd2ff3 Filter tree view with show-all-processes
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.
2010-05-10 17:03:27 +02:00
Mike Massonnet
07131a81b3 Context menu for sending signals and setting priorities
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.
2010-05-09 00:51:46 +02:00
Mike Massonnet
239c5d5064 Enhance performance by updating the GtkTreeModel inside the TaskManager
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.
2010-05-07 21:52:33 +02:00
Mike Massonnet
a02bf69573 Show list of tasks
Provide the list of tasks through a GArray and parse it in main.c to
update the GtkTreeModel.
2010-05-05 09:02:04 +02:00
Mike Massonnet
71d1684696 Add precision to memory/swap and CPU
Switched all the gushort against gfloat data types for the memory, swap
and CPU usages. Show them with a precision of two decimals in the GUI.
2010-05-02 17:03:58 +02:00
Mike Massonnet
4f04ca5cb7 Read information from memory/swap and CPU
This commit is the second of an incremental serie. There will be other
commits with the information about tasks and the support for BSD and
Solaris once things are settled.

The TaskManager class is build with a new source task-manager-linux.c
that provides functions specific to the Linux implementation. It has
functions to read the usage of the memory/swap and the CPU.
2010-05-02 17:00:30 +02:00
Mike Massonnet
9a49bf015a Initial TaskManager class and make room for Swap
Added the TaskManager class to hold system information and tasks.
Currently it provides username and hostname based on POSIX functions.
The Swap is now part of the system information and is being displayed in
the statusbar.
2010-05-02 17:00:30 +02:00