summaryrefslogtreecommitdiff
path: root/gtk/gtkdialog.c
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2010-08-17 15:08:04 +0200
committerJavier Jardón <jjardon@gnome.org>2010-08-23 20:18:10 +0200
commit014fc1f73ae7e0b6fa47e490fe8ba1a31d4b3030 (patch)
treebcf53855fbd263f8341add5b86a306c28c1671a0 /gtk/gtkdialog.c
parent595b27e22d2bea2b346b2695516b83fdb9fd9745 (diff)
downloadgtk+-014fc1f73ae7e0b6fa47e490fe8ba1a31d4b3030.tar.gz
gtk/gtkdialog.c: Use accessor functions to access GtkWindow
Diffstat (limited to 'gtk/gtkdialog.c')
-rw-r--r--gtk/gtkdialog.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index e62f68efde..01aec48ca8 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -407,13 +407,15 @@ gtk_dialog_delete_event_handler (GtkWidget *widget,
static void
gtk_dialog_map (GtkWidget *widget)
{
+ GtkWidget *default_widget, *focus;
GtkWindow *window = GTK_WINDOW (widget);
GtkDialog *dialog = GTK_DIALOG (widget);
GtkDialogPriv *priv = dialog->priv;
GTK_WIDGET_CLASS (gtk_dialog_parent_class)->map (widget);
- if (!window->focus_widget)
+ focus = gtk_window_get_focus (window);
+ if (!focus)
{
GList *children, *tmp_list;
GtkWidget *first_focus = NULL;
@@ -422,14 +424,15 @@ gtk_dialog_map (GtkWidget *widget)
{
g_signal_emit_by_name (window, "move_focus", GTK_DIR_TAB_FORWARD);
+ focus = gtk_window_get_focus (window);
if (first_focus == NULL)
- first_focus = window->focus_widget;
- else if (first_focus == window->focus_widget)
+ first_focus = focus;
+ else if (first_focus == focus)
break;
- if (!GTK_IS_LABEL (window->focus_widget))
+ if (!GTK_IS_LABEL (focus))
break;
- if (!gtk_label_get_current_uri (GTK_LABEL (window->focus_widget)))
- gtk_label_select_region (GTK_LABEL (window->focus_widget), 0, 0);
+ if (!gtk_label_get_current_uri (GTK_LABEL (focus)))
+ gtk_label_select_region (GTK_LABEL (focus), 0, 0);
}
while (TRUE);
@@ -438,13 +441,13 @@ gtk_dialog_map (GtkWidget *widget)
while (tmp_list)
{
GtkWidget *child = tmp_list->data;
-
- if ((window->focus_widget == NULL ||
- child == window->focus_widget) &&
- child != window->default_widget &&
- window->default_widget)
+
+ default_widget = gtk_window_get_default_widget (window);
+ if ((focus == NULL || child == focus) &&
+ child != default_widget &&
+ default_widget)
{
- gtk_widget_grab_focus (window->default_widget);
+ gtk_widget_grab_focus (default_widget);
break;
}
@@ -1073,7 +1076,7 @@ gtk_dialog_run (GtkDialog *dialog)
g_object_ref (dialog);
- was_modal = GTK_WINDOW (dialog)->modal;
+ was_modal = gtk_window_get_modal (GTK_WINDOW (dialog));
if (!was_modal)
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);