aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xorg-server/dix/main.c1
-rw-r--r--xorg-server/hw/xwin/InitInput.c7
-rw-r--r--xorg-server/hw/xwin/winwndproc.c2
-rw-r--r--xorg-server/include/input.h2
4 files changed, 11 insertions, 1 deletions
diff --git a/xorg-server/dix/main.c b/xorg-server/dix/main.c
index d607c8431..24aa7b6c0 100644
--- a/xorg-server/dix/main.c
+++ b/xorg-server/dix/main.c
@@ -331,6 +331,7 @@ int main(int argc, char *argv[], char *envp[])
memset(WindowTable, 0, sizeof(WindowTable));
CloseDownDevices();
+ InputDevicesClosed();
CloseDownEvents();
for (i = screenInfo.numScreens - 1; i >= 0; i--)
diff --git a/xorg-server/hw/xwin/InitInput.c b/xorg-server/hw/xwin/InitInput.c
index 1e9bcad7a..d9b6ec84c 100644
--- a/xorg-server/hw/xwin/InitInput.c
+++ b/xorg-server/hw/xwin/InitInput.c
@@ -67,6 +67,13 @@ extern winDispatchProcPtr winProcQueryTreeOrig;
#endif
+void InputDevicesClosed(void)
+{
+ g_pwinPointer=NULL;
+ g_pwinKeyboard=NULL;
+}
+
+
/* Called from dix/devices.c */
/*
* All of our keys generate up and down transition notifications,
diff --git a/xorg-server/hw/xwin/winwndproc.c b/xorg-server/hw/xwin/winwndproc.c
index c0cdba7a4..8decde864 100644
--- a/xorg-server/hw/xwin/winwndproc.c
+++ b/xorg-server/hw/xwin/winwndproc.c
@@ -722,7 +722,7 @@ winWindowProc (HWND hwnd, UINT message,
break;
/* Has the mouse pointer crossed screens? */
- if (s_pScreen != miPointerGetScreen(g_pwinPointer))
+ if (g_pwinPointer && s_pScreen != miPointerGetScreen(g_pwinPointer))
miPointerSetScreen (g_pwinPointer, s_pScreenInfo->dwScreen,
GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset,
GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset);
diff --git a/xorg-server/include/input.h b/xorg-server/include/input.h
index 7ab5e9d65..587e7deea 100644
--- a/xorg-server/include/input.h
+++ b/xorg-server/include/input.h
@@ -395,6 +395,8 @@ extern void ProcessKeyboardEvent(
InternalEvent* /*ev*/,
DeviceIntPtr /*keybd*/);
+extern void InputDevicesClosed(void);
+
extern Bool LegalModifier(
unsigned int /*key*/,
DeviceIntPtr /*pDev*/);