Commit 586bbc9b authored by Matthias Clasen's avatar Matthias Clasen

Make the initial focus in dialogs work as intended

We had code that tried to prevent selecting the text in the label
if we end up focusing a label, but it didn't take effect, because
we were moving the focus into the label again afterwards.
parent e1143c2d
......@@ -419,25 +419,28 @@ gtk_dialog_map (GtkWidget *widget)
{
GList *children, *tmp_list;
GtkWidget *first_focus = NULL;
do
{
g_signal_emit_by_name (window, "move_focus", GTK_DIR_TAB_FORWARD);
do
{
g_signal_emit_by_name (window, "move_focus", GTK_DIR_TAB_FORWARD);
focus = gtk_window_get_focus (window);
if (first_focus == NULL)
if (first_focus == NULL)
first_focus = focus;
else if (first_focus == focus)
else if (first_focus == focus)
{
if (GTK_IS_LABEL (focus) &&
!gtk_label_get_current_uri (GTK_LABEL (focus)))
gtk_label_select_region (GTK_LABEL (focus), 0, 0);
break;
}
if (!GTK_IS_LABEL (focus))
break;
if (!GTK_IS_LABEL (focus))
break;
if (!gtk_label_get_current_uri (GTK_LABEL (focus)))
gtk_label_select_region (GTK_LABEL (focus), 0, 0);
}
}
while (TRUE);
tmp_list = children = gtk_container_get_children (GTK_CONTAINER (priv->action_area));
while (tmp_list)
{
GtkWidget *child = tmp_list->data;
......
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