Index: unix/gtkcols.c
===================================================================
RCS file: /home/cvs/putty/unix/gtkcols.c,v
retrieving revision 1.2
diff -p -u -r1.2 gtkcols.c
--- unix/gtkcols.c	31 Mar 2003 11:22:06 -0000	1.2
+++ unix/gtkcols.c	2 Jun 2004 05:07:44 -0000
@@ -8,13 +8,12 @@ static void columns_init(Columns *cols);
 static void columns_class_init(ColumnsClass *klass);
 static void columns_map(GtkWidget *widget);
 static void columns_unmap(GtkWidget *widget);
-static void columns_draw(GtkWidget *widget, GdkRectangle *area);
 static gint columns_expose(GtkWidget *widget, GdkEventExpose *event);
 static void columns_base_add(GtkContainer *container, GtkWidget *widget);
 static void columns_remove(GtkContainer *container, GtkWidget *widget);
 static void columns_forall(GtkContainer *container, gboolean include_internals,
                            GtkCallback callback, gpointer callback_data);
-static gint columns_focus(GtkContainer *container, GtkDirectionType dir);
+static gboolean columns_focus(GtkWidget *container, GtkDirectionType dir);
 static GtkType columns_child_type(GtkContainer *container);
 static void columns_size_request(GtkWidget *widget, GtkRequisition *req);
 static void columns_size_allocate(GtkWidget *widget, GtkAllocation *alloc);
@@ -43,8 +42,8 @@ GtkType columns_get_type(void)
     return columns_type;
 }
 
-static gint (*columns_inherited_focus)(GtkContainer *container,
-				       GtkDirectionType direction);
+static gboolean (*columns_inherited_focus)(GtkWidget *widget,
+				           GtkDirectionType direction);
 
 static void columns_class_init(ColumnsClass *klass)
 {
@@ -65,7 +64,6 @@ static void columns_class_init(ColumnsCl
 
     widget_class->map = columns_map;
     widget_class->unmap = columns_unmap;
-    widget_class->draw = columns_draw;
     widget_class->expose_event = columns_expose;
     widget_class->size_request = columns_size_request;
     widget_class->size_allocate = columns_size_allocate;
@@ -76,8 +74,8 @@ static void columns_class_init(ColumnsCl
     container_class->child_type = columns_child_type;
     /* Save the previous value of this method. */
     if (!columns_inherited_focus)
-	columns_inherited_focus = container_class->focus;
-    container_class->focus = columns_focus;
+	columns_inherited_focus = widget_class->focus;
+    widget_class->focus = columns_focus;
 }
 
 static void columns_init(Columns *cols)
@@ -135,29 +133,6 @@ static void columns_unmap(GtkWidget *wid
             gtk_widget_unmap(child->widget);
     }
 }
-static void columns_draw(GtkWidget *widget, GdkRectangle *area)
-{
-    Columns *cols;
-    ColumnsChild *child;
-    GList *children;
-    GdkRectangle child_area;
-
-    g_return_if_fail(widget != NULL);
-    g_return_if_fail(IS_COLUMNS(widget));
-
-    if (GTK_WIDGET_DRAWABLE(widget)) {
-        cols = COLUMNS(widget);
-
-        for (children = cols->children;
-             children && (child = children->data);
-             children = children->next) {
-            if (child->widget &&
-		GTK_WIDGET_DRAWABLE(child->widget) &&
-                gtk_widget_intersect(child->widget, area, &child_area))
-                gtk_widget_draw(child->widget, &child_area);
-        }
-    }
-}
 static gint columns_expose(GtkWidget *widget, GdkEventExpose *event)
 {
     Columns *cols;
@@ -176,12 +151,10 @@ static gint columns_expose(GtkWidget *wi
         for (children = cols->children;
              children && (child = children->data);
              children = children->next) {
-            if (child->widget &&
-		GTK_WIDGET_DRAWABLE(child->widget) &&
-                GTK_WIDGET_NO_WINDOW(child->widget) &&
-                gtk_widget_intersect(child->widget, &event->area,
-                                     &child_event.area))
-                gtk_widget_event(child->widget, (GdkEvent *)&child_event);
+            if (child->widget) {
+                gtk_container_propagate_expose(GTK_CONTAINER(widget),
+                                               child->widget, event);
+            }
         }
     }
     return FALSE;
@@ -390,8 +363,9 @@ void columns_taborder_last(Columns *cols
  * Override GtkContainer's focus movement so the user can
  * explicitly specify the tab order.
  */
-static gint columns_focus(GtkContainer *container, GtkDirectionType dir)
+static gboolean columns_focus(GtkWidget *container, GtkDirectionType dir)
 {
+/* FIXME: Broken on Gtk2.
     Columns *cols;
     GList *pos;
     GtkWidget *focuschild;
@@ -421,7 +395,7 @@ static gint columns_focus(GtkContainer *
 
 	    if (focuschild) {
 		if (focuschild == child) {
-		    focuschild = NULL; /* now we can start looking in here */
+		    focuschild = NULL; // now we can start looking in here
 		    if (GTK_WIDGET_DRAWABLE(child) &&
 			GTK_IS_CONTAINER(child) &&
 			!GTK_WIDGET_HAS_FOCUS(child)) {
@@ -447,6 +421,7 @@ static gint columns_focus(GtkContainer *
 
 	return FALSE;
     } else
+*/
 	return columns_inherited_focus(container, dir);
 }
 
Index: unix/gtkdlg.c
===================================================================
RCS file: /home/cvs/putty/unix/gtkdlg.c,v
retrieving revision 1.30
diff -p -u -r1.30 gtkdlg.c
--- unix/gtkdlg.c	17 Jan 2004 14:25:36 -0000	1.30
+++ unix/gtkdlg.c	2 Jun 2004 05:07:45 -0000
@@ -5,8 +5,6 @@
 /*
  * TODO when porting to GTK 2.0:
  * 
- *  - GtkTree is apparently deprecated and we should switch to
- *    GtkTreeView instead.
  *  - GtkLabel has a built-in mnemonic scheme, so we should at
  *    least consider switching to that from the current adhockery.
  */
@@ -67,9 +65,8 @@ struct dlgparam {
      * due to automatic processing and should not flag a user event. */
     int flags;
     struct Shortcuts *shortcuts;
-    GtkWidget *window, *cancelbutton, *currtreeitem, **treeitems;
+    GtkWidget *window, *cancelbutton;
     union control *currfocus, *lastfocus;
-    int ntreeitems;
     int retval;
 };
 #define FLAG_UPDATING_COMBO_LIST 1
@@ -150,8 +147,7 @@ static void dlg_init(struct dlgparam *dp
     dp->byctrl = newtree234(uctrl_cmp_byctrl);
     dp->bywidget = newtree234(uctrl_cmp_bywidget);
     dp->coloursel_result.ok = FALSE;
-    dp->treeitems = NULL;
-    dp->window = dp->cancelbutton = dp->currtreeitem = NULL;
+    dp->window = dp->cancelbutton = NULL;
     dp->flags = 0;
     dp->currfocus = NULL;
 }
@@ -171,7 +167,6 @@ static void dlg_cleanup(struct dlgparam 
     }
     freetree234(dp->bywidget);
     dp->bywidget = NULL;
-    sfree(dp->treeitems);
 }
 
 static void dlg_add_uctrl(struct dlgparam *dp, struct uctrl *uc)
@@ -666,7 +661,7 @@ void dlg_set_focus(union control *ctrl, 
             gtk_widget_grab_focus(uc->optmenu);
         } else {
             assert(uc->list != NULL);
-            gtk_container_focus(GTK_CONTAINER(uc->list), GTK_DIR_TAB_FORWARD);
+            gtk_widget_child_focus(GTK_WIDGET(uc->list), GTK_DIR_TAB_FORWARD);
         }
         break;
     }
@@ -794,7 +789,7 @@ void dlg_coloursel_start(union control *
     dp->coloursel_result.ok = FALSE;
 
     gtk_window_set_modal(GTK_WINDOW(coloursel), TRUE);
-    gtk_color_selection_set_opacity(GTK_COLOR_SELECTION(ccs->colorsel), FALSE);
+    // gtk_color_selection_set_opacity(GTK_COLOR_SELECTION(ccs->colorsel), FALSE);
     cvals[0] = r / 255.0;
     cvals[1] = g / 255.0;
     cvals[2] = b / 255.0;
@@ -1088,7 +1083,7 @@ static void filesel_ok(GtkButton *button
     /* struct dlgparam *dp = (struct dlgparam *)data; */
     gpointer filesel = gtk_object_get_data(GTK_OBJECT(button), "user-data");
     struct uctrl *uc = gtk_object_get_data(GTK_OBJECT(filesel), "user-data");
-    char *name = gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel));
+    const char *name = gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel));
     gtk_entry_set_text(GTK_ENTRY(uc->entry), name);
 }
 
@@ -1153,15 +1148,17 @@ static void filefont_clicked(GtkButton *
     }
 
     if (uc->ctrl->generic.type == CTRL_FONTSELECT) {
-	gchar *spacings[] = { "c", "m", NULL };
-        gchar *fontname = gtk_entry_get_text(GTK_ENTRY(uc->entry));
+	// gchar *spacings[] = { "c", "m", NULL };
+        const gchar *fontname = gtk_entry_get_text(GTK_ENTRY(uc->entry));
 	GtkWidget *fontsel =
 	    gtk_font_selection_dialog_new("Select a font");
 	gtk_window_set_modal(GTK_WINDOW(fontsel), TRUE);
+        /* FIXME: Broken on Gtk2.
 	gtk_font_selection_dialog_set_filter
 	    (GTK_FONT_SELECTION_DIALOG(fontsel),
 	     GTK_FONT_FILTER_BASE, GTK_FONT_ALL,
 	     NULL, NULL, NULL, NULL, spacings, NULL);
+        */
 	if (!gtk_font_selection_dialog_set_font_name
 	    (GTK_FONT_SELECTION_DIALOG(fontsel), fontname)) {
             /*
@@ -1547,10 +1544,14 @@ GtkWidget *layout_ctrls(struct dlgparam 
                  * upgrades, I'd be grateful.
                  */
 		{
+                    /* FIXME: Broken on Gtk2
 		    int edge = GTK_WIDGET(uc->list)->style->klass->ythickness;
                     gtk_widget_set_usize(w, 10,
                                          2*edge + (ctrl->listbox.height *
 						   listitemheight));
+                    */
+                    gtk_widget_set_usize(w, 10, (ctrl->listbox.height *
+						listitemheight));
 		}
 
                 if (ctrl->listbox.draglist) {
@@ -1667,18 +1668,24 @@ GtkWidget *layout_ctrls(struct dlgparam 
 struct selparam {
     struct dlgparam *dp;
     Panels *panels;
-    GtkWidget *panel, *treeitem;
+    GtkWidget *panel;
     struct Shortcuts shortcuts;
 };
 
-static void treeitem_sel(GtkItem *item, gpointer data)
+static void tree_sel(GtkTreeSelection *selection, gpointer data)
 {
-    struct selparam *sp = (struct selparam *)data;
+    GtkTreeIter iter;
+    GtkTreeModel *model;
 
-    panels_switch_to(sp->panels, sp->panel);
+    if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
+        struct selparam *sp;
 
-    sp->dp->shortcuts = &sp->shortcuts;
-    sp->dp->currtreeitem = sp->treeitem;
+        gtk_tree_model_get(model, &iter, 1, &sp, -1);
+
+        panels_switch_to(sp->panels, sp->panel);
+
+        sp->dp->shortcuts = &sp->shortcuts;
+    }
 }
 
 static void window_destroy(GtkWidget *widget, gpointer data)
@@ -1688,6 +1695,7 @@ static void window_destroy(GtkWidget *wi
 
 static int tree_grab_focus(struct dlgparam *dp)
 {
+#if 0
     int i, f;
 
     /*
@@ -1706,6 +1714,8 @@ static int tree_grab_focus(struct dlgpar
         gtk_widget_grab_focus(dp->currtreeitem);
         return TRUE;
     }
+#endif
+    return FALSE;
 }
 
 gint tree_focus(GtkContainer *container, GtkDirectionType direction,
@@ -1815,8 +1825,8 @@ int win_key_press(GtkWidget *widget, Gdk
 		} else {
                     assert(sc->uc->list != NULL);
 
-                    gtk_container_focus(GTK_CONTAINER(sc->uc->list),
-                                        GTK_DIR_TAB_FORWARD);
+                    gtk_widget_child_focus(GTK_WIDGET(sc->uc->list),
+                                           GTK_DIR_TAB_FORWARD);
 		}
 		break;
 	    }
@@ -1827,75 +1837,6 @@ int win_key_press(GtkWidget *widget, Gdk
     return FALSE;
 }
 
-int tree_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data)
-{
-    struct dlgparam *dp = (struct dlgparam *)data;
-
-    if (event->keyval == GDK_Up || event->keyval == GDK_KP_Up ||
-        event->keyval == GDK_Down || event->keyval == GDK_KP_Down) {
-        int dir, i, j = -1;
-        for (i = 0; i < dp->ntreeitems; i++)
-            if (widget == dp->treeitems[i])
-		break;
-	if (i < dp->ntreeitems) {
-	    if (event->keyval == GDK_Up || event->keyval == GDK_KP_Up)
-		dir = -1;
-	    else
-		dir = +1;
-
-	    while (1) {
-		i += dir;
-		if (i < 0 || i >= dp->ntreeitems)
-		    break;	       /* nothing in that dir to select */
-		/*
-		 * Determine if this tree item is visible.
-		 */
-		{
-		    GtkWidget *w = dp->treeitems[i];
-		    int vis = TRUE;
-		    while (w && (GTK_IS_TREE_ITEM(w) || GTK_IS_TREE(w))) {
-			if (!GTK_WIDGET_VISIBLE(w)) {
-			    vis = FALSE;
-			    break;
-			}
-			w = w->parent;
-		    }
-		    if (vis) {
-			j = i;	       /* got one */
-			break;
-		    }
-		}
-	    }
-	}
-        gtk_signal_emit_stop_by_name(GTK_OBJECT(widget),
-                                     "key_press_event");
-        if (j >= 0) {
-            gtk_signal_emit_by_name(GTK_OBJECT(dp->treeitems[j]), "toggle");
-            gtk_widget_grab_focus(dp->treeitems[j]);
-        }
-        return TRUE;
-    }
-
-    /*
-     * It's nice for Left and Right to expand and collapse tree
-     * branches.
-     */
-    if (event->keyval == GDK_Left || event->keyval == GDK_KP_Left) {
-        gtk_signal_emit_stop_by_name(GTK_OBJECT(widget),
-                                     "key_press_event");
-	gtk_tree_item_collapse(GTK_TREE_ITEM(widget));
-	return TRUE;
-    }
-    if (event->keyval == GDK_Right || event->keyval == GDK_KP_Right) {
-        gtk_signal_emit_stop_by_name(GTK_OBJECT(widget),
-                                     "key_press_event");
-	gtk_tree_item_expand(GTK_TREE_ITEM(widget));
-	return TRUE;
-    }
-
-    return FALSE;
-}
-
 void shortcut_add(struct Shortcuts *scs, GtkWidget *labelw,
 		  int chr, int action, void *ptr)
 {
@@ -1952,13 +1893,16 @@ int do_config_box(const char *title, Con
     int index, level, listitemheight;
     struct controlbox *ctrlbox;
     char *path;
-    GtkTreeItem *treeitemlevels[8];
-    GtkTree *treelevels[8];
     struct dlgparam dp;
     struct sesslist sl;
     struct Shortcuts scs;
+    GtkTreeStore *store;
+    GtkTreeIter iter[8];
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+    GtkTreeSelection *select;
 
-    struct selparam *selparams = NULL;
+    struct selparam **selparams = NULL;
     int nselparams = 0, selparamsize = 0;
 
     dlg_init(&dp);
@@ -1993,12 +1937,19 @@ int do_config_box(const char *title, Con
     columns_force_left_align(COLUMNS(cols), label);
     gtk_widget_show(label);
     treescroll = gtk_scrolled_window_new(NULL, NULL);
-    tree = gtk_tree_new();
-    gtk_signal_connect(GTK_OBJECT(tree), "focus_in_event",
-                       GTK_SIGNAL_FUNC(widget_focus), &dp);
+
+    store = gtk_tree_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
+    tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
+    gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree), FALSE);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes("Category",
+                                                      renderer,
+                                                      "text", 0, 0);
+    gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
+
     shortcut_add(&scs, label, 'g', SHORTCUT_TREE, tree);
-    gtk_tree_set_view_mode(GTK_TREE(tree), GTK_TREE_VIEW_ITEM);
-    gtk_tree_set_selection_mode(GTK_TREE(tree), GTK_SELECTION_BROWSE);
+
     gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(treescroll),
 					  tree);
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(treescroll),
@@ -2028,7 +1979,6 @@ int do_config_box(const char *title, Con
 	    int j = path ? ctrl_path_compare(s->pathname, path) : 0;
 	    if (j != INT_MAX) {        /* add to treeview, start new panel */
 		char *c;
-		GtkWidget *treeitem;
 		int first;
 
 		/*
@@ -2049,31 +1999,14 @@ int do_config_box(const char *title, Con
 		else
 		    c++;
 
-		treeitem = gtk_tree_item_new_with_label(c);
 		assert(j-1 < level);
 		if (j > 0) {
-		    if (!treelevels[j-1]) {
-			treelevels[j-1] = GTK_TREE(gtk_tree_new());
-			gtk_tree_item_set_subtree
-			    (treeitemlevels[j-1],
-			     GTK_WIDGET(treelevels[j-1]));
-			gtk_tree_item_expand(treeitemlevels[j-1]);
-		    }
-		    gtk_tree_append(treelevels[j-1], treeitem);
+                    gtk_tree_store_append(store, &(iter[j]), &(iter[j-1]));
 		} else {
-		    gtk_tree_append(GTK_TREE(tree), treeitem);
+                    gtk_tree_store_append(store, &(iter[j]), 0);
 		}
-		treeitemlevels[j] = GTK_TREE_ITEM(treeitem);
-		treelevels[j] = NULL;
 		level = j+1;
 
-                gtk_signal_connect(GTK_OBJECT(treeitem), "key_press_event",
-                                   GTK_SIGNAL_FUNC(tree_key_press), &dp);
-                gtk_signal_connect(GTK_OBJECT(treeitem), "focus_in_event",
-                                   GTK_SIGNAL_FUNC(widget_focus), &dp);
-
-		gtk_widget_show(treeitem);
-
 		path = s->pathname;
 
 		first = (panelvbox == NULL);
@@ -2082,46 +2015,54 @@ int do_config_box(const char *title, Con
 		gtk_container_add(GTK_CONTAINER(panels), panelvbox);
 		if (first) {
 		    panels_switch_to(PANELS(panels), panelvbox);
-		    gtk_tree_select_child(GTK_TREE(tree), treeitem);
+		    /**
+                     * FIXME: Broken on Gtk2.
+                     * Actually, I don't think this is necessary, since
+                     * Gtk+ tree views always initially select the
+                     * first entry.
+                     * gtk_tree_select_child(GTK_TREE(tree), treeitem);
+                     */
 		}
 
 		if (nselparams >= selparamsize) {
+                    int i;
 		    selparamsize += 16;
 		    selparams = sresize(selparams, selparamsize,
-					struct selparam);
+					struct selparam *);
+                    for(i = 0; i < 16; i++) {
+                        selparams[nselparams + i] = snew(struct selparam);
+                    }
 		}
-		selparams[nselparams].dp = &dp;
-		selparams[nselparams].panels = PANELS(panels);
-		selparams[nselparams].panel = panelvbox;
-		selparams[nselparams].shortcuts = scs;   /* structure copy */
-		selparams[nselparams].treeitem = treeitem;
+		selparams[nselparams]->dp = &dp;
+		selparams[nselparams]->panels = PANELS(panels);
+		selparams[nselparams]->panel = panelvbox;
+		selparams[nselparams]->shortcuts = scs;   /* structure copy */
+                gtk_tree_store_set(store, &(iter[j]), 0, c,
+                                   1, selparams[nselparams], -1);
 		nselparams++;
 
 	    }
 
 	    w = layout_ctrls(&dp,
-			     &selparams[nselparams-1].shortcuts,
+			     &(selparams[nselparams-1]->shortcuts),
 			     s, listitemheight, NULL);
 	    gtk_box_pack_start(GTK_BOX(panelvbox), w, FALSE, FALSE, 0);
             gtk_widget_show(w);
 	}
     }
 
