Moved ForceWindowRaise to the USER driver and removed the WND driver.

diff --git a/dlls/ttydrv/ttydrv.h b/dlls/ttydrv/ttydrv.h
index b79506a..1b77028 100644
--- a/dlls/ttydrv/ttydrv.h
+++ b/dlls/ttydrv/ttydrv.h
@@ -127,14 +127,4 @@
 extern int screen_cols;
 extern WINDOW *root_window;
 
-/* TTY windows driver */
-
-extern struct tagWND_DRIVER TTYDRV_WND_Driver;
-
-extern HANDLE TTYDRV_LoadOEMResource(WORD resid, WORD type);
-
-extern void TTYDRV_WND_ForceWindowRaise(struct tagWND *pWnd);
-extern void TTYDRV_WND_ScrollWindow(struct tagWND *wndPtr, HDC hdc, INT dx, INT dy, const RECT *clipRect, BOOL bUpdate);
-extern BOOL TTYDRV_WND_SetHostAttr(struct tagWND *wndPtr, INT haKey, INT value);
-
 #endif /* !defined(__WINE_TTYDRV_H) */
diff --git a/dlls/ttydrv/ttydrv_main.c b/dlls/ttydrv/ttydrv_main.c
index bdaa005..62733ec 100644
--- a/dlls/ttydrv/ttydrv_main.c
+++ b/dlls/ttydrv/ttydrv_main.c
@@ -29,8 +29,6 @@
  */
 static void process_attach(void)
 {
-    WND_Driver       = &TTYDRV_WND_Driver;
-
 #ifdef WINE_CURSES
     if ((root_window = initscr()))
     {
@@ -57,8 +55,6 @@
 #ifdef WINE_CURSES
     if (root_window) endwin();
 #endif  /* WINE_CURSES */
-
-    WND_Driver       = NULL;
 }
 
 
diff --git a/dlls/ttydrv/wnd.c b/dlls/ttydrv/wnd.c
index 09e7244..ab9b37b 100644
--- a/dlls/ttydrv/wnd.c
+++ b/dlls/ttydrv/wnd.c
@@ -15,11 +15,6 @@
 
 DEFAULT_DEBUG_CHANNEL(ttydrv);
 
-WND_DRIVER TTYDRV_WND_Driver =
-{
-  TTYDRV_WND_ForceWindowRaise
-};
-
 #define SWP_AGG_NOGEOMETRYCHANGE \
     (SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE)
 #define SWP_AGG_NOPOSCHANGE \
@@ -98,14 +93,6 @@
     return TRUE;
 }
 
-/***********************************************************************
- *		TTYDRV_WND_ForceWindowRaise
- */
-void TTYDRV_WND_ForceWindowRaise(WND *wndPtr)
-{
-  FIXME("(%p): stub\n", wndPtr);
-}
-
 
 /***********************************************************************
  *           DCE_OffsetVisRgn
diff --git a/dlls/user/user_main.c b/dlls/user/user_main.c
index 2bbef8a..66f8164 100644
--- a/dlls/user/user_main.c
+++ b/dlls/user/user_main.c
@@ -35,9 +35,7 @@
 
 static HMODULE graphics_driver;
 
-#define GET_USER_FUNC(name) \
-   if (!(USER_Driver.p##name = (void*)GetProcAddress( graphics_driver, #name ))) \
-      FIXME("%s not found in graphics driver\n", #name)
+#define GET_USER_FUNC(name) USER_Driver.p##name = (void*)GetProcAddress( graphics_driver, #name )
 
 /* load the graphics driver */
 static BOOL load_driver(void)
@@ -89,6 +87,7 @@
     GET_USER_FUNC(DestroyWindow);
     GET_USER_FUNC(GetDC);
     GET_USER_FUNC(EnableWindow);
+    GET_USER_FUNC(ForceWindowRaise);
     GET_USER_FUNC(MsgWaitForMultipleObjectsEx);
     GET_USER_FUNC(ScrollDC);
     GET_USER_FUNC(ScrollWindowEx);
diff --git a/dlls/x11drv/winpos.c b/dlls/x11drv/winpos.c
index 616bc57..4655232 100644
--- a/dlls/x11drv/winpos.c
+++ b/dlls/x11drv/winpos.c
@@ -1943,3 +1943,47 @@
 END:
     WIN_ReleaseWndPtr(wndPtr);
 }
+
+
+/***********************************************************************
+ *		X11DRV_ForceWindowRaise   (X11DRV.@)
+ *
+ * Raise a window on top of the X stacking order, while preserving 
+ * the correct Windows Z order.
+ *
+ * FIXME: this should go away.
+ */
+void X11DRV_ForceWindowRaise( HWND hwnd )
+{
+    XWindowChanges winChanges;
+    Display *display = thread_display();
+    WND *wndPrev, *wndPtr = WIN_FindWndPtr( hwnd );
+
+    if (!wndPtr) return;
+
+    if ((wndPtr->dwExStyle & WS_EX_MANAGED) ||
+        wndPtr->parent->hwndSelf != GetDesktopWindow() ||
+        IsRectEmpty( &wndPtr->rectWindow ) ||
+        !get_whole_window(wndPtr))
+    {
+        WIN_ReleaseWndPtr( wndPtr );
+        return;
+    }
+
+    /* Raise all windows up to wndPtr according to their Z order.
+     * (it would be easier with sibling-related Below but it doesn't
+     * work very well with SGI mwm for instance)
+     */
+    winChanges.stack_mode = Above;
+    while (wndPtr)
+    {
+        if (!IsRectEmpty( &wndPtr->rectWindow ) && get_whole_window(wndPtr))
+            TSXReconfigureWMWindow( display, get_whole_window(wndPtr), 0,
+                                    CWStackMode, &winChanges );
+        wndPrev = wndPtr->parent->child;
+        if (wndPrev == wndPtr) break;
+        while (wndPrev && (wndPrev->next != wndPtr)) wndPrev = wndPrev->next;
+        WIN_UpdateWndPtr( &wndPtr, wndPrev );
+    }
+    WIN_ReleaseWndPtr( wndPtr );
+}
diff --git a/dlls/x11drv/x11drv.spec b/dlls/x11drv/x11drv.spec
index 126cb51..5802448 100644
--- a/dlls/x11drv/x11drv.spec
+++ b/dlls/x11drv/x11drv.spec
@@ -32,6 +32,7 @@
 @ cdecl DestroyWindow(long) X11DRV_DestroyWindow
 @ cdecl GetDC(long long long long) X11DRV_GetDC
 @ cdecl EnableWindow(long long) X11DRV_EnableWindow
+@ cdecl ForceWindowRaise(long) X11DRV_ForceWindowRaise
 @ cdecl MsgWaitForMultipleObjectsEx(long ptr long long long) X11DRV_MsgWaitForMultipleObjectsEx
 @ cdecl ScrollDC(long long long ptr ptr long ptr) X11DRV_ScrollDC
 @ cdecl ScrollWindowEx(long long long ptr ptr long ptr long) X11DRV_ScrollWindowEx
diff --git a/dlls/x11drv/x11drv_main.c b/dlls/x11drv/x11drv_main.c
index cce1f6b..307a450 100644
--- a/dlls/x11drv/x11drv_main.c
+++ b/dlls/x11drv/x11drv_main.c
@@ -263,8 +263,6 @@
 {
     Display *display;
 
-    WND_Driver = &X11DRV_WND_Driver;
-
     get_server_startup();
     setup_options();
 
diff --git a/include/user.h b/include/user.h
index c832bbb..ae6fca3 100644
--- a/include/user.h
+++ b/include/user.h
@@ -74,6 +74,7 @@
     BOOL   (*pDestroyWindow)(HWND);
     BOOL   (*pGetDC)(HWND,HDC,HRGN,DWORD);
     BOOL   (*pEnableWindow)(HWND,BOOL);
+    void   (*pForceWindowRaise)(HWND);
     DWORD  (*pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD);
     BOOL   (*pScrollDC)(HDC,INT,INT,const RECT*,const RECT*,HRGN,LPRECT);
     INT    (*pScrollWindowEx)(HWND,INT,INT,const RECT*,const RECT*,HRGN,LPRECT,UINT);
diff --git a/include/win.h b/include/win.h
index 246b7e1..c5a2616 100644
--- a/include/win.h
+++ b/include/win.h
@@ -19,7 +19,6 @@
 struct tagCLASS;
 struct tagDCE;
 struct tagMESSAGEQUEUE;
-struct tagWND_DRIVER;
 
 typedef struct tagWND
 {
@@ -40,7 +39,7 @@
     void          *pProp;         /* Pointer to properties list */
     struct tagDCE *dce;           /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
     HGLOBAL16      hmemTaskQ;     /* Task queue global memory handle */
-    HRGN16         hrgnUpdate;    /* Update region */
+    HRGN           hrgnUpdate;    /* Update region */
     HRGN           hrgnWnd;       /* window's region */
     HWND           hwndLastActive;/* Last active popup hwnd */
     DWORD          dwStyle;       /* Window style (from CreateWindow) */
@@ -48,23 +47,15 @@
     DWORD          clsStyle;      /* Class style at window creation */
     UINT           wIDmenu;       /* ID or hmenu (from CreateWindow) */
     DWORD          helpContext;   /* Help context ID */
-    WORD           flags;         /* Misc. flags (see below) */
+    UINT           flags;         /* Misc. flags (see below) */
     HMENU16        hSysMenu;      /* window's copy of System Menu */
     int            cbWndExtra;    /* class cbWndExtra at window creation */
     int            irefCount;     /* window's reference count*/
     DWORD          userdata;      /* User private data */
-    struct tagWND_DRIVER *pDriver;  /* Window driver */
     void          *pDriverData;   /* Window driver data */
     DWORD          wExtra[1];     /* Window extra bytes */
 } WND;
 
-typedef struct tagWND_DRIVER
-{
-    void   (*pForceWindowRaise)(WND *);
-} WND_DRIVER;
-
-extern WND_DRIVER *WND_Driver;
-
 typedef struct
 {
     RECT16	   rectNormal;
diff --git a/include/x11drv.h b/include/x11drv.h
index 9884cd3..74150b9 100644
--- a/include/x11drv.h
+++ b/include/x11drv.h
@@ -386,10 +386,6 @@
 extern void X11DRV_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
                               WORD keyState, DWORD data, DWORD time, HWND hWnd );
 
-/* X11 windows driver */
-
-extern struct tagWND_DRIVER X11DRV_WND_Driver;
-
 /* x11drv private window data */
 struct x11drv_win_data
 {
@@ -420,8 +416,6 @@
     return data->whole_window;
 }
 
-extern void X11DRV_WND_ForceWindowRaise(struct tagWND *pWnd);
-
 extern void X11DRV_SetFocus( HWND hwnd );
 extern Cursor X11DRV_GetCursor( Display *display, struct tagCURSORICONINFO *ptr );
 
diff --git a/windows/win.c b/windows/win.c
index 0b89c78..ed9d7a7 100644
--- a/windows/win.c
+++ b/windows/win.c
@@ -29,8 +29,6 @@
 
 /**********************************************************************/
 
-WND_DRIVER *WND_Driver = NULL;
-
 /* Desktop window */
 static WND *pWndDesktop = NULL;
 
@@ -539,7 +537,6 @@
     if (!hwndDesktop) return FALSE;
     pWndDesktop = (WND *) USER_HEAP_LIN_ADDR( hwndDesktop );
 
-    pWndDesktop->pDriver = WND_Driver;
     pWndDesktop->next              = NULL;
     pWndDesktop->child             = NULL;
     pWndDesktop->parent            = NULL;
@@ -747,8 +744,6 @@
     }
     
 
-    wndPtr->pDriver = wndPtr->parent->pDriver;
-
     wndPtr->class          = classPtr;
     wndPtr->winproc        = winproc;
     wndPtr->dwMagic        = WND_MAGIC;
diff --git a/windows/winpos.c b/windows/winpos.c
index fa18833..cb576d7 100644
--- a/windows/winpos.c
+++ b/windows/winpos.c
@@ -1655,7 +1655,9 @@
     }
 
     if( !hwndPrevActive && wndPtr )
