Index: gdk/gdkwindow.h
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/gdkwindow.h,v
retrieving revision 1.56
diff -u -p -r1.56 gdkwindow.h
--- gdk/gdkwindow.h	26 Sep 2005 20:27:44 -0000	1.56
+++ gdk/gdkwindow.h	7 Nov 2005 13:23:34 -0000
@@ -436,8 +436,10 @@ void	      gdk_window_set_hints	 (GdkWin
 					  gint		   max_height,
 					  gint		   flags);
 #endif
-void          gdk_window_set_type_hint    (GdkWindow       *window,
-					   GdkWindowTypeHint hint);
+void              gdk_window_set_type_hint (GdkWindow        *window,
+                                            GdkWindowTypeHint hint);
+GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow        *window);
+
 void          gdk_window_set_modal_hint   (GdkWindow       *window,
                                            gboolean         modal);
 
Index: gdk/x11/gdkwindow-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkwindow-x11.c,v
retrieving revision 1.252
diff -u -p -r1.252 gdkwindow-x11.c
--- gdk/x11/gdkwindow-x11.c	26 Sep 2005 20:27:44 -0000	1.252
+++ gdk/x11/gdkwindow-x11.c	7 Nov 2005 13:23:35 -0000
@@ -2273,6 +2273,65 @@ gdk_window_set_type_hint (GdkWindow     
 		   (guchar *)&atom, 1);
 }
 
+/**
+ * gdk_window_get_type_hint:
+ * @window: A toplevel #GdkWindow
+ *
+ * This function returns the type hint set for a window.
+ *
+ * Return value: The type hint set for @window
+ **/
+GdkWindowTypeHint
+gdk_window_get_type_hint (GdkWindow *window)
+{
+  GdkDisplay *display;
+  GdkWindowTypeHint type;
+  Atom type_return;
+  gint format_return;
+  gulong nitems_return;
+  gulong bytes_after_return;
+  guchar *data = NULL;
+
+  g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_WINDOW_TYPE_HINT_NORMAL);
+
+  if (GDK_WINDOW_DESTROYED (window))
+    return GDK_WINDOW_TYPE_HINT_NORMAL;
+
+  type = GDK_WINDOW_TYPE_HINT_NORMAL;
+
+  display = gdk_drawable_get_display (window);
+
+  XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
+                      gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE"),
+                      0, G_MAXLONG, False, XA_ATOM, &type_return,
+                      &format_return, &nitems_return, &bytes_after_return, &data);
+
+  if ((type_return == XA_ATOM) && (format_return == 32) &&
+      (data) && (nitems_return == 1))
+    {
+      Atom atom = (Atom) *data;
+
+      if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DIALOG"))
+        type = GDK_WINDOW_TYPE_HINT_DIALOG;
+      else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_MENU"))
+        type = GDK_WINDOW_TYPE_HINT_MENU;
+      else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLBAR"))
+        type = GDK_WINDOW_TYPE_HINT_TOOLBAR;
+      else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_UTILITY"))
+        type = GDK_WINDOW_TYPE_HINT_UTILITY;
+      else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_SPLASH"))
+        type = GDK_WINDOW_TYPE_HINT_SPLASHSCREEN;
+      else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DOCK"))
+        type = GDK_WINDOW_TYPE_HINT_DOCK;
+      else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DESKTOP"))
+        type = GDK_WINDOW_TYPE_HINT_DESKTOP;
+    }
+
+  if (type_return != None)
+    XFree (data);
+
+  return type;
+}
 
 static void
 gdk_wmspec_change_state (gboolean   add,
