diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 1c6af7a..79f1987 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -239,6 +239,8 @@ static gboolean gtk_window_map_event      (GtkWidget         *widget,
                                            GdkEventAny       *event);
 static gint gtk_window_configure_event    (GtkWidget         *widget,
 					   GdkEventConfigure *event);
+static gint gtk_window_state_event        (GtkWidget           *widget,
+					   GdkEventWindowState *event);
 static gint gtk_window_key_press_event    (GtkWidget         *widget,
 					   GdkEventKey       *event);
 static gint gtk_window_key_release_event  (GtkWidget         *widget,
@@ -490,6 +492,7 @@ gtk_window_class_init (GtkWindowClass *klass)
   widget_class->size_request = gtk_window_size_request;
   widget_class->size_allocate = gtk_window_size_allocate;
   widget_class->configure_event = gtk_window_configure_event;
+  widget_class->window_state_event = gtk_window_state_event;
   widget_class->key_press_event = gtk_window_key_press_event;
   widget_class->key_release_event = gtk_window_key_release_event;
   widget_class->enter_notify_event = gtk_window_enter_notify_event;
@@ -1520,6 +1523,29 @@ update_window_buttons (GtkWindow *window)
 }
 
 static void
+update_max_button (GtkWindow *window,
+                   gboolean   maximized)
+{
+  GtkWindowPrivate *priv = GTK_WINDOW_GET_PRIVATE (window);
+  GtkWidget *button;
+  GtkWidget *image;
+
+  button = GTK_BIN (priv->max_button);
+  image = gtk_bin_get_child (GTK_BIN (button));
+
+  if (maximized)
+    {
+      gtk_image_set_from_stock (GTK_IMAGE (image), GTK_STOCK_ZOOM_100, GTK_ICON_SIZE_MENU);
+      gtk_widget_set_tooltip_text (button, _("Restore Window"));
+    }
+  else
+    {
+      gtk_image_set_from_stock (GTK_IMAGE (image), GTK_STOCK_ZOOM_IN, GTK_ICON_SIZE_MENU);
+      gtk_widget_set_tooltip_text (button, _("Maximize Window"));
+    }
+}
+
+static void
 ensure_title_box (GtkWindow *window)
 {
   GtkWindowPrivate *priv = GTK_WINDOW_GET_PRIVATE (window);
@@ -5575,6 +5607,21 @@ gtk_window_configure_event (GtkWidget         *widget,
   return TRUE;
 }
 
+static gboolean
+gtk_window_state_event (GtkWidget           *widget,
+                        GdkEventWindowState *event)
+{
+  GtkWindow *window = GTK_WINDOW (widget);
+
+  if (is_client_side_decorated (window))
+    {
+      if (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED)
+        update_max_button (window, event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED);
+    }
+
+  return FALSE;
+}
+
 /* the accel_key and accel_mods fields of the key have to be setup
  * upon calling this function. it'll then return whether that key
  * is at all used as accelerator, and if so will OR in the
