Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scale. #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix scale. #29

wants to merge 1 commit into from

Conversation

kurnevsky
Copy link
Contributor

@kurnevsky kurnevsky commented Jul 28, 2021

Gtk requires size to be >0.

I get the following error periodically:

Jul 28 00:34:14 dell taffybar-linux-[265044]: gdk_pixbuf_scale_simple: assertion 'dest_width > 0' failed
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - targetW: 0, targetH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - Scaling pb to 1, actualW: 59, actualH: 96, scaledW: 0, scaledH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - targetW: 1, targetH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - Scaling pb to 1, actualW: 16, actualH: 16, scaledW: 1, scaledH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - targetW: 1, targetH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - Scaling pb to 1, actualW: 1, actualH: 1, scaledW: 1, scaledH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - targetW: 1, targetH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - Scaling pb to 1, actualW: 1, actualH: 1, scaledW: 1, scaledH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - targetW: 1, targetH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - Scaling pb to 1, actualW: 1, actualH: 1, scaledW: 1, scaledH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - targetW: 1, targetH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - Scaling pb to 1, actualW: 1, actualH: 1, scaledW: 1, scaledH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - targetW: 1, targetH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - Scaling pb to 1, actualW: 1, actualH: 1, scaledW: 1, scaledH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - targetW: 1, targetH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - Scaling pb to 1, actualW: 1, actualH: 1, scaledW: 1, scaledH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - targetW: 1, targetH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - Scaling pb to 1, actualW: 1, actualH: 1, scaledW: 1, scaledH: 1
Jul 28 00:34:14 dell taffybar[265044]: [WARNING] System.Taffybar.Widget.Generic.AutoSizeImage - Allocating image: size 1, width 1,  height 1, aw: 1, ah: 1, pbw: 59 pbh: 96
Jul 28 00:34:14 dell taffybar[265044]: [WARNING] StatusNotifier.Tray - Unable to scale pixbuf
Jul 28 00:34:14 dell taffybar-linux-[265044]: gdk_pixbuf_scale_simple: assertion 'dest_width > 0' failed
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - targetW: 0, targetH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - Scaling pb to 1, actualW: 59, actualH: 96, scaledW: 0, scaledH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - targetW: 1, targetH: 1
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - Scaling pb to 1, actualW: 1, actualH: 1, scaledW: 1, scaledH: 1
Jul 28 00:34:14 dell taffybar[265044]: [WARNING] System.Taffybar.Widget.Generic.AutoSizeImage - Allocating image: size 1, width 1,  height 1, aw: 1, ah: 1, pbw: 59 pbh: 96
Jul 28 00:34:14 dell taffybar[265044]: [WARNING] StatusNotifier.Tray - Unable to scale pixbuf
Jul 28 00:34:14 dell taffybar-linux-[265044]: gdk_pixbuf_scale_simple: assertion 'dest_width > 0' failed
Jul 28 00:34:14 dell taffybar[265044]: [DEBUG] StatusNotifier.Tray - targetW: 0, targetH: 1

Gtk requires size to be >0.
@colonelpanic8
Copy link
Member

This is probably from a non existent icon. I think a better solution would be to find the root cause of this issue.

@kurnevsky
Copy link
Contributor Author

kurnevsky commented Jul 28, 2021

But I didn't notice any missing icons - all tray icons work as expected. The problem is that when this happens I have huge icons and taffybar with much bigger height. So looks like they can't be scaled.

@colonelpanic8
Copy link
Member

It's weird that the target Height and Width are both 1. I don't think that should be happening. Why would it be trying to scale things to a single pixel?

@kurnevsky
Copy link
Contributor Author

No idea, but after this patch it doesn't scale things to 1 pixel. Last time this happened after taffybar restart, but before restart it worked fine. Could it be that right after start taffybar has got wrong height?

@kurnevsky
Copy link
Contributor Author

kurnevsky commented Jul 28, 2021

It's pidgin icon that causes it. Not right after start, but after some time. Probably after receiving a message... When message is received its icon blinks. So probably when it disappears taffybar can't get it as it's supposed to be empty.
And after this fix it's shown as it should.

@kurnevsky
Copy link
Contributor Author

Here is the icon it sets: https://github.com/philipl/pidgin-indicator/blob/master/icons/hicolor/22x22/status/pidgin-indicator-nothing.png
Looks like it's 22x22 pixels, so not sure if it really causes this.

@colonelpanic8
Copy link
Member

It would not be about the icons size. What is being logged is the target size, so the size we are attempting to scale it to. Seems weird that we are trying to scale something to be 1 pixel or 0 pixels. Sounds like maybe the widget is hidden or something when this attempt is made.

@colonelpanic8
Copy link
Member

. The problem is that when this happens I have huge icons and

The reason you have huge icons is that the attempt to scale the icon is failing, and we are falling back to just returning the unscaled pixbuf. The attempt to scale the icon is failing because we are requesting a non-sensical size. We should figure out why we are requesting this non-sensiscal size.

@kurnevsky
Copy link
Contributor Author

It would not be about the icons size. What is being logged is the target size, so the size we are attempting to scale it to.

Then I don't get it why after this fix I see taffybar with its usual height and correctly scaled icons, bigger than 1 pixel.

btw, I can't reproduce it - it only happened 2 times, but after it happened taffybar had this problem even after restart. Only after I closed pidgin and restarted taffybar it returned to its normal size.

@colonelpanic8
Copy link
Member

Then I don't get it why after this fix I see taffybar with its usual height and correctly scaled icons, bigger than 1 pixel.

Probably because after the 1 pixel resize, the bar immediately resizes and that triggers another automatic resize and then you get the correct size.

My suspicion is that there is some type of degenerate condition at startup.

@kurnevsky
Copy link
Contributor Author

kurnevsky commented Jul 29, 2021

Just reproduced it - it happens after you receive a message in pidgin and then restart taffybar.
@IvanMalison any ideas how to debug this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants