Add some patches

This commit is contained in:
longcheng 2022-08-04 10:37:58 +08:00
parent 12b99868cc
commit 11d483f9b4
9 changed files with 551 additions and 3 deletions

View File

@ -0,0 +1,160 @@
From 886647b9f8d0454caacb6c548bdd5a88bfd3d958 Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Thu, 14 Jul 2022 05:14:44 -0400
Subject: [PATCH] fix(*):add cpu-color key to 127 for solve the quit bug when
change the color of cpu when cpu>95
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 增加cpu-color key到127解决cpu>95个情况下切换cpu显示颜色闪退问题
Related #45073
---
src/org.mate.system-monitor.gschema.xml.in | 130 ++++++++++++++++++++-
1 file changed, 129 insertions(+), 1 deletion(-)
diff --git a/src/org.mate.system-monitor.gschema.xml.in b/src/org.mate.system-monitor.gschema.xml.in
index 1183469..3879b54 100644
--- a/src/org.mate.system-monitor.gschema.xml.in
+++ b/src/org.mate.system-monitor.gschema.xml.in
@@ -435,7 +435,135 @@
<key name="cpu-color95" type="s">
<default>'#06FFDA'</default>
<summary>Default graph CPU color</summary>
- </key>
+ </key>
+ <key name="cpu-color96" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color97" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color98" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color99" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color100" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color101" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color102" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color103" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color104" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color105" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color106" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color107" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color108" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color109" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color110" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color111" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color112" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color113" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color114" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color115" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color116" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color117" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color118" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color119" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color120" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color121" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color122" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color123" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color124" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color125" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color126" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
+ <key name="cpu-color127" type="s">
+ <default>'#06FFDA'</default>
+ <summary>Default graph CPU color</summary>
+ </key>
<key name="mem-color" type="s">
<default>'#AB1852'</default>
<summary>Default graph memory color</summary>
--
2.33.0

View File

@ -0,0 +1,142 @@
From 79a028768f2e6ac28bf425e6597ff8aa61741456 Mon Sep 17 00:00:00 2001
From: songchuanfei <songchuanfei@kylinos.com.cn>
Date: Wed, 13 Jul 2022 05:56:39 -0400
Subject: [PATCH] fix[resource]: Fix resource page too large when system has
too many cpus
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复系统CPU数很多时资源页面太长无法看到全部的问题
Fixes #23294
Signed-off-by: songchuanfei <songchuanfei@kylinos.com.cn>
---
src/gsm_color_button.c | 8 +++-----
src/interface.cpp | 7 ++++++-
src/load-graph.cpp | 11 +----------
3 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/src/gsm_color_button.c b/src/gsm_color_button.c
index 3148c34..35d2710 100644
--- a/src/gsm_color_button.c
+++ b/src/gsm_color_button.c
@@ -227,7 +227,7 @@ fill_image_buffer_from_file (cairo_t *cr, const char *filePath)
static void
-render (GtkWidget * widget)
+render (GtkWidget * widget, cairo_t *cr)
{
GSMColorButtonPrivate *priv;
GSMColorButton *color_button = GSM_COLOR_BUTTON (widget);
@@ -236,7 +236,6 @@ render (GtkWidget * widget)
GdkRGBA *color;
GdkRGBA tmp_color = priv->color;
color = &tmp_color;
- cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));
cairo_path_t *path = NULL;
gint width, height;
gdouble radius, arc_start, arc_end;
@@ -405,13 +404,12 @@ render (GtkWidget * widget)
break;
}
- cairo_destroy (cr);
}
/* Handle exposure events for the color picker's drawing area */
static gboolean draw (GtkWidget * widget, cairo_t * cr, gpointer data)
{
- render (GTK_WIDGET (data));
+ render (GTK_WIDGET (data), cr);
return FALSE;
}
@@ -420,7 +418,7 @@ static void
gsm_color_button_realize (GtkWidget * widget)
{
GTK_WIDGET_CLASS (gsm_color_button_parent_class)->realize (widget);
- render (widget);
+ gtk_widget_queue_draw(widget);
}
static void gsm_color_button_get_preferred_width (GtkWidget * widget, gint * minimum_width, gint * natural_width)
diff --git a/src/interface.cpp b/src/interface.cpp
index 2a5cbbf..e38915a 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -261,6 +261,7 @@ make_title_label (const char *text)
static GtkWidget *
create_sys_view (ProcData *procdata)
{
+ GtkWidget *scrolled;
GtkWidget *vbox, *hbox;
GtkWidget *cpu_box, *mem_box, *net_box;
GtkWidget *cpu_graph_box, *mem_graph_box, *net_graph_box;
@@ -277,6 +278,8 @@ create_sys_view (ProcData *procdata)
gchar *label_text;
gchar *title_template;
+ scrolled = gtk_scrolled_window_new(NULL, NULL);
+
// Translators: color picker title, %s is CPU, Memory, Swap, Receiving, Sending
title_template = g_strdup(_("Pick a Color for '%s'"));
@@ -558,7 +561,9 @@ create_sys_view (ProcData *procdata)
procdata->net_graph = net_graph;
g_free(title_template);
- return vbox_top;
+ gtk_container_add(GTK_CONTAINER(scrolled), vbox);
+
+ return scrolled;
}
static void
diff --git a/src/load-graph.cpp b/src/load-graph.cpp
index b24f977..2e294b9 100644
--- a/src/load-graph.cpp
+++ b/src/load-graph.cpp
@@ -220,7 +220,7 @@ load_graph_configure (GtkWidget *widget,
return TRUE;
}
-static gboolean load_graph_draw (GtkWidget *widget, cairo_t *context, gpointer data_ptr)
+static gboolean load_graph_draw (GtkWidget *widget, cairo_t *cr, gpointer data_ptr)
{
LoadGraph * const graph = static_cast<LoadGraph*>(data_ptr);
GdkWindow *window;
@@ -239,10 +239,6 @@ static gboolean load_graph_draw (GtkWidget *widget, cairo_t *context, gpointer d
x_offset += graph->rmargin - ((sample_width / graph->frames_per_unit) * graph->render_counter);
/* draw the graph */
- cairo_t* cr;
-
- cr = gdk_cairo_create (window);
-
if (graph->background == NULL) {
draw_background(graph);
}
@@ -252,9 +248,6 @@ static gboolean load_graph_draw (GtkWidget *widget, cairo_t *context, gpointer d
cairo_set_line_width (cr, 1);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
- cairo_rectangle (cr, graph->rmargin + graph->indent + FRAME_WIDTH + 1, FRAME_WIDTH - 1,
- graph->draw_width - graph->rmargin - graph->indent - 1, graph->real_draw_height + FRAME_WIDTH - 1);
- cairo_clip(cr);
for (j = 0; j < graph->n; ++j) {
cairo_move_to (cr, x_offset, (1.0f - graph->data[0][j]) * graph->real_draw_height);
@@ -275,8 +268,6 @@ static gboolean load_graph_draw (GtkWidget *widget, cairo_t *context, gpointer d
}
- cairo_destroy (cr);
-
return TRUE;
}
--
2.33.0

View File

@ -0,0 +1,53 @@
From ac0e4fe10113a41df45530b8f151b97b8411078c Mon Sep 17 00:00:00 2001
From: mazhiguo <mazhiguo@kylinos.com.cn>
Date: Thu, 5 Sep 2019 08:34:22 -0400
Subject: [PATCH] kylin modify desktop
---
mate-system-monitor.desktop.in | 2 +-
mate-system-monitor.desktop.in.in | 2 +-
po/zh_CN.po | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mate-system-monitor.desktop.in b/mate-system-monitor.desktop.in
index 27a9e11..483b18c 100644
--- a/mate-system-monitor.desktop.in
+++ b/mate-system-monitor.desktop.in
@@ -8,7 +8,7 @@ Icon=utilities-system-monitor
Terminal=false
Type=Application
StartupNotify=true
-Categories=GTK;System;Monitor;
+Categories=GTK;System;Monitor;X-Common-Features;X-System-Server;
Keywords=MATE;system;monitor;process;list;view;current;resources;
OnlyShowIn=MATE;
X-MATE-Bugzilla-Bugzilla=MATE
diff --git a/mate-system-monitor.desktop.in.in b/mate-system-monitor.desktop.in.in
index 6085693..afebdcb 100644
--- a/mate-system-monitor.desktop.in.in
+++ b/mate-system-monitor.desktop.in.in
@@ -8,7 +8,7 @@ Icon=utilities-system-monitor
Terminal=false
Type=Application
StartupNotify=true
-Categories=GTK;System;Monitor;
+Categories=GTK;System;Monitor;X-Common-Features;X-System-Server;
Keywords=MATE;system;monitor;process;list;view;current;resources;
OnlyShowIn=MATE;
X-MATE-Bugzilla-Bugzilla=MATE
diff --git a/po/zh_CN.po b/po/zh_CN.po
index a21f198..90565a9 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -45,7 +45,7 @@ msgstr ""
#: ../mate-system-monitor.desktop.in.in.h:1
msgid "MATE System Monitor"
-msgstr "MATE 系统监视器"
+msgstr "系统监视器"
#: ../mate-system-monitor.desktop.in.in.h:2 ../src/callbacks.cpp:203
#: ../src/interface.cpp:625 ../src/procman.cpp:713
--
2.18.1

View File

@ -0,0 +1,22 @@
From 3a6a8d78d2848b971ccc1994279474248e285b41 Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Mon, 20 Jul 2020 17:13:24 +0800
Subject: [PATCH 1/2] modify mate-system-monitor.desktop.in.in
---
mate-system-monitor.desktop.in.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mate-system-monitor.desktop.in.in b/mate-system-monitor.desktop.in.in
index afebdcb..f1c9986 100644
--- a/mate-system-monitor.desktop.in.in
+++ b/mate-system-monitor.desktop.in.in
@@ -15,4 +15,4 @@ X-MATE-Bugzilla-Bugzilla=MATE
X-MATE-Bugzilla-Product=system-monitor
X-MATE-Bugzilla-Component=general
X-MATE-Bugzilla-Version=@VERSION@
-
+X-KIRAN-NoDisplay=true
--
2.18.1

View File

@ -0,0 +1,22 @@
From a58f28475ce48c4da54d7e1027a887e077a6d494 Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Mon, 20 Jul 2020 17:14:12 +0800
Subject: [PATCH 2/2] modify mate-system-monitor.desktop.in
---
mate-system-monitor.desktop.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mate-system-monitor.desktop.in b/mate-system-monitor.desktop.in
index 483b18c..8024100 100644
--- a/mate-system-monitor.desktop.in
+++ b/mate-system-monitor.desktop.in
@@ -15,4 +15,4 @@ X-MATE-Bugzilla-Bugzilla=MATE
X-MATE-Bugzilla-Product=system-monitor
X-MATE-Bugzilla-Component=general
X-MATE-Bugzilla-Version=1.22.2
-
+X-KIRAN-NoDisplay=true
--
2.18.1

View File

@ -0,0 +1,42 @@
From 109131eb4925a9c5da7a260d0f223ffd438b203c Mon Sep 17 00:00:00 2001
From: yuanxing <yuanxing@kylinos.com.cn>
Date: Wed, 20 Oct 2021 14:26:34 +0800
Subject: [PATCH 1006/1006] fix(*):get pcpu with double to solve the cpu% don't
changed bug
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将获取的pcpu的值定义为double类型解决cpu%不变化的问题
Related #45071
---
src/proctable.cpp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/proctable.cpp b/src/proctable.cpp
index f2eb3b5..6601cc6 100644
--- a/src/proctable.cpp
+++ b/src/proctable.cpp
@@ -804,12 +804,15 @@ update_info (ProcData *procdata, ProcInfo *info)
guint64 difference = proctime.rtime - info->cpu_time;
if (difference > 0)
info->status = GLIBTOP_PROCESS_RUNNING;
- info->pcpu = difference * 100 / procdata->cpu_total_time;
- info->pcpu = MIN(info->pcpu, 100);
+
+ double pcpu = difference * 100.0 / procdata->cpu_total_time * 1.0;
+ if(pcpu >100)
+ pcpu = 100;
if (not procdata->config.solaris_mode)
- info->pcpu *= procdata->config.num_cpus;
+ pcpu *= procdata->config.num_cpus;
+ info->pcpu = int(pcpu);
ProcInfo::cpu_times[info->pid] = info->cpu_time = proctime.rtime;
info->nice = procuid.nice;
--
2.27.0

View File

@ -0,0 +1,38 @@
From e6a061774882cff2e7d31e54828af78e605a65c3 Mon Sep 17 00:00:00 2001
From: longcheng <longcheng@kylinos.com.cn>
Date: Fri, 14 Jan 2022 14:29:21 +0800
Subject: [PATCH] fix(control center): fix mate system monitor is not displayed
in the control panel
---
mate-system-monitor.desktop.in | 1 -
mate-system-monitor.desktop.in.in | 1 -
2 files changed, 2 deletions(-)
diff --git a/mate-system-monitor.desktop.in b/mate-system-monitor.desktop.in
index 8024100..c967fbc 100644
--- a/mate-system-monitor.desktop.in
+++ b/mate-system-monitor.desktop.in
@@ -10,7 +10,6 @@ Type=Application
StartupNotify=true
Categories=GTK;System;Monitor;X-Common-Features;X-System-Server;
Keywords=MATE;system;monitor;process;list;view;current;resources;
-OnlyShowIn=MATE;
X-MATE-Bugzilla-Bugzilla=MATE
X-MATE-Bugzilla-Product=system-monitor
X-MATE-Bugzilla-Component=general
diff --git a/mate-system-monitor.desktop.in.in b/mate-system-monitor.desktop.in.in
index f1c9986..a0b4f9f 100644
--- a/mate-system-monitor.desktop.in.in
+++ b/mate-system-monitor.desktop.in.in
@@ -10,7 +10,6 @@ Type=Application
StartupNotify=true
Categories=GTK;System;Monitor;X-Common-Features;X-System-Server;
Keywords=MATE;system;monitor;process;list;view;current;resources;
-OnlyShowIn=MATE;
X-MATE-Bugzilla-Bugzilla=MATE
X-MATE-Bugzilla-Product=system-monitor
X-MATE-Bugzilla-Component=general
--
2.27.0

View File

@ -0,0 +1,50 @@
From 9e756f149a2c06dfcd37505b4fd35b6b64f77ab8 Mon Sep 17 00:00:00 2001
From: rbuj <robert.buj@gmail.com>
Date: Sun, 15 Nov 2020 17:01:23 +0100
Subject: [PATCH] sysinfo: avoid adding a device more than once such as for
brtfs
---
src/sysinfo.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/sysinfo.cpp b/src/sysinfo.cpp
index 4ef988e..0db9cc8 100644
--- a/src/sysinfo.cpp
+++ b/src/sysinfo.cpp
@@ -271,11 +271,12 @@ namespace {
void load_disk_info()
{
+ GHashTable *devices;
glibtop_mountentry *entries;
glibtop_mountlist mountlist;
entries = glibtop_get_mountlist(&mountlist, 0);
-
+ devices = g_hash_table_new(g_str_hash, g_str_equal);
this->free_space_bytes = 0;
for (guint i = 0; i != mountlist.number; ++i) {
@@ -294,11 +295,18 @@ namespace {
if (string(entries[i].mountdir).find("/media/") == 0)
continue;
+ /* avoid adding a device more than once such as for btrfs filesystem */
+ if (g_hash_table_contains (devices, entries[i].devname))
+ continue;
+ else
+ g_hash_table_insert (devices, entries[i].devname, entries[i].mountdir);
+
glibtop_fsusage usage;
glibtop_get_fsusage(&usage, entries[i].mountdir);
this->free_space_bytes += usage.bavail * usage.block_size;
}
+ g_hash_table_destroy (devices);
g_free(entries);
}
--
2.27.0

View File

@ -1,6 +1,6 @@
Name: mate-system-monitor
Version: 1.22.2
Release: 4
Release: 5
Summary: Process and resource monitor
License: GPLv2+
URL: http://mate-desktop.org
@ -9,6 +9,16 @@ Source0: http://pub.mate-desktop.org/releases/1.22/%{name}-%{version}.tar
Patch0: mate-system-monitor-add-cpuinfo.patch
Patch1: mate-system-monitor-change-cpu-too-much-and-color.patch
Patch1001: 0001-kylin-modify-desktop.patch
Patch1002: 0001-modify-mate-system-monitor.desktop.in.in.patch
Patch1003: 0002-modify-mate-system-monitor.desktop.in.patch
Patch1004: 0001-fix-resource-Fix-resource-page-too-large-when-system.patch
Patch1005: 0001-fix-add-cpu-color-key-to-127-for-solve-the-quit-bug-.patch
Patch1006: 1006-fix-get-pcpu-with-double-to-solve-the-cpu-don-t-chan-109131eb.patch
Patch1007: 1007-fix-control-center-fix-mate-system-monitor-is-not-di-e6a06177.patch
Patch1008: 1008-sysinfo-avoid-adding-a-device-more-than-once-such-as-9e756f14.patch
BuildRequires: gcc-c++
BuildRequires: dbus-glib-devel
BuildRequires: desktop-file-utils
@ -63,8 +73,17 @@ desktop-file-install --delete-original \
%changelog
* Thu Mar 24 2022 wangkai <wangkai385@huawei.com> - 1.22.2-4
- Remove %{dist}
* Thu Jul 14 2022 longcheng <longcheng@kylinos.com.cn> - 1.22.2-5
- kylin modify desktop
- KYOS-F: add X-KIRAN-NoDisplay=true in mate-system-monitor.desktop.in.in and mate-system-monitor.desktop.in (#28092)
- KYOS-F: Fix resource page too large for lots of cpus (#23924)
- KYOS-F: add cpu-color key to 127 for solve the quit bug when change the color of cpu when cpu>32 (#45073)
- KYOS-F: get pcpu with double to solve the cpu% don't changed bug (#45071)
- KYOS-F: fix mate-system-monitor is not displayed in the control panel (#48482)
- KYOS-F: fix the problem of calculating available disk space multiple times for the same device (#53204)
* Mon Jun 13 2022 qiaoyujie <qiaoyujie@kylinos.cn> - 1.22.2-4
- remove %{dist} from spec file
* Sun Sep 22 2019 Wolfgang Ulbrich <fedora@raveit.de> - 1.22.2-1
- update to 1.22.2