keyboard: Handle keynav-failed
on input source list
Fixes keynav with arrows between the input list group and other groups.
This commit is contained in:
parent
1a3971fdbe
commit
cd4dd18f52
2 changed files with 19 additions and 0 deletions
|
@ -182,6 +182,23 @@ maybe_start_ibus (void)
|
|||
|
||||
#endif
|
||||
|
||||
static gboolean
|
||||
keynav_failed_cb (CcInputListBox *self,
|
||||
GtkDirectionType direction,
|
||||
GtkWidget *list)
|
||||
{
|
||||
GtkWidget *toplevel = GTK_WIDGET (gtk_widget_get_root (GTK_WIDGET (self)));
|
||||
|
||||
if (!toplevel)
|
||||
return FALSE;
|
||||
|
||||
if (direction != GTK_DIR_UP && direction != GTK_DIR_DOWN)
|
||||
return FALSE;
|
||||
|
||||
return gtk_widget_child_focus (toplevel, direction == GTK_DIR_UP ?
|
||||
GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD);
|
||||
}
|
||||
|
||||
static void
|
||||
row_settings_cb (CcInputListBox *self,
|
||||
CcInputRow *row)
|
||||
|
@ -735,6 +752,7 @@ cc_input_list_box_class_init (CcInputListBoxClass *klass)
|
|||
gtk_widget_class_bind_template_child (widget_class, CcInputListBox, no_inputs_row);
|
||||
|
||||
gtk_widget_class_bind_template_callback (widget_class, input_row_activated_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, keynav_failed_cb);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue