GNOME Bugzilla – Bug 578468
Change of font DPI setting does not effect desktop icons
Last modified: 2011-09-09 04:50:26 UTC
Please describe the problem: Open the Control Center, go to Look and Feel --> Appearance then select the Font tab and click the Details button near the bottom. The setting at the top of this screen is "Resolution xx dots per inch". When this setting is changed all of the text displayed for the graphic desktop changes except for any desktop icons. Steps to reproduce: 1. gnome-appearance-properties -- font -- details 2. change the "Resolution xx dots per inch" Actual results: Most of the text will not be changed. Except the long text which was ellipsized Expected results: all the text of icons in the icon view will be changed Does this happen every time? Yes Other information: https://bugzilla.novell.com/show_bug.cgi?id=438280
Created attachment 132399 [details] [review] reload the pango layout when dpi changed The pango layout of the icon item on the desktop was cached. When the dpi changed, the old layout will be used so the width and the height of the label text will not be refreshed. The patch recompute the layout when there is a need to get the layout informations.
Eh? That will blow away all the info in the layout every time the cache is used, thus making the cache totally useless (same speed as no cache, uses more memory) What we need to do is catch the DPI change event and recompute the layouts then. Does changing the DPI send style_set? If so we need only a minor change to nautilus-icon-container.c:style_set().
2009-04-16 Alexander Larsson <alexl@redhat.com> Bug 578468 – Change of font DPI setting does not effect desktop icons * libnautilus-private/nautilus-icon-canvas-item.c: (nautilus_icon_canvas_item_invalidate_label_size): Invalidate pango layouts since the context could have changed For instance the font DPI.
Created attachment 135792 [details] [review] unset the pango layout in 'style-set' I found the codes in trunk did not solve this bug. In 'style-set', it 'invalidate_label_sizes' which did not unset or recompute the pango-layout. The patch uses 'invalidate_labels', unset the label size and all the layouts.
Reopening per comment #4.
Thanks, patch looks right. I pushed this to master.