Skip to content

Commit 18926fb

Browse files
author
Stanisław
committed
Merge branch 'unstable'
2 parents fd607aa + 8abd007 commit 18926fb

7 files changed

+58
-40
lines changed

data/com.github.stsdc.monitor.appdata.xml.in

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@
2525
<url type="help">https://github.com/stsdc/monitor/issues</url>
2626

2727
<releases>
28-
<release version="0.6.1" date="2019-11-13">
28+
<release version="0.6.2" date="2019-12-21">
2929
​ <description>
3030
​ <ul>
31-
<li> Update Portuguese translation (Hugo Carvalho)</li>
32-
<li> Update French translation (Nathan Bonnemains and Skeudwenn)</li>
33-
<li> Fix: Don't show swap percentage when it's not available (Ryo Nakano) </li>
31+
<li> Bugfix (potential) of crushes and high CPU usage</li>
32+
<li> Update German translation (Carsten Dietrich)</li>
3433
</ul>
3534
​ </description>
3635
​ </release>

data/meson.build

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ icon_sizes = ['16', '24', '32', '48', '64', '128']
33
foreach i : icon_sizes
44
install_data(
55
join_paths('icons', i, meson.project_name() + '.svg'),
6-
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i, 'apps')
6+
install_dir: join_paths(icondir, i + 'x' + i, 'apps')
77
)
88
install_data(
99
join_paths('icons', i, meson.project_name() + '.svg'),
10-
install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', i + 'x' + i + '@2', 'apps')
10+
install_dir: join_paths(icondir, i + 'x' + i + '@2', 'apps')
1111
)
1212
endforeach
1313

1414
install_data(
1515
meson.project_name() + '.gschema.xml',
16-
install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas')
16+
install_dir: join_paths(datadir, 'glib-2.0', 'schemas')
1717
)
1818

1919
i18n.merge_file(
@@ -22,13 +22,13 @@ i18n.merge_file(
2222
po_dir: join_paths(meson.source_root(), 'po', 'extra'),
2323
type: 'desktop',
2424
install: true,
25-
install_dir: join_paths(get_option('datadir'), 'applications')
25+
install_dir: join_paths(datadir, 'applications')
2626
)
2727

2828
i18n.merge_file(
2929
input: meson.project_name() + '.appdata.xml.in',
3030
output: meson.project_name() + '.appdata.xml',
3131
po_dir: join_paths(meson.source_root(), 'po', 'extra'),
3232
install: true,
33-
install_dir: join_paths(get_option('datadir'), 'metainfo')
33+
install_dir: join_paths(datadir, 'metainfo')
3434
)

debian/changelog

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
com.github.stsdc.monitor (0.6.2) bionic; urgency=low
2+
3+
* Bugfix (potential) of crushes and high CPU usage
4+
* Update German translation (Carsten Dietrich)
5+
6+
-- Stanisław Dac <[email protected]> Sat, 21 Dec 2019 14:06:37 +0100
7+
18
com.github.stsdc.monitor (0.6.1) bionic; urgency=low
29

310
* Update Portuguese translation (Hugo Carvalho)

meson.build

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11

2-
project('com.github.stsdc.monitor', 'vala', 'c', version: '0.6.0')
2+
project('com.github.stsdc.monitor', 'vala', 'c', version: '0.6.2')
33

44
# these are Meson modules
55
gnome = import('gnome')
66
i18n = import('i18n')
77

8+
# common dirs
9+
prefix = get_option('prefix')
10+
datadir = join_paths(prefix, get_option('datadir'))
11+
libdir = join_paths(prefix, get_option('libdir'))
12+
icondir = join_paths(datadir, 'icons', 'hicolor')
13+
814
# and these are project dependencies
915
glib = dependency('glib-2.0')
1016
granite = dependency('granite', version: '>= 5.2.0')
@@ -106,9 +112,7 @@ shared_module(
106112
wingpanel
107113
],
108114
install: true,
109-
install_dir : wingpanel.get_pkgconfig_variable('indicatorsdir'),
110-
# install_dir : '/usr/lib/x86_64-linux-gnu/wingpanel/'
111-
115+
install_dir : wingpanel.get_pkgconfig_variable('indicatorsdir', define_variable: ['libdir', libdir]),
112116
)
113117

114118
# Add in a post install script

po/de.po

+4-17
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,20 @@ msgid "Monitor"
2929
msgstr "Monitor"
3030

3131
#: src/Widgets/Headerbar.vala:23
32-
#, fuzzy
3332
msgid "End Process"
3433
msgstr "Prozess beenden"
3534

3635
#: src/Widgets/Headerbar.vala:26
37-
#, fuzzy
3836
msgid "End selected process"
39-
msgstr "Prozess beenden"
37+
msgstr "Ausgewählten Prozess beenden"
4038

4139
#: src/Widgets/Headerbar.vala:30
42-
#, fuzzy
4340
msgid "Kill Process"
44-
msgstr ""
41+
msgstr "Prozess abwürgen"
4542

4643
#: src/Widgets/Headerbar.vala:32
4744
msgid "Kill selected process"
48-
msgstr ""
45+
msgstr "Ausgewählten Prozess abwürgen"
4946

5047
#: src/Widgets/Headerbar.vala:42
5148
msgid "Settings"
@@ -93,9 +90,8 @@ msgid "Search Process"
9390
msgstr "Suche Prozess"
9491

9592
#: src/Widgets/Search.vala:15
96-
#, fuzzy
9793
msgid "Type process name or PID to search"
98-
msgstr "Geben Sie den Prozessnamen oder PID ein"
94+
msgstr "Geben Sie den zu suchenden Prozessnamen oder die PID ein"
9995

10096
#: src/Widgets/Statusbar/Statusbar.vala:12
10197
#: src/Widgets/Statusbar/Statusbar.vala:16
@@ -105,12 +101,3 @@ msgstr "Berechne…"
105101
#: src/Models/GenericModel.vala:274
106102
msgid "Background Applications"
107103
msgstr "Hintergrundanwendungen"
108-
109-
#~ msgid "Ctrl+E"
110-
#~ msgstr "Strg+E"
111-
112-
#~ msgid "CPU:"
113-
#~ msgstr "CPU:"
114-
115-
#~ msgid "Memory:"
116-
#~ msgstr "Arbeitsspeicher:"

src/Models/GenericModel.vala

+31-9
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,18 @@ namespace Monitor {
161161
return true;
162162
}
163163

164+
// THE BUG IS SOMEWHERE IN HERE
164165
// reparent children to background processes
165-
private void reparent (Gtk.TreeIter iter) {
166+
private void reparent (ref Gtk.TreeIter iter) {
166167
Gtk.TreeIter child_iter;
168+
Value pid_value_prev;
169+
167170
while (iter_children (out child_iter, iter)) {
168171
Value pid_value;
169172
get_value (child_iter, Column.PID, out pid_value);
173+
pid_value_prev = pid_value;
174+
debug( "reparent %d", pid_value.get_int ());
175+
170176
add_process_to_row (background_apps_iter, pid_value.get_int ());
171177
}
172178
}
@@ -176,10 +182,26 @@ namespace Monitor {
176182
// if process rows has pid
177183
if (process_rows.has_key (pid)) {
178184
var row = process_rows.get (pid);
179-
var iter = row.iter;
180-
reparent (iter);
181-
// remove row from model
182-
remove (ref iter);
185+
Gtk.TreeIter iter = row.iter;
186+
187+
debug ("remove process: user_data %d, stamp %d", (int) iter.user_data, iter.stamp);
188+
189+
Value pid_value;
190+
get_value (iter, Column.PID, out pid_value);
191+
192+
// Column.NAME, for example returns (null)
193+
// Column.PID return 0
194+
195+
debug("removing %d", pid_value.get_int());
196+
197+
// sometimes iter has null values
198+
// this potentially should prevent segfaults
199+
if (pid_value.get_int() != 0) {
200+
reparent (ref iter);
201+
// remove row from model
202+
remove (ref iter);
203+
}
204+
183205
// remove row from row cache
184206
process_rows.unset (pid);
185207
}
@@ -223,7 +245,7 @@ namespace Monitor {
223245
// reparenting it and it's children if it already exists.
224246
private bool add_process_to_row (Gtk.TreeIter row, int pid) {
225247
var process = process_manager.get_process (pid);
226-
debug ("add_process_to_row %d", pid);
248+
debug ("add_process_to_row pid:%d", pid);
227249

228250
if (process != null) {
229251
// if process is already in list, then we need to reparent it and it's children
@@ -252,9 +274,9 @@ namespace Monitor {
252274
// i.e. skip if subprocess is already in but isn't an ancestor of this process row
253275
if (process_rows.has_key (sub_pid) && (
254276
(old_location != null && !is_ancestor (old_location, process_rows[sub_pid].iter))
255-
|| old_location == null))
256-
continue;
257-
277+
|| old_location == null)) {
278+
continue;
279+
}
258280
add_process_to_row (iter, sub_pid);
259281
}
260282

src/Widgets/OverallView.vala

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ namespace Monitor {
6565
pid_column.expand = false;
6666
pid_column.alignment = 0.5f;
6767
pid_column.set_sort_column_id (Column.PID);
68-
pid_column.pack_start (pid_cell, false);
6968
pid_column.add_attribute (pid_cell, "text", Column.PID);
7069
insert_column (pid_column, -1);
7170

0 commit comments

Comments
 (0)