Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
llandwerlin-intel authored and lukefromdc committed Apr 5, 2018
1 parent a864855 commit 779e0af
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libcaja-private/caja-icon-container.c
Expand Up @@ -6621,6 +6621,15 @@ handle_focus_out_event (GtkWidget *widget, GdkEventFocus *event, gpointer user_d
return FALSE;
}

static void
handle_scale_factor_changed (GObject *object,
GParamSpec *pspec,
gpointer user_data)
{
invalidate_labels (CAJA_ICON_CONTAINER (object));
caja_icon_container_request_update_all (CAJA_ICON_CONTAINER (object));
}


static int text_ellipsis_limits[CAJA_ZOOM_LEVEL_N_ENTRIES];
static int desktop_text_ellipsis_limit;
Expand Down Expand Up @@ -6743,6 +6752,9 @@ caja_icon_container_init (CajaIconContainer *container)
g_signal_connect (container, "focus-out-event",
G_CALLBACK (handle_focus_out_event), NULL);

g_signal_connect (container, "notify::scale-factor",
G_CALLBACK (handle_scale_factor_changed), NULL);

eel_background_set_use_base (background, TRUE);

if (!setup_prefs)
Expand Down

0 comments on commit 779e0af

Please sign in to comment.