? gdk/gdk.def
? gdk/printbtnstate.snip
? gdk/win32/rc/foo.c
Index: gdk/win32/gdkinput-win32.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/win32/gdkinput-win32.c,v
retrieving revision 1.50
diff -u -p -r1.50 gdkinput-win32.c
--- gdk/win32/gdkinput-win32.c	25 Sep 2004 20:24:04 -0000	1.50
+++ gdk/win32/gdkinput-win32.c	31 Jan 2005 19:12:21 -0000
@@ -71,9 +71,9 @@ static GdkInputWindow *gdk_input_window_
 
 static GdkDevicePrivate *gdk_input_find_dev_from_ctx (HCTX hctx,
 						      UINT id);
-static GList     *wintab_contexts;
+static GList     *wintab_contexts = NULL;
 
-static GdkWindow *wintab_window;
+static GdkWindow *wintab_window = NULL;
 
 #endif /* HAVE_WINTAB */
 
@@ -204,9 +204,10 @@ print_lc(LOGCONTEXT *lc)
 
 #endif
 
-static void
-gdk_input_wintab_init (void)
+void
+_gdk_input_wintab_init_check (void)
 {
+  static gboolean wintab_initialized = FALSE;
   GdkDevicePrivate *gdkdev;
   GdkWindowAttr wa;
   WORD specversion;
@@ -219,7 +220,11 @@ gdk_input_wintab_init (void)
   int devix, cursorix;
   char devname[100], csrname[100];
 
-  _gdk_input_devices = NULL;
+  if (wintab_initialized)
+    return;
+  
+  wintab_initialized = TRUE;
+  
   wintab_contexts = NULL;
 
   if (!_gdk_input_ignore_wintab &&
@@ -1276,7 +1281,12 @@ _gdk_input_init (GdkDisplay *display)
 
   _gdk_init_input_core (display);
 #ifdef HAVE_WINTAB
-  gdk_input_wintab_init ();
+#ifdef WINTAB_NO_LAZY_INIT
+  /* Normally, Wintab is only initialized when the application performs
+   * an action that requires it, such as enabling extended input events
+   * for a window or enumerating the devices */
+  _gdk_input_wintab_init_check ();
+#endif /* WINTAB_NO_LAZY_INIT */
 #endif /* HAVE_WINTAB */
 
   _gdk_input_devices = g_list_append (_gdk_input_devices, display->core_pointer);
Index: gdk/win32/gdkinput-win32.h
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/win32/gdkinput-win32.h,v
retrieving revision 1.10
diff -u -p -r1.10 gdkinput-win32.h
--- gdk/win32/gdkinput-win32.h	7 Aug 2003 22:17:18 -0000	1.10
+++ gdk/win32/gdkinput-win32.h	31 Jan 2005 19:12:21 -0000
@@ -166,4 +166,8 @@ gboolean         _gdk_device_get_history
 					      GdkTimeCoord    ***events,
 					      gint              *n_events);
 
+#ifdef HAVE_WINTAB
+void		_gdk_input_wintab_init_check (void);
+#endif /* HAVE_WINTAB */
+
 #endif /* __GDK_INPUT_WIN32_H__ */
Index: gdk/win32/gdkinput.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/win32/gdkinput.c,v
retrieving revision 1.24
diff -u -p -r1.24 gdkinput.c
--- gdk/win32/gdkinput.c	6 Mar 2004 03:37:11 -0000	1.24
+++ gdk/win32/gdkinput.c	31 Jan 2005 19:12:21 -0000
@@ -119,12 +119,18 @@ gdk_device_get_type (void)
 GList *
 gdk_devices_list (void)
 {
+#ifdef HAVE_WINTAB
+  _gdk_input_wintab_init_check ();
+#endif /* HAVE_WINTAB */
   return _gdk_input_devices;
 }
 
 GList *
 gdk_display_list_devices (GdkDisplay *dpy)
 {
+#ifdef HAVE_WINTAB
+  _gdk_input_wintab_init_check ();
+#endif /* HAVE_WINTAB */
   return _gdk_input_devices;
 }
 
@@ -270,6 +276,9 @@ gdk_input_set_extension_events (GdkWindo
 
   if (mask != 0)
     {
+#ifdef HAVE_WINTAB
+      _gdk_input_wintab_init_check ();
+#endif /* HAVE_WINTAB */
       iw = g_new(GdkInputWindow,1);
 
       iw->window = window;
