From 3c17cef8b7adf702a59eb53e6aad6c57a3523097 Mon Sep 17 00:00:00 2001 From: wangxiaoqing Date: Fri, 29 Jul 2022 09:05:36 +0800 Subject: [PATCH] Let the notification icon use the size specified by the tray Signed-off-by: wangxiaoqing --- ...tion-icon-use-the-size-specified-by-.patch | 56 +++++++++++++++++++ gtk3.spec | 7 ++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 0001-Let-the-notification-icon-use-the-size-specified-by-.patch diff --git a/0001-Let-the-notification-icon-use-the-size-specified-by-.patch b/0001-Let-the-notification-icon-use-the-size-specified-by-.patch new file mode 100644 index 0000000..388f2dd --- /dev/null +++ b/0001-Let-the-notification-icon-use-the-size-specified-by-.patch @@ -0,0 +1,56 @@ +From 3479f26d72d9632cdf5e5507de7a16fb3c309020 Mon Sep 17 00:00:00 2001 +From: wangxiaoqing +Date: Thu, 28 Jul 2022 17:33:51 +0800 +Subject: [PATCH] Let the notification icon use the size specified by the tray + to draw +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 让通知图标使用托盘指定的图标大小进行绘制, 避免造成图标过大 + Related #I5HAM8 + +Signed-off-by: wangxiaoqing +--- + gtk/deprecated/gtkstatusicon.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/gtk/deprecated/gtkstatusicon.c b/gtk/deprecated/gtkstatusicon.c +index 52239b1..e82ecc3 100644 +--- a/gtk/deprecated/gtkstatusicon.c ++++ b/gtk/deprecated/gtkstatusicon.c +@@ -1401,7 +1401,6 @@ gtk_status_icon_update_image (GtkStatusIcon *status_icon) + #ifndef GDK_WINDOWING_X11 + GdkPixbuf *pixbuf; + #endif +- gint round_size; + gint scale; + + #ifdef GDK_WINDOWING_X11 +@@ -1415,13 +1414,11 @@ gtk_status_icon_update_image (GtkStatusIcon *status_icon) + if (widget == NULL) + return; + +- round_size = round_pixel_size (widget, priv->size); +- + icon_helper = gtk_icon_helper_new (gtk_style_context_get_node (gtk_widget_get_style_context (widget)), widget); + _gtk_icon_helper_set_force_scale_pixbuf (icon_helper, TRUE); + _gtk_icon_helper_set_definition (icon_helper, priv->image_def); + _gtk_icon_helper_set_icon_size (icon_helper, GTK_ICON_SIZE_SMALL_TOOLBAR); +- _gtk_icon_helper_set_pixel_size (icon_helper, round_size); ++ _gtk_icon_helper_set_pixel_size (icon_helper, gtk_image_get_pixel_size(GTK_IMAGE(priv->image))); + surface = gtk_icon_helper_load_surface (icon_helper, scale); + + g_object_unref (icon_helper); +@@ -1567,6 +1564,8 @@ gtk_status_icon_icon_size_changed (GtkStatusIcon *status_icon) + gtk_image_set_pixel_size (GTK_IMAGE (priv->image), icon_size); + else + gtk_image_set_pixel_size (GTK_IMAGE (priv->image), -1); ++ ++ gtk_status_icon_update_image (status_icon); + } + + static void +-- +2.36.1 + diff --git a/gtk3.spec b/gtk3.spec index 13a63d1..b2e97e6 100644 --- a/gtk3.spec +++ b/gtk3.spec @@ -14,12 +14,14 @@ #Basic Information Name: gtk3 Version: 3.24.34 -Release: 2 +Release: 3 Summary: GTK+ graphical user interface library License: LGPLv2+ URL: http://www.gtk.org Source0: http://download.gnome.org/sources/gtk+/3.24/gtk+-%{version}.tar.xz +Patch0: 0001-Let-the-notification-icon-use-the-size-specified-by-.patch + #Dependency BuildRequires: pkgconfig(atk) >= %{atk_version} pkgconfig(atk-bridge-2.0) BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version} pkgconfig(gobject-introspection-1.0) @@ -262,6 +264,9 @@ gtk-query-immodules-3.0-64 --update-cache &>/dev/null || : %{_mandir}/man1/gtk3-widget-factory.1* %changelog +* Thu Jul 28 2022 wangxiaoqing - 3.24.34-3 +- Let the notification icon use the size specified by the tray + * Mon Jun 20 2022 lin zhang - 3.24.34-2 - remove meson option wayland-backend -- Gitee