Index: gdk/win32/gdkevents-win32.c
===================================================================
--- gdk/win32/gdkevents-win32.c	(revision 20387)
+++ gdk/win32/gdkevents-win32.c	(working copy)
@@ -1775,11 +1775,9 @@
 doesnt_want_key (gint mask,
 		 MSG *msg)
 {
-  GdkWindow *modal_current = _gdk_modal_current ();
   GdkWindow *window = (GdkWindow *) gdk_win32_handle_table_lookup ((GdkNativeWindow)msg->hwnd);
-  gboolean modally_blocked = modal_current != NULL ? gdk_window_get_toplevel (window) != modal_current : FALSE;
 
-  if (modally_blocked == TRUE)
+  if (is_modally_blocked (window) == TRUE)
     return TRUE;
 
   return (((msg->message == WM_KEYUP || msg->message == WM_SYSKEYUP) &&
@@ -3628,6 +3626,18 @@
 is_modally_blocked (GdkWindow *window)
 {
   GdkWindow *modal_current = _gdk_modal_current ();
+  GdkWindowImplWin32 *impl;
+
+  if (modal_current != NULL)
+    {
+      // Total hack to get TreeView's search working.
+      impl = GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) modal_current)->impl);
+      if (impl->hint_flags & GDK_WINDOW_TYPE_HINT_UTILITY)
+	{
+	  return FALSE;
+	}
+    }
+
   return modal_current != NULL ? gdk_window_get_toplevel (window) != modal_current : FALSE;
 }
 
