summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2010-08-17 15:12:37 +0200
committerJavier Jardón <jjardon@gnome.org>2010-08-23 20:18:27 +0200
commit65266d971ebeb24ae878d1bfb8783298507b6548 (patch)
tree3b00fd36e72f7acb4929f5547bd1b83fd1f1b8b7
parent50aec80efbbae45f9736dc07160e7e767188d542 (diff)
downloadgtk+-65266d971ebeb24ae878d1bfb8783298507b6548.tar.gz
gtk/gtkentry.c: Use accessor functions to access GtkWindow
-rw-r--r--gtk/gtkentry.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 1cccba9dac..7189921e27 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -5176,6 +5176,7 @@ static void
gtk_entry_real_activate (GtkEntry *entry)
{
GtkWindow *window;
+ GtkWidget *default_widget, *focus_widget;
GtkWidget *toplevel;
GtkWidget *widget;
@@ -5187,12 +5188,15 @@ gtk_entry_real_activate (GtkEntry *entry)
if (GTK_IS_WINDOW (toplevel))
{
window = GTK_WINDOW (toplevel);
-
- if (window &&
- widget != window->default_widget &&
- !(widget == window->focus_widget &&
- (!window->default_widget || !gtk_widget_get_sensitive (window->default_widget))))
- gtk_window_activate_default (window);
+
+ if (window)
+ {
+ default_widget = gtk_window_get_default_widget (window);
+ focus_widget = gtk_window_get_focus (window);
+ if (widget != default_widget &&
+ !(widget == focus_widget && (!default_widget || !gtk_widget_get_sensitive (default_widget))))
+ gtk_window_activate_default (window);
+ }
}
}
}