+Sun Sep 03 00:47:08 2000 George Lebl <jirka@5z.com>
+
+ * gtk/gtkwidget.h: Add some documenting comments about
+ GTK_CAN_DEFAULT, GTK_HAS_DEFAULT and GTK_RECEIVES_DEFAULT
+ just as owen said on irc.
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Don't blindly
+ set HAS_DEFAULT. Only set it if there isn't another window
+ holding it (a focus window which RECEIVES_DEFAULT) and only unset
+ it if the widget is not the focused window with RECEIVES_DEFAULT.
+ This fixes weird double default bugs in dialogs which has things
+ call gtk_window_set_default at times.
+
Fri Sep 1 22:39:07 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch] TODO.xml: Apply patch from
+Sun Sep 03 00:47:08 2000 George Lebl <jirka@5z.com>
+
+ * gtk/gtkwidget.h: Add some documenting comments about
+ GTK_CAN_DEFAULT, GTK_HAS_DEFAULT and GTK_RECEIVES_DEFAULT
+ just as owen said on irc.
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Don't blindly
+ set HAS_DEFAULT. Only set it if there isn't another window
+ holding it (a focus window which RECEIVES_DEFAULT) and only unset
+ it if the widget is not the focused window with RECEIVES_DEFAULT.
+ This fixes weird double default bugs in dialogs which has things
+ call gtk_window_set_default at times.
+
Fri Sep 1 22:39:07 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch] TODO.xml: Apply patch from
+Sun Sep 03 00:47:08 2000 George Lebl <jirka@5z.com>
+
+ * gtk/gtkwidget.h: Add some documenting comments about
+ GTK_CAN_DEFAULT, GTK_HAS_DEFAULT and GTK_RECEIVES_DEFAULT
+ just as owen said on irc.
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Don't blindly
+ set HAS_DEFAULT. Only set it if there isn't another window
+ holding it (a focus window which RECEIVES_DEFAULT) and only unset
+ it if the widget is not the focused window with RECEIVES_DEFAULT.
+ This fixes weird double default bugs in dialogs which has things
+ call gtk_window_set_default at times.
+
Fri Sep 1 22:39:07 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch] TODO.xml: Apply patch from
+Sun Sep 03 00:47:08 2000 George Lebl <jirka@5z.com>
+
+ * gtk/gtkwidget.h: Add some documenting comments about
+ GTK_CAN_DEFAULT, GTK_HAS_DEFAULT and GTK_RECEIVES_DEFAULT
+ just as owen said on irc.
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Don't blindly
+ set HAS_DEFAULT. Only set it if there isn't another window
+ holding it (a focus window which RECEIVES_DEFAULT) and only unset
+ it if the widget is not the focused window with RECEIVES_DEFAULT.
+ This fixes weird double default bugs in dialogs which has things
+ call gtk_window_set_default at times.
+
Fri Sep 1 22:39:07 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch] TODO.xml: Apply patch from
+Sun Sep 03 00:47:08 2000 George Lebl <jirka@5z.com>
+
+ * gtk/gtkwidget.h: Add some documenting comments about
+ GTK_CAN_DEFAULT, GTK_HAS_DEFAULT and GTK_RECEIVES_DEFAULT
+ just as owen said on irc.
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Don't blindly
+ set HAS_DEFAULT. Only set it if there isn't another window
+ holding it (a focus window which RECEIVES_DEFAULT) and only unset
+ it if the widget is not the focused window with RECEIVES_DEFAULT.
+ This fixes weird double default bugs in dialogs which has things
+ call gtk_window_set_default at times.
+
Fri Sep 1 22:39:07 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch] TODO.xml: Apply patch from
+Sun Sep 03 00:47:08 2000 George Lebl <jirka@5z.com>
+
+ * gtk/gtkwidget.h: Add some documenting comments about
+ GTK_CAN_DEFAULT, GTK_HAS_DEFAULT and GTK_RECEIVES_DEFAULT
+ just as owen said on irc.
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Don't blindly
+ set HAS_DEFAULT. Only set it if there isn't another window
+ holding it (a focus window which RECEIVES_DEFAULT) and only unset
+ it if the widget is not the focused window with RECEIVES_DEFAULT.
+ This fixes weird double default bugs in dialogs which has things
+ call gtk_window_set_default at times.
+
Fri Sep 1 22:39:07 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch] TODO.xml: Apply patch from
+Sun Sep 03 00:47:08 2000 George Lebl <jirka@5z.com>
+
+ * gtk/gtkwidget.h: Add some documenting comments about
+ GTK_CAN_DEFAULT, GTK_HAS_DEFAULT and GTK_RECEIVES_DEFAULT
+ just as owen said on irc.
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Don't blindly
+ set HAS_DEFAULT. Only set it if there isn't another window
+ holding it (a focus window which RECEIVES_DEFAULT) and only unset
+ it if the widget is not the focused window with RECEIVES_DEFAULT.
+ This fixes weird double default bugs in dialogs which has things
+ call gtk_window_set_default at times.
+
Fri Sep 1 22:39:07 2000 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch] TODO.xml: Apply patch from
GTK_PARENT_SENSITIVE = 1 << 10,
GTK_CAN_FOCUS = 1 << 11,
GTK_HAS_FOCUS = 1 << 12,
+
+ /* widget is allowed to receive the default via gtk_widget_grab_default
+ * and will reserve space to draw the default if possible */
GTK_CAN_DEFAULT = 1 << 13,
+
+ /* the widget currently is receiving the default action and should be drawn
+ * appropriately if possible */
GTK_HAS_DEFAULT = 1 << 14,
+
GTK_HAS_GRAB = 1 << 15,
GTK_RC_STYLE = 1 << 16,
GTK_COMPOSITE_CHILD = 1 << 17,
GTK_NO_REPARENT = 1 << 18,
GTK_APP_PAINTABLE = 1 << 19,
+
+ /* the widget when focused will receive the default action and have
+ * HAS_DEFAULT set even if there is a different widget set as default */
GTK_RECEIVES_DEFAULT = 1 << 20,
+
GTK_DOUBLE_BUFFERED = 1 << 21
} GtkWidgetFlags;
{
if (window->default_widget)
{
- GTK_WIDGET_UNSET_FLAGS (window->default_widget, GTK_HAS_DEFAULT);
+ if (window->focus_widget != window->default_widget ||
+ !GTK_WIDGET_RECEIVES_DEFAULT (window->default_widget))
+ GTK_WIDGET_UNSET_FLAGS (window->default_widget, GTK_HAS_DEFAULT);
gtk_widget_draw_default (window->default_widget);
}
if (window->default_widget)
{
- GTK_WIDGET_SET_FLAGS (window->default_widget, GTK_HAS_DEFAULT);
+ if (window->focus_widget == NULL ||
+ !GTK_WIDGET_RECEIVES_DEFAULT (window->focus_widget))
+ GTK_WIDGET_SET_FLAGS (window->default_widget, GTK_HAS_DEFAULT);
gtk_widget_draw_default (window->default_widget);
}
}