Skip to content

Conversation

@bebehei
Copy link
Member

@bebehei bebehei commented Jan 7, 2019

Fixes #571


gsize len_expected;
gsize len_actual;
gsize pixelstride;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is rowstride an int but pixelstride gsize? Just seemed inconsistent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually both should be a gsize or size_t. But the gdk pixbuf requires an int and the GVariant stores an int for the rowstride.

@bebehei bebehei force-pushed the checksummed-icons branch from 0886f92 to 5748c41 Compare January 8, 2019 11:52
@bebehei bebehei requested a review from tsipinakis January 10, 2019 01:08
if (STR_EMPTY(n->iconname))
g_clear_pointer(&n->iconname, g_free);
if (!n->icon && n->iconname)
n->icon = icon_get_for_name(n->iconname, &n->icon_id);
Copy link
Member

@tsipinakis tsipinakis Jan 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed one here, this call doesn't scale the icon.

EDIT: I think this is a hint to maybe put all the icon parsing in one place to be able to manage them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG. Yes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EDIT: I think this is a hint to maybe put all the icon parsing in one place to be able to manage them.

Valid point. This already exists. I just had to use the right function.

Currently, we just skipped the notification comparison, if the
notification had a raw icon attached. This is a bit counterintuitive.

Calculating a checksum of the raw icon's data is the solution.

For that we cache the pixel buffer and introduce a field, which saves
the current icon's id. The icon_id may be a path or a hash.
So you can compare two notifications by their icon_id field regardless
of their icon type by their icon_id field.
Copy link
Member

@tsipinakis tsipinakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants