From 9cca191b6adda9c3e7a509769cb0442a84ac2794 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 4 Dec 2000 16:11:51 +0000 Subject: [PATCH] Fix bugs Alex found: 2000-12-04 Havoc Pennington Fix bugs Alex found: * gtk/gtktooltips.c (gtk_tooltips_force_window): nuke connection to "draw" * gtk/gtkdnd.c (gtk_drag_highlight): nuke connection to "draw" * gtk/gtkcolorsel.c (palette_new): nuke connection to "draw" * gtk/gtklistitem.c (gtk_list_item_expose): Put the old _draw() implementation in here, apparently the expose() implementation was dead code. --- ChangeLog | 15 +++++++++++++++ ChangeLog.pre-2-0 | 15 +++++++++++++++ ChangeLog.pre-2-10 | 15 +++++++++++++++ ChangeLog.pre-2-2 | 15 +++++++++++++++ ChangeLog.pre-2-4 | 15 +++++++++++++++ ChangeLog.pre-2-6 | 15 +++++++++++++++ ChangeLog.pre-2-8 | 15 +++++++++++++++ gtk/gtkcolorsel.c | 9 --------- gtk/gtkdnd.c | 3 --- gtk/gtklistitem.c | 43 ++++++++++++++++++++++++++++++------------- gtk/gtktooltips.c | 4 ---- 11 files changed, 135 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8cf750dc3b..0ca9c7c0ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2000-12-04 Havoc Pennington + + Fix bugs Alex found: + + * gtk/gtktooltips.c (gtk_tooltips_force_window): nuke connection + to "draw" + + * gtk/gtkdnd.c (gtk_drag_highlight): nuke connection to "draw" + + * gtk/gtkcolorsel.c (palette_new): nuke connection to "draw" + + * gtk/gtklistitem.c (gtk_list_item_expose): Put the old _draw() + implementation in here, apparently the expose() implementation was + dead code. + 2000-12-04 Alexander Larsson * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_metrics): diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 8cf750dc3b..0ca9c7c0ec 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,18 @@ +2000-12-04 Havoc Pennington + + Fix bugs Alex found: + + * gtk/gtktooltips.c (gtk_tooltips_force_window): nuke connection + to "draw" + + * gtk/gtkdnd.c (gtk_drag_highlight): nuke connection to "draw" + + * gtk/gtkcolorsel.c (palette_new): nuke connection to "draw" + + * gtk/gtklistitem.c (gtk_list_item_expose): Put the old _draw() + implementation in here, apparently the expose() implementation was + dead code. + 2000-12-04 Alexander Larsson * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_metrics): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8cf750dc3b..0ca9c7c0ec 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,18 @@ +2000-12-04 Havoc Pennington + + Fix bugs Alex found: + + * gtk/gtktooltips.c (gtk_tooltips_force_window): nuke connection + to "draw" + + * gtk/gtkdnd.c (gtk_drag_highlight): nuke connection to "draw" + + * gtk/gtkcolorsel.c (palette_new): nuke connection to "draw" + + * gtk/gtklistitem.c (gtk_list_item_expose): Put the old _draw() + implementation in here, apparently the expose() implementation was + dead code. + 2000-12-04 Alexander Larsson * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_metrics): diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 8cf750dc3b..0ca9c7c0ec 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,18 @@ +2000-12-04 Havoc Pennington + + Fix bugs Alex found: + + * gtk/gtktooltips.c (gtk_tooltips_force_window): nuke connection + to "draw" + + * gtk/gtkdnd.c (gtk_drag_highlight): nuke connection to "draw" + + * gtk/gtkcolorsel.c (palette_new): nuke connection to "draw" + + * gtk/gtklistitem.c (gtk_list_item_expose): Put the old _draw() + implementation in here, apparently the expose() implementation was + dead code. + 2000-12-04 Alexander Larsson * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_metrics): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 8cf750dc3b..0ca9c7c0ec 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,18 @@ +2000-12-04 Havoc Pennington + + Fix bugs Alex found: + + * gtk/gtktooltips.c (gtk_tooltips_force_window): nuke connection + to "draw" + + * gtk/gtkdnd.c (gtk_drag_highlight): nuke connection to "draw" + + * gtk/gtkcolorsel.c (palette_new): nuke connection to "draw" + + * gtk/gtklistitem.c (gtk_list_item_expose): Put the old _draw() + implementation in here, apparently the expose() implementation was + dead code. + 2000-12-04 Alexander Larsson * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_metrics): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8cf750dc3b..0ca9c7c0ec 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,18 @@ +2000-12-04 Havoc Pennington + + Fix bugs Alex found: + + * gtk/gtktooltips.c (gtk_tooltips_force_window): nuke connection + to "draw" + + * gtk/gtkdnd.c (gtk_drag_highlight): nuke connection to "draw" + + * gtk/gtkcolorsel.c (palette_new): nuke connection to "draw" + + * gtk/gtklistitem.c (gtk_list_item_expose): Put the old _draw() + implementation in here, apparently the expose() implementation was + dead code. + 2000-12-04 Alexander Larsson * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_metrics): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8cf750dc3b..0ca9c7c0ec 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,18 @@ +2000-12-04 Havoc Pennington + + Fix bugs Alex found: + + * gtk/gtktooltips.c (gtk_tooltips_force_window): nuke connection + to "draw" + + * gtk/gtkdnd.c (gtk_drag_highlight): nuke connection to "draw" + + * gtk/gtkcolorsel.c (palette_new): nuke connection to "draw" + + * gtk/gtklistitem.c (gtk_list_item_expose): Put the old _draw() + implementation in here, apparently the expose() implementation was + dead code. + 2000-12-04 Alexander Larsson * gdk/linux-fb/gdkpango-fb.c (pango_fb_font_get_metrics): diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c index e7c10694d8..4bcce9934b 100644 --- a/gtk/gtkcolorsel.c +++ b/gtk/gtkcolorsel.c @@ -621,14 +621,6 @@ palette_press (GtkWidget *drawing_area, gtk_widget_queue_clear (priv->last_palette); } -static void -palette_draw (GtkWidget *drawing_area, - GdkRectangle *area, - gpointer data) -{ - palette_paint (drawing_area, area, data); -} - static void palette_unset_color (GtkWidget *drawing_area) { @@ -819,7 +811,6 @@ palette_new (GtkColorSelection *colorsel) gtk_object_set_data (GTK_OBJECT (retval), "color_set", GINT_TO_POINTER (0)); gtk_widget_set_events (retval, GDK_BUTTON_PRESS_MASK | GDK_EXPOSURE_MASK); - gtk_signal_connect (GTK_OBJECT (retval), "draw", palette_draw, colorsel); gtk_signal_connect (GTK_OBJECT (retval), "expose_event", palette_expose, colorsel); gtk_signal_connect (GTK_OBJECT (retval), "button_press_event", palette_press, colorsel); diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 0abbdda674..e566b04970 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -810,9 +810,6 @@ gtk_drag_highlight_expose (GtkWidget *widget, void gtk_drag_highlight (GtkWidget *widget) { - gtk_signal_connect_after (GTK_OBJECT (widget), "draw", - GTK_SIGNAL_FUNC (gtk_drag_highlight_paint), - NULL); gtk_signal_connect (GTK_OBJECT (widget), "expose_event", GTK_SIGNAL_FUNC (gtk_drag_highlight_expose), NULL); diff --git a/gtk/gtklistitem.c b/gtk/gtklistitem.c index 3e40c0f8cf..9ca79f5383 100644 --- a/gtk/gtklistitem.c +++ b/gtk/gtklistitem.c @@ -482,36 +482,53 @@ gtk_list_item_expose (GtkWidget *widget, GdkEventExpose *event) { GtkBin *bin; - GdkEventExpose child_event; g_return_val_if_fail (widget != NULL, FALSE); - g_return_val_if_fail (GTK_IS_LIST_ITEM (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); if (GTK_WIDGET_DRAWABLE (widget)) { bin = GTK_BIN (widget); - if (!GTK_WIDGET_IS_SENSITIVE (widget)) - gdk_window_set_background (widget->window, &widget->style->bg[GTK_STATE_INSENSITIVE]); - else if (widget->state == GTK_STATE_NORMAL) - gdk_window_set_background (widget->window, &widget->style->base[GTK_STATE_NORMAL]); + if (widget->state == GTK_STATE_NORMAL) + { + gdk_window_set_back_pixmap (widget->window, NULL, TRUE); + gdk_window_clear_area (widget->window, event->area.x, event->area.y, + event->area.width, event->area.height); + } else - gdk_window_set_background (widget->window, &widget->style->bg[widget->state]); - - gdk_window_clear_area (widget->window, event->area.x, event->area.y, - event->area.width, event->area.height); + { + gtk_paint_flat_box (widget->style, widget->window, + widget->state, GTK_SHADOW_ETCHED_OUT, + &event->area, widget, "listitem", + 0, 0, -1, -1); + } if (bin->child) { + GdkEventExpose child_event; + child_event = *event; if (GTK_WIDGET_NO_WINDOW (bin->child) && gtk_widget_intersect (bin->child, &event->area, &child_event.area)) gtk_widget_event (bin->child, (GdkEvent*) &child_event); } - - gtk_widget_draw_focus (widget); + + if (GTK_WIDGET_HAS_FOCUS (widget)) + { + if (GTK_IS_LIST (widget->parent) && GTK_LIST (widget->parent)->add_mode) + gtk_paint_focus (widget->style, widget->window, + NULL, widget, "add-mode", + 0, 0, + widget->allocation.width - 1, + widget->allocation.height - 1); + else + gtk_paint_focus (widget->style, widget->window, + NULL, widget, NULL, + 0, 0, + widget->allocation.width - 1, + widget->allocation.height - 1); + } } return FALSE; diff --git a/gtk/gtktooltips.c b/gtk/gtktooltips.c index b09b8288d3..5de565ada5 100644 --- a/gtk/gtktooltips.c +++ b/gtk/gtktooltips.c @@ -173,10 +173,6 @@ gtk_tooltips_force_window (GtkTooltips *tooltips) "expose_event", GTK_SIGNAL_FUNC (gtk_tooltips_paint_window), GTK_OBJECT (tooltips)); - gtk_signal_connect_object (GTK_OBJECT (tooltips->tip_window), - "draw", - GTK_SIGNAL_FUNC (gtk_tooltips_paint_window), - GTK_OBJECT (tooltips)); tooltips->tip_label = gtk_label_new (NULL); gtk_label_set_line_wrap (GTK_LABEL (tooltips->tip_label), TRUE);