mate-desktop / mate-notification-daemon

Daemon to display passive pop-up notifications
https://mate-desktop.org
GNU General Public License v2.0
30 stars 26 forks source link

applet: Resize icon size with panel #188

Closed vkareh closed 3 years ago

vkareh commented 3 years ago

Also render as scaled cairo surface to support HiDPI displays.

rbuj commented 3 years ago

New warnings:

mate-notification-applet.c:184:21: warning: assignment to 'GtkImage *' {aka 'struct _GtkImage *'} from incompatible pointer type 'GtkWidget *' {aka 'struct _GtkWidget *'} [-Wincompatible-pointer-types]
mate-notification-applet.c:185:21: warning: assignment to 'GtkImage *' {aka 'struct _GtkImage *'} from incompatible pointer type 'GtkWidget *' {aka 'struct _GtkWidget *'} [-Wincompatible-pointer-types]
mate-notification-applet.c:189:38: warning: passing argument 1 of 'gtk_widget_set_tooltip_text' from incompatible pointer type [-Wincompatible-pointer-types]
mate-notification-applet.c:190:38: warning: passing argument 1 of 'gtk_widget_set_tooltip_text' from incompatible pointer type [-Wincompatible-pointer-types]
mate-notification-applet.c:192:44: warning: passing argument 2 of 'gtk_box_pack_start' from incompatible pointer type [-Wincompatible-pointer-types]
mate-notification-applet.c:194:44: warning: passing argument 2 of 'gtk_box_pack_start' from incompatible pointer type [-Wincompatible-pointer-types]
mate-notification-applet.c:187:36: warning: passing argument 2 of 'applet_draw_icon' makes integer from pointer without a cast [-Wint-conversion]
mate-notification-applet.c:143:10: warning: conversion to 'gint' {aka 'int'} from 'guint' {aka 'unsigned int'} may change the sign of the result [-Wsign-conversion]
rbuj commented 3 years ago

New sign conversion warnings:

mate-notification-applet.c:149:60: warning: conversion to 'gint' {aka 'int'} from 'guint' {aka 'unsigned int'} may change the sign of the result [-Wsign-conversion]
mate-notification-applet.c:153:61: warning: conversion to 'gint' {aka 'int'} from 'guint' {aka 'unsigned int'} may change the sign of the result [-Wsign-conversion]

https://developer.gnome.org/gtk3/stable/GtkIconTheme.html#gtk-icon-theme-load-surface

diff --git a/src/capplet/mate-notification-applet.c b/src/capplet/mate-notification-applet.c
index 1f349d9..71f11c6 100644
--- a/src/capplet/mate-notification-applet.c
+++ b/src/capplet/mate-notification-applet.c
@@ -146,11 +146,11 @@ applet_draw_icon (MatePanelApplet *applet_widget,

   cairo_surface_t *image_on = gtk_icon_theme_load_surface (gtk_icon_theme_get_default (),
                                                            "user-available",
-                                                           size, scale,
+                                                           (gint) size, scale,
                                                            NULL, 0, NULL);
   cairo_surface_t *image_off = gtk_icon_theme_load_surface (gtk_icon_theme_get_default (),
                                                             "user-invisible",
-                                                            size, scale,
+                                                            (gint) size, scale,
                                                             NULL, 0, NULL);

   gtk_image_set_from_surface (GTK_IMAGE (applet->image_on), image_on);
raveit65 commented 3 years ago

Btw. I get an abrt alarm of m-n-d when i restart the panel with killall mate-panel (master branch) https://github.com/mate-desktop/mate-notification-daemon/issues/189

rbuj commented 3 years ago

Btw. I get an abrt alarm of m-n-d when i restart the panel with killall mate-panel (master branch)

189

PR #190