mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
listbase: Only grab_focus() if the cursor moved
If there is no movement, grab_focus() on the already focused widget just causes weird inconsistencies and we don't want those.
This commit is contained in:
parent
7285830dfb
commit
fa7a5773d4
@ -1091,15 +1091,16 @@ gtk_list_base_move_cursor (GtkWidget *widget,
|
||||
GtkListBase *self = GTK_LIST_BASE (widget);
|
||||
int amount;
|
||||
guint orientation;
|
||||
guint pos;
|
||||
guint old_pos, new_pos;
|
||||
gboolean select, modify, extend;
|
||||
|
||||
g_variant_get (args, "(ubbbi)", &orientation, &select, &modify, &extend, &amount);
|
||||
|
||||
pos = gtk_list_base_get_focus_position (self);
|
||||
pos = gtk_list_base_move_focus (self, pos, orientation, amount);
|
||||
old_pos = gtk_list_base_get_focus_position (self);
|
||||
new_pos = gtk_list_base_move_focus (self, old_pos, orientation, amount);
|
||||
|
||||
gtk_list_base_grab_focus_on_item (GTK_LIST_BASE (self), pos, select, modify, extend);
|
||||
if (old_pos != new_pos)
|
||||
gtk_list_base_grab_focus_on_item (GTK_LIST_BASE (self), new_pos, select, modify, extend);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user