After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 578468 - Change of font DPI setting does not effect desktop icons
Change of font DPI setting does not effect desktop icons
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Views: Icon View
0.x.x [obsolete]
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-09 10:38 UTC by David Liang
Modified: 2011-09-09 04:50 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
reload the pango layout when dpi changed (613 bytes, patch)
2009-04-09 10:41 UTC, David Liang
needs-work Details | Review
unset the pango layout in 'style-set' (634 bytes, patch)
2009-06-02 08:19 UTC, David Liang
committed Details | Review

Description David Liang 2009-04-09 10:38:53 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
Comment 1 David Liang 2009-04-09 10:41:08 UTC
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.
Comment 2 Alexander Larsson 2009-04-16 12:42:11 UTC
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().
Comment 3 Alexander Larsson 2009-04-16 12:56:29 UTC
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.

Comment 4 David Liang 2009-06-02 08:19:43 UTC
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.
Comment 5 Gabriel Burt 2010-01-05 22:24:42 UTC
Reopening per comment #4.
Comment 6 Cosimo Cecchi 2011-09-09 04:50:21 UTC
Thanks, patch looks right. I pushed this to master.