-    dp.ntreeitems = nselparams;
-    dp.treeitems = snewn(dp.ntreeitems, GtkWidget *);
+    /* Expand the full tree. */
+    gtk_tree_view_expand_all(GTK_TREE_VIEW(tree));
 
-    for (index = 0; index < nselparams; index++) {
-	gtk_signal_connect(GTK_OBJECT(selparams[index].treeitem), "select",
-			   GTK_SIGNAL_FUNC(treeitem_sel),
-			   &selparams[index]);
-        dp.treeitems[index] = selparams[index].treeitem;
-    }
+    select = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree));
+    gtk_tree_selection_set_mode(select, GTK_SELECTION_SINGLE);
+    g_signal_connect(G_OBJECT(select), "changed",
+                     G_CALLBACK(tree_sel), NULL);
 
     dp.data = cfg;
     dlg_refresh(NULL, &dp);
 
-    dp.shortcuts = &selparams[0].shortcuts;
-    dp.currtreeitem = dp.treeitems[0];
+    dp.shortcuts = &(selparams[0]->shortcuts);
     dp.lastfocus = NULL;
     dp.retval = 0;
     dp.window = window;
Index: unix/gtkpanel.c
===================================================================
RCS file: /home/cvs/putty/unix/gtkpanel.c,v
retrieving revision 1.4
diff -p -u -r1.4 gtkpanel.c
--- unix/gtkpanel.c	23 Apr 2003 13:48:09 -0000	1.4
+++ unix/gtkpanel.c	2 Jun 2004 05:07:45 -0000
@@ -8,7 +8,6 @@ static void panels_init(Panels *panels);
 static void panels_class_init(PanelsClass *klass);
 static void panels_map(GtkWidget *widget);
 static void panels_unmap(GtkWidget *widget);
-static void panels_draw(GtkWidget *widget, GdkRectangle *area);
 static gint panels_expose(GtkWidget *widget, GdkEventExpose *event);
 static void panels_base_add(GtkContainer *container, GtkWidget *widget);
 static void panels_remove(GtkContainer *container, GtkWidget *widget);
@@ -61,7 +60,6 @@ static void panels_class_init(PanelsClas
 
     widget_class->map = panels_map;
     widget_class->unmap = panels_unmap;
-    widget_class->draw = panels_draw;
     widget_class->expose_event = panels_expose;
     widget_class->size_request = panels_size_request;
     widget_class->size_allocate = panels_size_allocate;
@@ -126,29 +124,6 @@ static void panels_unmap(GtkWidget *widg
             gtk_widget_unmap(child);
     }
 }
-static void panels_draw(GtkWidget *widget, GdkRectangle *area)
-{
-    Panels *panels;
-    GtkWidget *child;
-    GList *children;
-    GdkRectangle child_area;
-
-    g_return_if_fail(widget != NULL);
-    g_return_if_fail(IS_PANELS(widget));
-
-    if (GTK_WIDGET_DRAWABLE(widget)) {
-        panels = PANELS(widget);
-
-        for (children = panels->children;
-             children && (child = children->data);
-             children = children->next) {
-            if (child &&
-		GTK_WIDGET_DRAWABLE(child) &&
-                gtk_widget_intersect(child, area, &child_area))
-                gtk_widget_draw(child, &child_area);
-        }
-    }
-}
 static gint panels_expose(GtkWidget *widget, GdkEventExpose *event)
 {
     Panels *panels;
@@ -167,12 +142,10 @@ static gint panels_expose(GtkWidget *wid
         for (children = panels->children;
              children && (child = children->data);
              children = children->next) {
-            if (child &&
-		GTK_WIDGET_DRAWABLE(child) &&
-                GTK_WIDGET_NO_WINDOW(child) &&
-                gtk_widget_intersect(child, &event->area,
-                                     &child_event.area))
-                gtk_widget_event(child, (GdkEvent *)&child_event);
+            if (child) {
+                gtk_container_propagate_expose(GTK_CONTAINER(widget),
+                                               child, event);
+            }
         }
     }
     return FALSE;
Index: unix/pterm.c
===================================================================
RCS file: /home/cvs/putty/unix/pterm.c,v
retrieving revision 1.140
diff -p -u -r1.140 pterm.c
--- unix/pterm.c	24 May 2004 11:30:15 -0000	1.140
+++ unix/pterm.c	2 Jun 2004 05:07:47 -0000
@@ -288,7 +288,7 @@ void set_zoomed(void *frontend, int zoom
      */
 #if GTK_CHECK_VERSION(2,0,0)
     struct gui_data *inst = (struct gui_data *)frontend;
-    if (iconic)
+    if (zoomed)
 	gtk_window_maximize(GTK_WINDOW(inst->window));
     else
 	gtk_window_unmaximize(GTK_WINDOW(inst->window));
@@ -1245,7 +1245,9 @@ void request_resize(void *frontend, int 
     gtk_drawing_area_size(GTK_DRAWING_AREA(inst->area), area_x, area_y);
 #endif
 
-    gtk_container_dequeue_resize_handler(GTK_CONTAINER(inst->window));
+    /* FIXME: Broken on Gtk2.
+     * gtk_container_dequeue_resize_handler(GTK_CONTAINER(inst->window));
+     */
 
 #if GTK_CHECK_VERSION(2,0,0)
     gtk_window_resize(GTK_WINDOW(inst->window),
