Skip to content

Commit 779e0af

Browse files
llandwerlin-intellukefromdc
authored andcommitted
canvas-container: listen to scale factor to invalidate icons
This is one of the condition that needs to trigger an invalidation to recompute layout at the correct size. https://bugzilla.gnome.org/show_bug.cgi?id=776896 origin commit: https://gitlab.gnome.org/GNOME/nautilus/commit/b257699e
1 parent a864855 commit 779e0af

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

libcaja-private/caja-icon-container.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6621,6 +6621,15 @@ handle_focus_out_event (GtkWidget *widget, GdkEventFocus *event, gpointer user_d
66216621
return FALSE;
66226622
}
66236623

6624+
static void
6625+
handle_scale_factor_changed (GObject *object,
6626+
GParamSpec *pspec,
6627+
gpointer user_data)
6628+
{
6629+
invalidate_labels (CAJA_ICON_CONTAINER (object));
6630+
caja_icon_container_request_update_all (CAJA_ICON_CONTAINER (object));
6631+
}
6632+
66246633

66256634
static int text_ellipsis_limits[CAJA_ZOOM_LEVEL_N_ENTRIES];
66266635
static int desktop_text_ellipsis_limit;
@@ -6743,6 +6752,9 @@ caja_icon_container_init (CajaIconContainer *container)
67436752
g_signal_connect (container, "focus-out-event",
67446753
G_CALLBACK (handle_focus_out_event), NULL);
67456754

6755+
g_signal_connect (container, "notify::scale-factor",
6756+
G_CALLBACK (handle_scale_factor_changed), NULL);
6757+
67466758
eel_background_set_use_base (background, TRUE);
67476759

67486760
if (!setup_prefs)

0 commit comments

Comments
 (0)