Commit 0165cce6 authored by Sebastian Keller's avatar Sebastian Keller

stylecontext: Add style property fallback for gtk-cursor-aspect-ratio

The gtk-cursor-aspect-ratio GtkSetting was only recently introduced and
replaced the cursor-aspect-ratio style property. This was causing old
configurations that used CSS to modify this property to no longer apply.
This commit introduces a fallback from the GtkSetting to the style
property if the value of the setting is unchanged.

Related: #3441
parent 6c5489ab
......@@ -2916,6 +2916,14 @@ gtk_render_insertion_cursor (GtkStyleContext *context,
"gtk-cursor-aspect-ratio", &aspect_ratio,
NULL);
/* Fall back to style property if the GtkSetting property is unchanged */
if (aspect_ratio == 0.04f)
{
gtk_style_context_get_style (context,
"cursor-aspect-ratio", &aspect_ratio,
NULL);
}
keymap_direction = gdk_keymap_get_direction (gdk_keymap_get_for_display (gdk_screen_get_display (priv->screen)));
pango_layout_get_cursor_pos (layout, index, &strong_pos, &weak_pos);
......@@ -3003,6 +3011,14 @@ gtk_draw_insertion_cursor (GtkWidget *widget,
"gtk-cursor-aspect-ratio", &aspect_ratio,
NULL);
/* Fall back to style property if the GtkSetting property is unchanged */
if (aspect_ratio == 0.04f)
{
gtk_style_context_get_style (context,
"cursor-aspect-ratio", &aspect_ratio,
NULL);
}
draw_insertion_cursor (context, cr,
location->x, location->y, location->height,
aspect_ratio,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment