File emacs-22.0.99-x11r7.patch of Package emacs

--- src/xrdb.c
+++ src/xrdb.c	2007-05-15 18:01:41.439517668 +0200
@@ -54,6 +54,9 @@ Boston, MA 02110-1301, USA.  */
 #include <X11/X.h>
 #include <X11/Xutil.h>
 #include <X11/Xresource.h>
+#ifdef USE_X_TOOLKIT
+#include <X11/Intrinsic.h>
+#endif
 #ifdef HAVE_PWD_H
 #include <pwd.h>
 #endif
@@ -609,6 +612,15 @@ x_load_resources (display, xrm_string, m
   XrmPutLineResource (&rdb, line);
 
 #endif /* not USE_MOTIF */
+#ifdef USE_X_TOOLKIT
+  if ((db = XtScreenDatabase(DefaultScreenOfDisplay (display))))
+    {
+      XrmCombineDatabase (rdb, &db, FALSE);
+      rdb = db;
+    }
+  else
+    {
+#endif /* not USE_X_TOOLKIT */
 
   user_database = get_user_db (display);
 
@@ -651,6 +663,10 @@ x_load_resources (display, xrm_string, m
 	XrmMergeDatabases (db, &rdb);
     }
 
+#ifdef USE_X_TOOLKIT
+    } /* (db != XtScreenDatabase()) */
+#endif /* not USE_X_TOOLKIT */
+
   return rdb;
 }