-        (*wndPtr->pDriver->pForceWindowRaise)(wndPtr);
+    {
+        if (USER_Driver.pForceWindowRaise) USER_Driver.pForceWindowRaise( wndPtr->hwndSelf );
+    }
 
     /* if active wnd is minimized redraw icon title */
     if( IsIconic(hwndActive) ) WINPOS_RedrawIconTitle(hwndActive);
diff --git a/windows/x11drv/Makefile.in b/windows/x11drv/Makefile.in
index e3b6a16..a9b9f3d 100644
--- a/windows/x11drv/Makefile.in
+++ b/windows/x11drv/Makefile.in
@@ -9,8 +9,7 @@
 	clipboard.c \
 	event.c \
 	keyboard.c \
-	mouse.c \
-	wnd.c
+	mouse.c
 
 PROGRAMS = wineclipsrv
 
diff --git a/windows/x11drv/wnd.c b/windows/x11drv/wnd.c
deleted file mode 100644
index 601219e..0000000
--- a/windows/x11drv/wnd.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * X11 windows driver
- *
- * Copyright 1993, 1994, 1995, 1996 Alexandre Julliard
- *                             1993 David Metcalfe
- *                       1995, 1996 Alex Korobka
- */
-
-#include "config.h"
-
-#include <X11/Xatom.h>
-
-#include "ts_xlib.h"
-#include "ts_xutil.h"
-#include "ts_shape.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "bitmap.h"
-#include "debugtools.h"
-#include "gdi.h"
-#include "options.h"
-#include "message.h"
-#include "win.h"
-#include "windef.h"
-#include "x11drv.h"
-#include "wingdi.h"
-#include "winnls.h"
-#include "wine/winuser16.h"
-
-DEFAULT_DEBUG_CHANNEL(win);
-
-extern Atom wmChangeState;
-
-#define HAS_DLGFRAME(style,exStyle) \
-((!((style) & WS_THICKFRAME)) && (((style) & WS_DLGFRAME) || ((exStyle) & WS_EX_DLGMODALFRAME)))
-
-/**********************************************************************/
-
-WND_DRIVER X11DRV_WND_Driver =
-{
-  X11DRV_WND_ForceWindowRaise
-};
-
-
-/***********************************************************************
- *		X11DRV_WND_IsZeroSizeWnd
- *
- * Return TRUE if the window has a height or widht less or equal to 0
- */
-static BOOL X11DRV_WND_IsZeroSizeWnd(WND *wndPtr)
-{
-    if ( (wndPtr->rectWindow.left >= wndPtr->rectWindow.right) ||
-         (wndPtr->rectWindow.top >= wndPtr->rectWindow.bottom) )
-        return TRUE;
-    else
-        return FALSE;
-}
-
-/***********************************************************************
- *		X11DRV_WND_ForceWindowRaise
- *
- * Raise a window on top of the X stacking order, while preserving 
- * the correct Windows Z order.
- */
-void X11DRV_WND_ForceWindowRaise(WND *wndPtr)
-{
-  XWindowChanges winChanges;
-  WND *wndPrev,*pDesktop = WIN_GetDesktop();
-
-  if (X11DRV_WND_IsZeroSizeWnd(wndPtr))
-  {
-    WIN_ReleaseDesktop();
-    return;
-  }
-  
-  if( !wndPtr || !get_whole_window(wndPtr) || (wndPtr->dwExStyle & WS_EX_MANAGED) )
-  {
-      WIN_ReleaseDesktop();
-    return;
-  }
-  
-  /* Raise all windows up to wndPtr according to their Z order.
-   * (it would be easier with sibling-related Below but it doesn't
-   * work very well with SGI mwm for instance)
-   */
-  winChanges.stack_mode = Above;
-  while (wndPtr)
-    {
-      if ( !X11DRV_WND_IsZeroSizeWnd(wndPtr) && get_whole_window(wndPtr) )
-         TSXReconfigureWMWindow( thread_display(), get_whole_window(wndPtr), 0,
-                                 CWStackMode, &winChanges );
-
-      wndPrev = pDesktop->child;
-      if (wndPrev == wndPtr) break;
-      while (wndPrev && (wndPrev->next != wndPtr)) wndPrev = wndPrev->next;
-
-      wndPtr = wndPrev;
-    }
-  WIN_ReleaseDesktop();
-}