Commit 46fb7e00 authored by Josh DuBois's avatar Josh DuBois Committed by Alexandre Julliard

Make some noise in a few cases where the X11drv doesn't load, but used

to fail silently.
parent ec33cd69
...@@ -369,7 +369,12 @@ static void process_attach(void) ...@@ -369,7 +369,12 @@ static void process_attach(void)
} }
/* initialize GDI */ /* initialize GDI */
X11DRV_GDI_Initialize(); if(!X11DRV_GDI_Initialize())
{
MESSAGE( "%s: X11DRV Couldn't Initialize GDI.\n", argv0 );
ExitProcess(1);
}
/* save keyboard setup */ /* save keyboard setup */
TSXGetKeyboardControl(display, &keyboard_state); TSXGetKeyboardControl(display, &keyboard_state);
...@@ -425,15 +430,13 @@ static void process_detach(void) ...@@ -425,15 +430,13 @@ static void process_detach(void)
*/ */
BOOL WINAPI X11DRV_Init( HINSTANCE hinst, DWORD reason, LPVOID reserved ) BOOL WINAPI X11DRV_Init( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{ {
static int process_count;
switch(reason) switch(reason)
{ {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
if (!process_count++) process_attach(); process_attach();
break; break;
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
if (!--process_count) process_detach(); process_detach();
break; break;
} }
return TRUE; return TRUE;
......
...@@ -336,7 +336,7 @@ extern BOOL X11DRV_GetClipboardData(UINT wFormat); ...@@ -336,7 +336,7 @@ extern BOOL X11DRV_GetClipboardData(UINT wFormat);
extern WORD X11DRV_EVENT_XStateToKeyState( int state ) ; extern WORD X11DRV_EVENT_XStateToKeyState( int state ) ;
extern BOOL X11DRV_EVENT_Init(void); extern void X11DRV_EVENT_Init(void);
extern void X11DRV_Synchronize( void ); extern void X11DRV_Synchronize( void );
typedef enum { typedef enum {
......
...@@ -151,8 +151,10 @@ static BOOL in_transition = FALSE; /* This is not used as for today */ ...@@ -151,8 +151,10 @@ static BOOL in_transition = FALSE; /* This is not used as for today */
/*********************************************************************** /***********************************************************************
* EVENT_Init * EVENT_Init
*/ */
BOOL X11DRV_EVENT_Init(void) void X11DRV_EVENT_Init(void)
{ {
HANDLE service;
#ifdef HAVE_LIBXXSHM #ifdef HAVE_LIBXXSHM
ShmAvailable = XShmQueryExtension( display ); ShmAvailable = XShmQueryExtension( display );
if (ShmAvailable) { if (ShmAvailable) {
...@@ -161,17 +163,18 @@ BOOL X11DRV_EVENT_Init(void) ...@@ -161,17 +163,18 @@ BOOL X11DRV_EVENT_Init(void)
#endif #endif
/* Install the X event processing callback */ /* Install the X event processing callback */
SERVICE_AddObject( FILE_DupUnixHandle( ConnectionNumber(display), if (SERVICE_AddObject( FILE_DupUnixHandle( ConnectionNumber(display), GENERIC_READ|SYNCHRONIZE ),
GENERIC_READ | SYNCHRONIZE ), EVENT_ProcessAllEvents, 0 ) == INVALID_HANDLE_VALUE)
EVENT_ProcessAllEvents, 0 ); {
ERR("cannot add service object\n");
ExitProcess(1);
}
/* Install the XFlush timer callback */ /* Install the XFlush timer callback */
if ( Options.synchronous ) if ( Options.synchronous )
TSXSynchronize( display, True ); TSXSynchronize( display, True );
else else
SERVICE_AddTimer( 200, EVENT_Flush, 0 ); SERVICE_AddTimer( 200, EVENT_Flush, 0 );
return TRUE;
} }
/*********************************************************************** /***********************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment