summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog26
-rw-r--r--ChangeLog.pre-2-026
-rw-r--r--ChangeLog.pre-2-1026
-rw-r--r--ChangeLog.pre-2-226
-rw-r--r--ChangeLog.pre-2-426
-rw-r--r--ChangeLog.pre-2-626
-rw-r--r--ChangeLog.pre-2-826
-rw-r--r--TODO5
-rw-r--r--gtk/gtkcontainer.c2
-rw-r--r--gtk/gtkentry.c2
-rw-r--r--gtk/gtklabel.c34
-rw-r--r--gtk/gtklabel.h1
-rw-r--r--gtk/gtkpreview.c24
-rw-r--r--gtk/gtkwidget.c9
-rw-r--r--gtk/gtkwindow.c2
15 files changed, 231 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index ead6fea19c..de8d60bbb3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+Sun Apr 12 20:09:40 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtklabel.[ch] (gtk_label_expose): Set a flag so
+ instead of clearing the area in advance. That looked
+ _really_ bad.
+
+ * gtk/gtkcontainer.c (gtk_container_class_init): Changed
+ "focus" to RUN_LAST.
+
+ * gtk/gtkentry.c (gtk_entry_realize): Fixed place
+ where allocation was used where requisition was meant.
+ (Found by David J N Begley <david@avarice.nepean.uws.edu.au>)
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Fixed
+ assertion in when setting default to NULL>
+ ("Damon Chaplin" <DAChaplin@email.msn.com>)
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Unset the
+ default widget on the toplevel, if necessary.
+
+Sun Apr 12 02:04:21 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkpreview.c: Removed unecessary and harmful
+ htons/ntohs when storing properties. (X does the byte
+ swapping itself)
+
Sat Apr 11 02:01:31 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c (scroll_down): Removed incorrect part of
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index ead6fea19c..de8d60bbb3 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,29 @@
+Sun Apr 12 20:09:40 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtklabel.[ch] (gtk_label_expose): Set a flag so
+ instead of clearing the area in advance. That looked
+ _really_ bad.
+
+ * gtk/gtkcontainer.c (gtk_container_class_init): Changed
+ "focus" to RUN_LAST.
+
+ * gtk/gtkentry.c (gtk_entry_realize): Fixed place
+ where allocation was used where requisition was meant.
+ (Found by David J N Begley <david@avarice.nepean.uws.edu.au>)
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Fixed
+ assertion in when setting default to NULL>
+ ("Damon Chaplin" <DAChaplin@email.msn.com>)
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Unset the
+ default widget on the toplevel, if necessary.
+
+Sun Apr 12 02:04:21 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkpreview.c: Removed unecessary and harmful
+ htons/ntohs when storing properties. (X does the byte
+ swapping itself)
+
Sat Apr 11 02:01:31 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c (scroll_down): Removed incorrect part of
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index ead6fea19c..de8d60bbb3 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,29 @@
+Sun Apr 12 20:09:40 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtklabel.[ch] (gtk_label_expose): Set a flag so
+ instead of clearing the area in advance. That looked
+ _really_ bad.
+
+ * gtk/gtkcontainer.c (gtk_container_class_init): Changed
+ "focus" to RUN_LAST.
+
+ * gtk/gtkentry.c (gtk_entry_realize): Fixed place
+ where allocation was used where requisition was meant.
+ (Found by David J N Begley <david@avarice.nepean.uws.edu.au>)
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Fixed
+ assertion in when setting default to NULL>
+ ("Damon Chaplin" <DAChaplin@email.msn.com>)
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Unset the
+ default widget on the toplevel, if necessary.
+
+Sun Apr 12 02:04:21 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkpreview.c: Removed unecessary and harmful
+ htons/ntohs when storing properties. (X does the byte
+ swapping itself)
+
Sat Apr 11 02:01:31 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c (scroll_down): Removed incorrect part of
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index ead6fea19c..de8d60bbb3 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,29 @@
+Sun Apr 12 20:09:40 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtklabel.[ch] (gtk_label_expose): Set a flag so
+ instead of clearing the area in advance. That looked
+ _really_ bad.
+
+ * gtk/gtkcontainer.c (gtk_container_class_init): Changed
+ "focus" to RUN_LAST.
+
+ * gtk/gtkentry.c (gtk_entry_realize): Fixed place
+ where allocation was used where requisition was meant.
+ (Found by David J N Begley <david@avarice.nepean.uws.edu.au>)
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Fixed
+ assertion in when setting default to NULL>
+ ("Damon Chaplin" <DAChaplin@email.msn.com>)
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Unset the
+ default widget on the toplevel, if necessary.
+
+Sun Apr 12 02:04:21 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkpreview.c: Removed unecessary and harmful
+ htons/ntohs when storing properties. (X does the byte
+ swapping itself)
+
Sat Apr 11 02:01:31 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c (scroll_down): Removed incorrect part of
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index ead6fea19c..de8d60bbb3 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,29 @@
+Sun Apr 12 20:09:40 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtklabel.[ch] (gtk_label_expose): Set a flag so
+ instead of clearing the area in advance. That looked
+ _really_ bad.
+
+ * gtk/gtkcontainer.c (gtk_container_class_init): Changed
+ "focus" to RUN_LAST.
+
+ * gtk/gtkentry.c (gtk_entry_realize): Fixed place
+ where allocation was used where requisition was meant.
+ (Found by David J N Begley <david@avarice.nepean.uws.edu.au>)
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Fixed
+ assertion in when setting default to NULL>
+ ("Damon Chaplin" <DAChaplin@email.msn.com>)
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Unset the
+ default widget on the toplevel, if necessary.
+
+Sun Apr 12 02:04:21 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkpreview.c: Removed unecessary and harmful
+ htons/ntohs when storing properties. (X does the byte
+ swapping itself)
+
Sat Apr 11 02:01:31 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c (scroll_down): Removed incorrect part of
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index ead6fea19c..de8d60bbb3 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,29 @@
+Sun Apr 12 20:09:40 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtklabel.[ch] (gtk_label_expose): Set a flag so
+ instead of clearing the area in advance. That looked
+ _really_ bad.
+
+ * gtk/gtkcontainer.c (gtk_container_class_init): Changed
+ "focus" to RUN_LAST.
+
+ * gtk/gtkentry.c (gtk_entry_realize): Fixed place
+ where allocation was used where requisition was meant.
+ (Found by David J N Begley <david@avarice.nepean.uws.edu.au>)
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Fixed
+ assertion in when setting default to NULL>
+ ("Damon Chaplin" <DAChaplin@email.msn.com>)
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Unset the
+ default widget on the toplevel, if necessary.
+
+Sun Apr 12 02:04:21 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkpreview.c: Removed unecessary and harmful
+ htons/ntohs when storing properties. (X does the byte
+ swapping itself)
+
Sat Apr 11 02:01:31 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c (scroll_down): Removed incorrect part of
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index ead6fea19c..de8d60bbb3 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,29 @@
+Sun Apr 12 20:09:40 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtklabel.[ch] (gtk_label_expose): Set a flag so
+ instead of clearing the area in advance. That looked
+ _really_ bad.
+
+ * gtk/gtkcontainer.c (gtk_container_class_init): Changed
+ "focus" to RUN_LAST.
+
+ * gtk/gtkentry.c (gtk_entry_realize): Fixed place
+ where allocation was used where requisition was meant.
+ (Found by David J N Begley <david@avarice.nepean.uws.edu.au>)
+
+ * gtk/gtkwindow.c (gtk_window_set_default): Fixed
+ assertion in when setting default to NULL>
+ ("Damon Chaplin" <DAChaplin@email.msn.com>)
+
+ * gtk/gtkwidget.c (gtk_widget_unparent): Unset the
+ default widget on the toplevel, if necessary.
+
+Sun Apr 12 02:04:21 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkpreview.c: Removed unecessary and harmful
+ htons/ntohs when storing properties. (X does the byte
+ swapping itself)
+
Sat Apr 11 02:01:31 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtktext.c (scroll_down): Removed incorrect part of
diff --git a/TODO b/TODO
index f7b040d331..454150c605 100644
--- a/TODO
+++ b/TODO
@@ -197,6 +197,11 @@ Additions:
* Scrolled windows need to be smarter about when they size-request/allocate
their children.
+ * Should all the default handlers really return FALSE? This can
+ cause confusing presses to be sent to containers that actually
+ want to get events on themselves.
+
+
Text/Edit widget:
Bugs:
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index f8adbe3a71..064211245d 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -181,7 +181,7 @@ gtk_container_class_init (GtkContainerClass *class)
GTK_TYPE_C_CALLBACK);
container_signals[FOCUS] =
gtk_signal_new ("focus",
- GTK_RUN_FIRST,
+ GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (GtkContainerClass, focus),
gtk_container_marshal_signal_3,
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 2a7b067318..3978dc0564 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -462,7 +462,7 @@ gtk_entry_realize (GtkWidget *widget)
attributes.x = widget->style->klass->xthickness + INNER_BORDER;
attributes.y = widget->style->klass->ythickness + INNER_BORDER;
attributes.width = widget->allocation.width - attributes.x * 2;
- attributes.height = widget->allocation.height - attributes.y * 2;
+ attributes.height = widget->requisition.height - attributes.y * 2;
attributes.cursor = entry->cursor = gdk_cursor_new (GDK_XTERM);
attributes_mask |= GDK_WA_CURSOR;
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 77d738f291..e9f1558c99 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -139,6 +139,7 @@ gtk_label_init (GtkLabel *label)
label->label = NULL;
label->row = NULL;
label->jtype = GTK_JUSTIFY_CENTER;
+ label->needs_clear = 0;
gtk_label_set (label, "");
}
@@ -311,6 +312,23 @@ gtk_label_expose (GtkWidget *widget,
gdk_gc_set_clip_rectangle (widget->style->white_gc, &event->area);
gdk_gc_set_clip_rectangle (widget->style->fg_gc[state], &event->area);
+ /* We clear the whole allocation here so that if a partial
+ * expose is triggered we don't just clear part and mess up
+ * when the queued redraw comes along. (There will always
+ * be a complete queued redraw when the needs_clear flag
+ * is set.)
+ */
+ if (label->needs_clear)
+ {
+ gdk_window_clear_area (widget->window,
+ widget->allocation.x,
+ widget->allocation.y,
+ widget->allocation.width,
+ widget->allocation.height);
+
+ label->needs_clear = FALSE;
+ }
+
x = widget->allocation.x + misc->xpad +
(widget->allocation.width - widget->requisition.width)
* misc->xalign + 0.5;
@@ -377,25 +395,13 @@ static void
gtk_label_state_changed (GtkWidget *widget,
guint previous_state)
{
- if (GTK_WIDGET_NO_WINDOW (widget) &&
- GTK_WIDGET_DRAWABLE (widget))
- gdk_window_clear_area (widget->window,
- widget->allocation.x,
- widget->allocation.y,
- widget->allocation.width,
- widget->allocation.height);
+ GTK_LABEL (widget)->needs_clear = 1;
}
static void
gtk_label_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
- if (GTK_WIDGET_NO_WINDOW (widget) &&
- GTK_WIDGET_DRAWABLE (widget))
- gdk_window_clear_area (widget->window,
- widget->allocation.x,
- widget->allocation.y,
- widget->allocation.width,
- widget->allocation.height);
+ GTK_LABEL (widget)->needs_clear = 1;
}
diff --git a/gtk/gtklabel.h b/gtk/gtklabel.h
index 81eca4afe7..32acbe5dcf 100644
--- a/gtk/gtklabel.h
+++ b/gtk/gtklabel.h
@@ -43,6 +43,7 @@ struct _GtkLabel
char *label;
GSList *row;
guint jtype : 2;
+ gint needs_clear : 1;
};
struct _GtkLabelClass
diff --git a/gtk/gtkpreview.c b/gtk/gtkpreview.c
index 5c89808b31..269cf0c2e2 100644
--- a/gtk/gtkpreview.c
+++ b/gtk/gtkpreview.c
@@ -20,7 +20,6 @@
#include <string.h>
#include <sys/types.h>
#include <sys/param.h>
-#include <netinet/in.h>
#include "gdk/gdkx.h"
#include "gtkpreview.h"
#include "gtksignal.h"
@@ -304,14 +303,13 @@ gtk_preview_uninit ()
0, sizeof (GtkPreviewProp), FALSE,
NULL, NULL, NULL, (guchar**) &prop))
{
- prop->ref_count = ntohs (prop->ref_count) - 1;
+ prop->ref_count = prop->ref_count - 1;
if (prop->ref_count == 0)
{
gdk_property_delete (NULL, property);
}
else
{
- prop->ref_count = htons (prop->ref_count);
gdk_property_change (NULL, property, property, 16,
GDK_PROP_MODE_REPLACE,
(guchar*) prop, 5);
@@ -1508,12 +1506,12 @@ gtk_get_preview_prop (guint *nred,
0, sizeof (GtkPreviewProp), FALSE,
NULL, NULL, NULL, (guchar**) &prop))
{
- *nred = ntohs (prop->nred_shades);
- *ngreen = ntohs (prop->ngreen_shades);
- *nblue = ntohs (prop->nblue_shades);
- *ngray = ntohs (prop->ngray_shades);
+ *nred = prop->nred_shades;
+ *ngreen = prop->ngreen_shades;
+ *nblue = prop->nblue_shades;
+ *ngray = prop->ngray_shades;
- prop->ref_count = htons (ntohs (prop->ref_count) + 1);
+ prop->ref_count = prop->ref_count + 1;
gdk_property_change (NULL, property, property, 16,
GDK_PROP_MODE_REPLACE,
(guchar*) prop, 5);
@@ -1535,11 +1533,11 @@ gtk_set_preview_prop (guint nred,
property = gdk_atom_intern ("GTK_PREVIEW_INFO", FALSE);
- prop.ref_count = htons (1);
- prop.nred_shades = htons (nred);
- prop.ngreen_shades = htons (ngreen);
- prop.nblue_shades = htons (nblue);
- prop.ngray_shades = htons (ngray);
+ prop.ref_count = 1;
+ prop.nred_shades = nred;
+ prop.ngreen_shades = ngreen;
+ prop.nblue_shades = nblue;
+ prop.ngray_shades = ngray;
gdk_property_change (NULL, property, property, 16,
GDK_PROP_MODE_REPLACE,
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 866d66cc7c..8a343aae20 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -1148,6 +1148,15 @@ gtk_widget_unparent (GtkWidget *widget)
if (child == widget)
gtk_window_set_focus (GTK_WINDOW (toplevel), NULL);
+
+
+ child = GTK_WINDOW (toplevel)->default_widget;
+
+ while (child && child != widget)
+ child = child->parent;
+
+ if (child == widget)
+ gtk_window_set_default (GTK_WINDOW (toplevel), NULL);
}
/* Remove the widget and all its children from toplevel->resize_widgets
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 65699e7c6a..a8251f2f0b 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -353,7 +353,7 @@ gtk_window_set_default (GtkWindow *window,
{
g_return_if_fail (window != NULL);
g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (GTK_WIDGET_CAN_DEFAULT (defaultw));
+ g_return_if_fail ((defaultw == NULL) || GTK_WIDGET_CAN_DEFAULT (defaultw));
if (window->default_widget != defaultw)
{