Commit dd85acba authored by Florian Müllner's avatar Florian Müllner

listbox: Fix keynav_failed() parameter in move_cursor()

The 'direction' parameter to gtk_widget_keynav_failed() is based on
gtk_list_box_move_cursor()'s 'count' parameter. However if the passed
in movement is GTK_MOVEMENT_DISPLAY_LINES, 'count' is modified by
the keynav handling and will always be 0. To avoid messing up the
'direction' parameter, use a local variable for keynav handling and
leave 'count' untouched.

https://bugzilla.gnome.org/show_bug.cgi?id=709687
parent 22fe579d
......@@ -2277,17 +2277,18 @@ gtk_list_box_move_cursor (GtkListBox *list_box,
case GTK_MOVEMENT_DISPLAY_LINES:
if (priv->cursor_row != NULL)
{
int i = count;
iter = ROW_PRIV (priv->cursor_row)->iter;
while (count < 0 && iter != NULL)
while (i < 0 && iter != NULL)
{
iter = gtk_list_box_get_previous_visible (list_box, iter);
count = count + 1;
i = i + 1;
}
while (count > 0 && iter != NULL)
while (i > 0 && iter != NULL)
{
iter = gtk_list_box_get_next_visible (list_box, iter);
count = count - 1;
i = i - 1;
}
if (iter != NULL && !g_sequence_iter_is_end (iter))
......
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