GNOME Bugzilla – Bug 341351
window icon not set correctly when opening the first image
Last modified: 2007-03-18 00:08:06 UTC
That bug has been described on https://launchpad.net/distros/ubuntu/+source/eog/+bug/43609 "when opening an image, the window bar does not display the image's thumbnail as an identifier but rather EOG's icon. However, if you switch to the next / previous image, its thumbnail appears on the window bar."
This doesn't _always_ happen - it looks like a race between the thumbnail creation job and the image loading job, which calls display_image_data(), which in turn sets the window's icon. One possible solution is creating the thumbnail in display_image_data() and having the job finished callback set the window's icon. I'm not too sure about how the icon creation is performed, but I assume EOG is going through the collection creating thumbnails. If that's the case, then it could be a while before the thumbnail gets created, especially if it's done lazily (i.e. not for images that are not displayed in the collection browser), so this might be an ok approach. OTOH, it may step on the thumbnail creation that will inevitably happen (I think).
Created attachment 66855 [details] [review] Suboptimal patch Here's a patch that addresses this issue, but it's probably not the ideal way to fix it - I'm uploading it to highlight the problem. I noticed there's a thumbnail_finished signal for EogImage, but I can't seem to find where it's emitted.
Created attachment 70096 [details] [review] patch using signals The idea of using the signals to set the icon is not bad. This patch changes EogImage so it emits a thumbnail_set signal once the thumb gets set. If the thumbnail is already set it's set as usual EogWindow sets the icon (nearly) as usual, but if it's not EogWindow waits for the signal to set it.
Maybe for 2.18?
I forgot to note that I commited a fix in a similar way as my patch in comment 3 to eog-ng branch some time ago: 2006-10-05 Felix Riemann * libeog/eog-image.c: (eog_image_class_init), (eog_image_set_thumbnail): * libeog/eog-image.h: Replace old unused thumbnail signals by a single one being emitted once the thumbnail is set. * shell/eog-window.c: (image_thumb_changed_cb), (eog_window_display_image): Set window icon using the new signal. Make it work when the collection view is hidden.
I was just about to file the opposite bug so I just add a comment here instead. There seem to be some inconsistency in that some applications choose to display a "document icon" while other use the applications icon. For example, in Bug 131010 Epiphany was changed so that it doesn't display an icon of the document (favicon in Epiphany's case) as the application icon. I don't know which is correct, but to me it seems a little inconsistent.
"There seem to be some inconsistency in that some applications choose to display a "document icon" while other use the applications icon". Based on that bug, I think that apps with tabs should show the app icon, whereas apps without should use the document's one.
eog-ng branch, which has a full rewrite of eog's core, has been merged into trunk as part of 2.19/2.20 development cycle. Therefore this bug is fixed now. Thanks for the report!