commit notify-osd for openSUSE:Factory
Hello community, here is the log from the commit of package notify-osd for openSUSE:Factory checked in at 2015-09-19 06:55:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/notify-osd (Old) and /work/SRC/openSUSE:Factory/.notify-osd.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "notify-osd" Changes: -------- --- /work/SRC/openSUSE:Factory/notify-osd/notify-osd.changes 2015-02-13 08:35:44.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.notify-osd.new/notify-osd.changes 2015-09-19 06:55:38.000000000 +0200 @@ -1,0 +2,7 @@ +Thu Sep 17 10:54:28 UTC 2015 - sor.alexei@meowr.ru + +- Update to 0.9.35~bzr20150915: + * Render in native resolution on hidpi displays (lp#1374301). +- Update and rebase notify-osd-leolik.patch. + +------------------------------------------------------------------- Old: ---- notify-osd_0.9.35+15.04.20150126.orig.tar.gz New: ---- notify-osd_0.9.35+15.10.20150915.orig.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ notify-osd.spec ++++++ --- /var/tmp/diff_new_pack.VxGf0X/_old 2015-09-19 06:55:38.000000000 +0200 +++ /var/tmp/diff_new_pack.VxGf0X/_new 2015-09-19 06:55:38.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package notify-osd # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,16 +16,16 @@ # -%define _version 0.9.35+15.04.20150126 +%define _version 0.9.35+15.10.20150915 Name: notify-osd -Version: 0.9.35~bzr20150126 +Version: 0.9.35~bzr20150915 Release: 0 Summary: Streamlined Notification Daemon License: GPL-3.0+ Group: System/X11/Utilities Url: https://launchpad.net/notify-osd Source: http://archive.ubuntu.com/ubuntu/pool/main/n/notify-osd/%{name}_%{_version}.orig.tar.gz -# PATCH-FEATURE-UPSTREAM notify-osd-leolik.patch -- Extend the configuration capabilities, patch by Roman Sukochev (Leolik). Taken from https://launchpad.net/~leolik/+archive/leolik. Note that upstream didn't accept this patch. +# PATCH-FEATURE-OPENSUSE notify-osd-leolik.patch -- Extend the configuration capabilities, patch by Roman Sukochev (Leolik) from https://launchpad.net/~leolik/+archive/leolik. Patch0: notify-osd-leolik.patch BuildRequires: autoconf >= 2.59 BuildRequires: automake >= 1.8 @@ -41,7 +41,7 @@ BuildRequires: pkgconfig(libwnck-3.0) BuildRequires: pkgconfig(pixman-1) Conflicts: notification-daemon -%{glib2_gsettings_schema_requires} +%glib2_gsettings_schema_requires %description This notification daemon is an alternative to the @@ -64,10 +64,10 @@ %fdupes %{buildroot}%{_datadir} %post -%{glib2_gsettings_schema_post} +%glib2_gsettings_schema_post %postun -%{glib2_gsettings_schema_postun} +%glib2_gsettings_schema_postun %files %defattr(-,root,root) ++++++ notify-osd-leolik.patch ++++++ --- /var/tmp/diff_new_pack.VxGf0X/_old 2015-09-19 06:55:39.000000000 +0200 +++ /var/tmp/diff_new_pack.VxGf0X/_new 2015-09-19 06:55:39.000000000 +0200 @@ -52,21 +52,16 @@ //-- private functions --------------------------------------------------------- static guint g_bubble_signals[LAST_SIGNAL] = { 0 }; -@@ -732,17 +736,32 @@ +@@ -758,17 +762,32 @@ 2.0f * EM2PIXELS (get_shadow_size (self), d)); cairo_fill (cr); cairo_set_operator (cr, CAIRO_OPERATOR_OVER); -- cairo_set_source_rgba (cr, -- color.red, -- color.green, -- color.blue, -- BUBBLE_BG_COLOR_A); + if (BUBBLE_AS_DESKTOP_BG) { -+ cairo_set_source_rgba (cr, -+ color.red, -+ color.green, -+ color.blue, -+ BUBBLE_BG_COLOR_A); + cairo_set_source_rgba (cr, + color.red, + color.green, + color.blue, + BUBBLE_BG_COLOR_A); + } else { + cairo_set_source_rgba (cr, + BUBBLE_BG_COLOR_R, @@ -76,15 +71,11 @@ + } } else -- cairo_set_source_rgb (cr, -- color.red, -- color.green, -- color.blue); + if (BUBBLE_AS_DESKTOP_BG) { -+ cairo_set_source_rgb (cr, -+ color.red, -+ color.green, -+ color.blue); + cairo_set_source_rgb (cr, + color.red, + color.green, + color.blue); + } else { + cairo_set_source_rgb (cr, + BUBBLE_BG_COLOR_R, @@ -94,38 +85,29 @@ draw_round_rect ( cr, -@@ -1643,15 +1662,23 @@ - // sanity check +@@ -1662,6 +1681,8 @@ if (!window) return; -- -- // set an 1x1 input-region to allow click-through -- region = cairo_region_create_rectangle (&rect); -- if (cairo_region_status (region) == CAIRO_STATUS_SUCCESS) -+ + + if (!BUBBLE_CLOSE_ON_CLICK) + { -+ // set an 1x1 input-region to allow click-through -+ region = cairo_region_create_rectangle (&rect); -+ if (cairo_region_status (region) == CAIRO_STATUS_SUCCESS) -+ { -+ gtk_widget_input_shape_combine_region (window, NULL); -+ gtk_widget_input_shape_combine_region (window, region); -+ } -+ cairo_region_destroy (region); + // set an 1x1 input-region to allow click-through + region = cairo_region_create_rectangle (&rect); + if (cairo_region_status (region) == CAIRO_STATUS_SUCCESS) +@@ -1670,6 +1691,12 @@ + gtk_widget_input_shape_combine_region (window, region); + } + cairo_region_destroy (region); + } + else - { -- gtk_widget_input_shape_combine_region (window, NULL); -- gtk_widget_input_shape_combine_region (window, region); ++ { + GdkWindow *window_ = gtk_widget_get_window (window); + gdk_window_set_events (window_, gdk_window_get_events (window_) | GDK_BUTTON_PRESS); - } -- cairo_region_destroy (region); ++ } } static void -@@ -1738,7 +1765,7 @@ +@@ -1756,7 +1783,7 @@ cairo_paint (cr); cairo_set_operator (cr, CAIRO_OPERATOR_OVER); @@ -134,7 +116,7 @@ { // render drop-shadow and bubble-background _render_background (bubble, cr, 1.0f, 0.0f); -@@ -1769,6 +1796,29 @@ +@@ -1787,6 +1814,30 @@ } static gboolean @@ -142,7 +124,8 @@ + GdkEventButton* event, + Bubble* bubble) +{ -+ BubblePrivate *priv = bubble->priv; ++ BubblePrivate* priv; ++ priv = bubble->priv; + + if (priv->mouse_over && event->button == 1) + { @@ -164,7 +147,7 @@ redraw_handler (Bubble* bubble) { GtkWindow* window; -@@ -1792,7 +1842,7 @@ +@@ -1810,7 +1861,7 @@ if (priv->alpha == NULL) { @@ -173,7 +156,7 @@ { gtk_widget_set_opacity (priv->widget, WINDOW_MIN_OPACITY + -@@ -1956,7 +2006,7 @@ +@@ -1979,7 +2030,7 @@ // mark mouse-pointer having left bubble and proximity-area // after inital show-up of bubble @@ -182,7 +165,7 @@ priv->prevent_fade = FALSE; } -@@ -2252,6 +2302,14 @@ +@@ -2275,6 +2326,14 @@ G_CALLBACK (bubble_draw), this); @@ -197,7 +180,7 @@ // "clear" input-mask, set title/icon/attributes gtk_widget_set_app_paintable (window, TRUE); gtk_window_set_title (GTK_WINDOW (window), "notify-osd"); -@@ -2731,7 +2789,7 @@ +@@ -2757,7 +2816,7 @@ priv = self->priv; @@ -206,7 +189,7 @@ return FALSE; return priv->mouse_over; -@@ -2835,7 +2893,7 @@ +@@ -2861,7 +2920,7 @@ // check if mouse-pointer is over bubble (and proximity-area) initially pointer_update (self); @@ -215,7 +198,7 @@ priv->prevent_fade = TRUE; else priv->prevent_fade = FALSE; -@@ -3398,6 +3456,8 @@ +@@ -3424,6 +3483,8 @@ gint old_bubble_height = 0; gint new_bubble_width = 0; gint new_bubble_height = 0; @@ -224,7 +207,7 @@ Defaults* d; BubblePrivate* priv; -@@ -3592,6 +3652,13 @@ +@@ -3619,6 +3680,13 @@ _refresh_body (self); update_shape (self); @@ -267,11 +250,10 @@ -#define DEFAULT_MARGIN_SIZE 1.0f -#define DEFAULT_ICON_SIZE 3.0f -#define DEFAULT_GAUGE_SIZE 0.625f --#define DEFAULT_GAUGE_OUTLINE_WIDTH 0.125f +float DEFAULT_MARGIN_SIZE = 1.0f; +float DEFAULT_ICON_SIZE = 3.0f; +float DEFAULT_GAUGE_SIZE = 0.625f; -+#define DEFAULT_GAUGE_OUTLINE_WIDTH 0.125f + #define DEFAULT_GAUGE_OUTLINE_WIDTH 0.125f #define DEFAULT_TEXT_FONT_FACE "Sans" #define DEFAULT_TEXT_TITLE_COLOR "#ffffff" -#define DEFAULT_TEXT_TITLE_WEIGHT TEXT_WEIGHT_BOLD @@ -385,7 +367,6 @@ defaults_get_top_corner (self->defaults, &screen, &x, &y); -diff -ruN src_old/main.c src/main.c --- src_old/main.c +++ src/main.c @@ -25,6 +25,10 @@ @@ -622,7 +603,6 @@ defaults = defaults_new (); observer = observer_new (); stack = stack_new (defaults, observer); -diff -ruN src_old/stack.c src/stack.c --- src_old/stack.c +++ src/stack.c @@ -44,6 +44,7 @@ @@ -637,41 +617,33 @@ if (body) bubble_set_message_body (bubble, body); -+ if (timeout == NOTIFY_EXPIRES_DEFAULT) { -+ bubble_set_timeout (bubble, -+ defaults_get_on_screen_timeout (self->defaults)); -+ } -+ else -+ { -+ bubble_set_timeout (bubble, timeout); -+ } ++ if (timeout == NOTIFY_EXPIRES_DEFAULT) { ++ bubble_set_timeout (bubble, ++ defaults_get_on_screen_timeout (self->defaults)); ++ } ++ else { ++ bubble_set_timeout (bubble, timeout); ++ } ++ + if (new_bubble && bubble_is_append_allowed(bubble)) { app_bubble = find_bubble_for_append(self, bubble); -@@ -958,8 +968,54 @@ +@@ -958,8 +968,7 @@ case SLOT_ALLOCATION_FIXED: *y += EM2PIXELS (defaults_get_icon_size (d), d) + 2 * EM2PIXELS (defaults_get_margin_size (d), d) + - EM2PIXELS (defaults_get_bubble_vert_gap (d), d); /* + - 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d, is_composited), d);*/ + EM2PIXELS (defaults_get_bubble_vert_gap (d), d) + 2; -+ break; -+ -+ case SLOT_ALLOCATION_DYNAMIC: -+ g_assert (stack_is_slot_vacant (self, SLOT_TOP) == OCCUPIED); -+ *y += bubble_get_height (self->slots[SLOT_TOP]) + -+ EM2PIXELS (defaults_get_bubble_vert_gap (d), d) - -+ 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d, is_composited), d); -+ break; -+ -+ default: -+ break; -+ } -+ -+ } -+ break; -+ + break; + + case SLOT_ALLOCATION_DYNAMIC: +@@ -975,6 +984,161 @@ + + } + break; ++ + case GRAVITY_WEST: + d = self->defaults; + @@ -703,14 +675,22 @@ + *y += EM2PIXELS (defaults_get_icon_size (d), d) + + 2 * EM2PIXELS (defaults_get_margin_size (d), d) + + EM2PIXELS (defaults_get_bubble_vert_gap (d), d) + 2; - break; - - case SLOT_ALLOCATION_DYNAMIC: -@@ -975,6 +1031,114 @@ - - } - break; -+ ++ break; ++ ++ case SLOT_ALLOCATION_DYNAMIC: ++ g_assert (stack_is_slot_vacant (self, SLOT_TOP) == OCCUPIED); ++ *y += bubble_get_height (self->slots[SLOT_TOP]) + ++ EM2PIXELS (defaults_get_bubble_vert_gap (d), d) - ++ 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d, is_composited), d); ++ break; ++ ++ default: ++ break; ++ } ++ ++ } ++ break; ++ + case GRAVITY_SOUTH_EAST: + d = self->defaults; + ++++++ notify-osd_0.9.35+15.04.20150126.orig.tar.gz -> notify-osd_0.9.35+15.10.20150915.orig.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notify-osd-0.9.35+15.04.20150126/src/bubble.c new/notify-osd-0.9.35+15.10.20150915/src/bubble.c --- old/notify-osd-0.9.35+15.04.20150126/src/bubble.c 2015-01-26 15:16:38.000000000 +0100 +++ new/notify-osd-0.9.35+15.10.20150915/src/bubble.c 2015-09-15 11:24:16.000000000 +0200 @@ -177,6 +177,23 @@ static guint g_bubble_signals[LAST_SIGNAL] = { 0 }; gint g_pointer[2]; +static cairo_surface_t * +bubble_create_image_surface (Bubble* self, + cairo_format_t format, + gint width, + gint height) +{ + cairo_surface_t *surface; + gint scale; + + scale = gtk_widget_get_scale_factor (self->priv->widget); + + surface = cairo_image_surface_create (format, scale * width, scale * height); + cairo_surface_set_device_scale (surface, scale, scale); + + return surface; +} + static void draw_round_rect (cairo_t* cr, gdouble aspect, // aspect-ratio @@ -372,7 +389,8 @@ } void -_draw_shadow (cairo_t* cr, +_draw_shadow (Bubble* self, + cairo_t* cr, gdouble width, gdouble height, gint shadow_radius, @@ -384,10 +402,13 @@ cairo_t* cr_surf = NULL; cairo_matrix_t matrix; raico_blur_t* blur = NULL; + double x_scale; + double y_scale; - tmp_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, - 4 * shadow_radius, - 4 * shadow_radius); + tmp_surface = bubble_create_image_surface (self, + CAIRO_FORMAT_ARGB32, + 4 * shadow_radius, + 4 * shadow_radius); if (cairo_surface_status (tmp_surface) != CAIRO_STATUS_SUCCESS) { if (tmp_surface) cairo_surface_destroy (tmp_surface); @@ -433,6 +454,9 @@ cairo_image_surface_get_width (tmp_surface) / 2, cairo_image_surface_get_height (tmp_surface) / 2, cairo_image_surface_get_stride (tmp_surface)); + cairo_surface_get_device_scale (tmp_surface, &x_scale, &y_scale); + cairo_surface_set_device_scale (new_surface, x_scale, y_scale); + pattern = cairo_pattern_create_for_surface (new_surface); if (cairo_pattern_status (pattern) != CAIRO_STATUS_SUCCESS) { @@ -639,7 +663,6 @@ Defaults* d = self->defaults; cairo_t* cr = NULL; cairo_surface_t* scratch = NULL; - cairo_surface_t* dummy = NULL; cairo_surface_t* clone = NULL; cairo_surface_t* normal = NULL; cairo_surface_t* blurred = NULL; @@ -654,7 +677,8 @@ if (priv->composited) { scratch_shadow_size = EM2PIXELS (get_shadow_size (self), d); - scratch = cairo_image_surface_create ( + scratch = bubble_create_image_surface ( + self, CAIRO_FORMAT_ARGB32, 3 * scratch_shadow_size, 3 * scratch_shadow_size); @@ -663,7 +687,8 @@ { // We must have at least some width to this scratch surface. scratch_shadow_size = 1; - scratch = cairo_image_surface_create ( + scratch = bubble_create_image_surface ( + self, CAIRO_FORMAT_RGB24, 3 * scratch_shadow_size, 3 * scratch_shadow_size); @@ -715,6 +740,7 @@ if (priv->composited) { _draw_shadow ( + self, cr, width, height, @@ -757,24 +783,10 @@ cairo_destroy (cr); // create temp. clone of scratch surface - dummy = cairo_image_surface_create_for_data ( - cairo_image_surface_get_data (scratch), - cairo_image_surface_get_format (scratch), - 3 * scratch_shadow_size, - 3 * scratch_shadow_size, - cairo_image_surface_get_stride (scratch)); - clone = copy_surface (dummy); - cairo_surface_destroy (dummy); + clone = copy_surface (scratch); // create normal surface from that surface-clone - dummy = cairo_image_surface_create_for_data ( - cairo_image_surface_get_data (clone), - cairo_image_surface_get_format (clone), - 2 * scratch_shadow_size, - 2 * scratch_shadow_size, - cairo_image_surface_get_stride (clone)); - normal = copy_surface (dummy); - cairo_surface_destroy (dummy); + normal = copy_surface (clone); // now blur the surface-clone blur = raico_blur_create (RAICO_BLUR_QUALITY_LOW); @@ -783,30 +795,26 @@ raico_blur_destroy (blur); // create blurred version from that blurred surface-clone - dummy = cairo_image_surface_create_for_data ( - cairo_image_surface_get_data (clone), - cairo_image_surface_get_format (clone), - 2 * scratch_shadow_size, - 2 * scratch_shadow_size, - cairo_image_surface_get_stride (clone)); - blurred = copy_surface (dummy); - cairo_surface_destroy (dummy); - destroy_cloned_surface (clone); + blurred = copy_surface (clone); + cairo_surface_destroy (clone); // finally create tile with top-left shadow/background part if (priv->tile_background_part) tile_destroy (priv->tile_background_part); - priv->tile_background_part = tile_new_for_padding (normal, blurred); - destroy_cloned_surface (normal); - destroy_cloned_surface (blurred); + priv->tile_background_part = tile_new_for_padding (normal, blurred, + 3 * scratch_shadow_size, + 3 * scratch_shadow_size); + cairo_surface_destroy (normal); + cairo_surface_destroy (blurred); // create surface(s) for full shadow/background tile if (priv->composited) { // we need two RGBA-surfaces - normal = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, - width, - height); + normal = bubble_create_image_surface (self, + CAIRO_FORMAT_ARGB32, + width, + height); if (cairo_surface_status (normal) != CAIRO_STATUS_SUCCESS) { cairo_surface_destroy (scratch); @@ -817,9 +825,10 @@ return; } - blurred = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, - width, - height); + blurred = bubble_create_image_surface (self, + CAIRO_FORMAT_ARGB32, + width, + height); if (cairo_surface_status (blurred) != CAIRO_STATUS_SUCCESS) { cairo_surface_destroy (normal); @@ -834,9 +843,10 @@ else { // we need only one RGB-surface - normal = cairo_image_surface_create (CAIRO_FORMAT_RGB24, - width, - height); + normal = bubble_create_image_surface (self, + CAIRO_FORMAT_RGB24, + width, + height); if (cairo_surface_status (normal) != CAIRO_STATUS_SUCCESS) { cairo_surface_destroy (scratch); @@ -921,9 +931,9 @@ if (priv->tile_background) tile_destroy (priv->tile_background); if (priv->composited) - priv->tile_background = tile_new_for_padding (normal, blurred); + priv->tile_background = tile_new_for_padding (normal, blurred, width, height); else - priv->tile_background = tile_new_for_padding (normal, normal); + priv->tile_background = tile_new_for_padding (normal, normal, width, height); // clean up if (priv->composited) @@ -936,16 +946,18 @@ void _refresh_icon (Bubble* self) { - BubblePrivate* priv = self->priv; - Defaults* d = self->defaults; - cairo_surface_t* normal = NULL; - cairo_t* cr = NULL; + BubblePrivate* priv = self->priv; + Defaults* d = self->defaults; + cairo_surface_t* normal = NULL; + cairo_surface_t* icon_surface = NULL; + cairo_t* cr = NULL; if (!priv->icon_pixbuf) return; // create temp. scratch surface - normal = cairo_image_surface_create ( + normal = bubble_create_image_surface ( + self, CAIRO_FORMAT_ARGB32, EM2PIXELS (defaults_get_icon_size (d), d) + 2 * BUBBLE_CONTENT_BLUR_RADIUS, @@ -969,10 +981,12 @@ cairo_set_operator (cr, CAIRO_OPERATOR_OVER); // render icon into normal surface - gdk_cairo_set_source_pixbuf (cr, - priv->icon_pixbuf, - BUBBLE_CONTENT_BLUR_RADIUS, - BUBBLE_CONTENT_BLUR_RADIUS); + icon_surface = gdk_cairo_surface_create_from_pixbuf (priv->icon_pixbuf, 0, + gtk_widget_get_window (priv->widget)); + cairo_set_source_surface (cr, + icon_surface, + BUBBLE_CONTENT_BLUR_RADIUS, + BUBBLE_CONTENT_BLUR_RADIUS); cairo_paint (cr); // create the surface/blur-cache from the normal surface @@ -982,6 +996,7 @@ // clean up cairo_destroy (cr); + cairo_surface_destroy (icon_surface); cairo_surface_destroy (normal); } @@ -998,7 +1013,8 @@ gchar* text_font_face = NULL; // create temp. scratch surface - normal = cairo_image_surface_create ( + normal = bubble_create_image_surface ( + self, CAIRO_FORMAT_ARGB32, priv->title_width + 2 * BUBBLE_CONTENT_BLUR_RADIUS, priv->title_height + 2 * BUBBLE_CONTENT_BLUR_RADIUS); @@ -1106,7 +1122,8 @@ gchar* text_font_face = NULL; // create temp. scratch surface - normal = cairo_image_surface_create ( + normal = bubble_create_image_surface ( + self, CAIRO_FORMAT_ARGB32, priv->body_width + 2 * BUBBLE_CONTENT_BLUR_RADIUS, priv->body_height + 2 * BUBBLE_CONTENT_BLUR_RADIUS); @@ -1212,7 +1229,8 @@ cairo_t* cr = NULL; // create temp. scratch surface - normal = cairo_image_surface_create ( + normal = bubble_create_image_surface ( + self, CAIRO_FORMAT_ARGB32, EM2PIXELS (defaults_get_bubble_width (d), d) - 3 * EM2PIXELS (defaults_get_margin_size (d), d) - @@ -1810,13 +1828,15 @@ static GdkPixbuf* -load_icon (const gchar* filename, +load_icon (Bubble* self, + const gchar* filename, gint icon_size) { GdkPixbuf* buffer = NULL; GdkPixbuf* pixbuf = NULL; GtkIconTheme* theme = NULL; GError* error = NULL; + gint scale; /* sanity check */ g_return_val_if_fail (filename, NULL); @@ -1825,25 +1845,28 @@ if (!strncmp (filename, "file://", 7)) filename += 7; + scale = gtk_widget_get_scale_factor (self->priv->widget); + if (filename[0] == '/') { /* load image into pixbuf */ pixbuf = gdk_pixbuf_new_from_file_at_scale (filename, - icon_size, - icon_size, + scale * icon_size, + scale * icon_size, TRUE, NULL); } else { /* TODO: rewrite, check for SVG support, raise apport ** notification for low-res icons */ theme = gtk_icon_theme_get_default (); - buffer = gtk_icon_theme_load_icon (theme, - filename, - icon_size, - GTK_ICON_LOOKUP_FORCE_SVG | - GTK_ICON_LOOKUP_GENERIC_FALLBACK | - GTK_ICON_LOOKUP_FORCE_SIZE, - &error); + buffer = gtk_icon_theme_load_icon_for_scale (theme, + filename, + icon_size, + scale, + GTK_ICON_LOOKUP_FORCE_SVG | + GTK_ICON_LOOKUP_GENERIC_FALLBACK | + GTK_ICON_LOOKUP_FORCE_SIZE, + &error); if (error) { g_print ("loading icon '%s' caused error: '%s'", @@ -2431,7 +2454,8 @@ } d = self->defaults; - priv->icon_pixbuf = load_icon (filepath, + priv->icon_pixbuf = load_icon (self, + filepath, EM2PIXELS (defaults_get_icon_size (d), d)); _refresh_icon (self); @@ -2474,7 +2498,8 @@ #ifdef TEMPORARY_ICON_PREFIX_WORKAROUND notify_osd_iconname = g_strdup_printf (NOTIFY_OSD_ICON_PREFIX "-%s", filename); - priv->icon_pixbuf = load_icon (notify_osd_iconname, + priv->icon_pixbuf = load_icon (self, + notify_osd_iconname, EM2PIXELS (defaults_get_icon_size (d), d)); g_free (notify_osd_iconname); @@ -2482,7 +2507,8 @@ // fallback to non-notify-osd name if (!priv->icon_pixbuf) - priv->icon_pixbuf = load_icon (filename, + priv->icon_pixbuf = load_icon (self, + filename, EM2PIXELS (defaults_get_icon_size (d), d)); _refresh_icon (self); @@ -3224,7 +3250,7 @@ d = self->defaults; priv = self->priv; - surface = cairo_image_surface_create (CAIRO_FORMAT_A1, 1, 1); + surface = bubble_create_image_surface (self, CAIRO_FORMAT_A1, 1, 1); if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS) { if (surface) cairo_surface_destroy (surface); @@ -3418,6 +3444,7 @@ EM2PIXELS (defaults_get_icon_size (d), d), EM2PIXELS (defaults_get_icon_size (d), d), GDK_INTERP_BILINEAR); + g_message ("resizing pixbuf to %d", EM2PIXELS (defaults_get_icon_size (d), d) ); g_object_unref (priv->icon_pixbuf); priv->icon_pixbuf = pixbuf; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notify-osd-0.9.35+15.04.20150126/src/raico-blur.c new/notify-osd-0.9.35+15.10.20150915/src/raico-blur.c --- old/notify-osd-0.9.35+15.04.20150126/src/raico-blur.c 2015-01-26 15:16:14.000000000 +0100 +++ new/notify-osd-0.9.35+15.10.20150915/src/raico-blur.c 2015-09-15 11:24:16.000000000 +0200 @@ -112,6 +112,9 @@ cairo_surface_t* surface) { cairo_format_t format; + double x_scale; + double y_scale; + guint radius; // sanity checks if (!blur) @@ -151,20 +154,27 @@ if (blur->priv->radius == 0) return; + /* adjust radius for device scale. We don't support blurring + * different amounts in x and y, so just use the mean value + * between cairo's respective device scales (in practice they + * should always be the same). */ + cairo_surface_get_device_scale (surface, &x_scale, &y_scale); + radius = blur->priv->radius * 0.5 * (x_scale + y_scale); + // now do the real work switch (blur->priv->quality) { case RAICO_BLUR_QUALITY_LOW: - surface_exponential_blur (surface, blur->priv->radius); + surface_exponential_blur (surface, radius); break; case RAICO_BLUR_QUALITY_MEDIUM: //surface_stack_blur (surface, blur->priv->radius); - surface_gaussian_blur (surface, blur->priv->radius); + surface_gaussian_blur (surface, radius); break; case RAICO_BLUR_QUALITY_HIGH: - surface_gaussian_blur (surface, blur->priv->radius); + surface_gaussian_blur (surface, radius); break; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notify-osd-0.9.35+15.04.20150126/src/tile.c new/notify-osd-0.9.35+15.10.20150915/src/tile.c --- old/notify-osd-0.9.35+15.04.20150126/src/tile.c 2015-01-26 15:16:14.000000000 +0100 +++ new/notify-osd-0.9.35+15.10.20150915/src/tile.c 2015-09-15 11:24:16.000000000 +0200 @@ -76,7 +76,9 @@ tile_t* tile_new_for_padding (cairo_surface_t* normal, - cairo_surface_t* blurred) + cairo_surface_t* blurred, + gint width, + gint height) { tile_private_t* priv = NULL; tile_t* tile = NULL; @@ -93,20 +95,14 @@ cairo_surface_status (blurred) != CAIRO_STATUS_SUCCESS) return NULL; - if (cairo_image_surface_get_width (normal) != - cairo_image_surface_get_width (blurred) && - cairo_image_surface_get_height (normal) != - cairo_image_surface_get_height (blurred)) - return NULL; - tile->priv = priv; tile->priv->normal = copy_surface (normal); tile->priv->blurred = copy_surface (blurred); tile->priv->blur_radius = 0; tile->priv->use_padding = TRUE; - tile->priv->pad_width = cairo_image_surface_get_width (normal); - tile->priv->pad_height = cairo_image_surface_get_height (normal); + tile->priv->pad_width = width; + tile->priv->pad_height = height; return tile; } @@ -120,8 +116,8 @@ //cairo_surface_write_to_png (tile->priv->normal, "./tile-normal.png"); //cairo_surface_write_to_png (tile->priv->blurred, "./tile-blurred.png"); - destroy_cloned_surface (tile->priv->normal); - destroy_cloned_surface (tile->priv->blurred); + cairo_surface_destroy (tile->priv->normal); + cairo_surface_destroy (tile->priv->blurred); g_free ((gpointer) tile->priv); g_free ((gpointer) tile); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notify-osd-0.9.35+15.04.20150126/src/tile.h new/notify-osd-0.9.35+15.10.20150915/src/tile.h --- old/notify-osd-0.9.35+15.04.20150126/src/tile.h 2015-01-26 15:16:14.000000000 +0100 +++ new/notify-osd-0.9.35+15.10.20150915/src/tile.h 2015-09-15 11:24:16.000000000 +0200 @@ -44,7 +44,9 @@ tile_t* tile_new_for_padding (cairo_surface_t* normal, - cairo_surface_t* blurred); + cairo_surface_t* blurred, + gint width, + gint height); void tile_destroy (tile_t* tile); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notify-osd-0.9.35+15.04.20150126/src/util.c new/notify-osd-0.9.35+15.10.20150915/src/util.c --- old/notify-osd-0.9.35+15.04.20150126/src/util.c 2015-01-26 15:16:14.000000000 +0100 +++ new/notify-osd-0.9.35+15.10.20150915/src/util.c 2015-09-15 11:24:16.000000000 +0200 @@ -139,51 +139,30 @@ return text1; } -gboolean -destroy_cloned_surface (cairo_surface_t* surface) -{ - gboolean finalref = FALSE; - g_return_val_if_fail (surface, FALSE); - - if (cairo_surface_get_reference_count (surface) == 1) { - g_free (cairo_image_surface_get_data (surface)); - finalref = TRUE; - } - cairo_surface_destroy (surface); - return finalref; -} - cairo_surface_t* copy_surface (cairo_surface_t* orig) { cairo_surface_t* copy = NULL; - guchar* pixels_src = NULL; - guchar* pixels_cpy = NULL; cairo_format_t format; gint width; gint height; - gint stride; - - pixels_src = cairo_image_surface_get_data (orig); - if (!pixels_src) - return NULL; + cairo_t* cr; + double x_scale; + double y_scale; - format = cairo_image_surface_get_format (orig); width = cairo_image_surface_get_width (orig); height = cairo_image_surface_get_height (orig); - stride = cairo_image_surface_get_stride (orig); + format = cairo_image_surface_get_format (orig); + cairo_surface_get_device_scale (orig, &x_scale, &y_scale); + + copy = cairo_surface_create_similar_image (orig, format, width, height); + cairo_surface_set_device_scale (copy, x_scale, y_scale); + + cr = cairo_create (copy); + cairo_set_source_surface (cr, orig, 0, 0); + cairo_paint (cr); - pixels_cpy = g_malloc0 (stride * height); - if (!pixels_cpy) - return NULL; - - memcpy ((void*) pixels_cpy, (void*) pixels_src, height * stride); - - copy = cairo_image_surface_create_for_data (pixels_cpy, - format, - width, - height, - stride); + cairo_destroy (cr); return copy; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notify-osd-0.9.35+15.04.20150126/src/util.h new/notify-osd-0.9.35+15.10.20150915/src/util.h --- old/notify-osd-0.9.35+15.04.20150126/src/util.h 2015-01-26 15:16:14.000000000 +0100 +++ new/notify-osd-0.9.35+15.10.20150915/src/util.h 2015-09-15 11:24:16.000000000 +0200 @@ -46,9 +46,6 @@ cairo_surface_t* copy_surface (cairo_surface_t* orig); -gboolean -destroy_cloned_surface (cairo_surface_t* surface); - gchar* get_wm_name (Display* dpy); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notify-osd-0.9.35+15.04.20150126/tests/test-grow-bubble.c new/notify-osd-0.9.35+15.10.20150915/tests/test-grow-bubble.c --- old/notify-osd-0.9.35+15.04.20150126/tests/test-grow-bubble.c 2015-01-26 15:16:27.000000000 +0100 +++ new/notify-osd-0.9.35+15.10.20150915/tests/test-grow-bubble.c 2015-09-15 11:24:16.000000000 +0200 @@ -651,7 +651,7 @@ cairo_surface_destroy (tmp); cairo_surface_destroy (dummy_surf); - g_tile = tile_new_for_padding (norm_surf, blur_surf); + g_tile = tile_new_for_padding (norm_surf, blur_surf, width, height); cairo_surface_destroy (norm_surf); cairo_surface_destroy (blur_surf); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/notify-osd-0.9.35+15.04.20150126/tests/test-scroll-text.c new/notify-osd-0.9.35+15.10.20150915/tests/test-scroll-text.c --- old/notify-osd-0.9.35+15.04.20150126/tests/test-scroll-text.c 2015-01-26 15:16:27.000000000 +0100 +++ new/notify-osd-0.9.35+15.10.20150915/tests/test-scroll-text.c 2015-09-15 11:24:16.000000000 +0200 @@ -826,10 +826,10 @@ cairo_surface_destroy (tmp); // actually create the tile with padding in mind - tile = tile_new_for_padding (norm_surf, blur_surf); - destroy_cloned_surface (norm_surf); - destroy_cloned_surface (blur_surf); - destroy_cloned_surface (dummy_surf); + tile = tile_new_for_padding (norm_surf, blur_surf, width, height); + cairo_surface_destroy (norm_surf); + cairo_surface_destroy (blur_surf); + cairo_surface_destroy (dummy_surf); cairo_destroy (cr); cairo_surface_destroy (cr_surf); @@ -852,7 +852,7 @@ tile_paint_with_padding (tile, cr, 0.0f, 0.0f, w, h, 0.0f, 1.0f); cairo_destroy (cr); - g_tile = tile_new_for_padding (norm_surf, blur_surf); + g_tile = tile_new_for_padding (norm_surf, blur_surf, width, height); // clean up tile_destroy (tile);
participants (1)
-
root@hilbert.suse.de