Commit ee21c443 authored by Alexandre Julliard's avatar Alexandre Julliard

Replaced X11DRV_CritSection references by wine_tsx11_(un)lock.

parent 8efd4540
......@@ -112,7 +112,7 @@ static Pixmap BRUSH_DitherColor( DC *dc, COLORREF color )
unsigned int x, y;
Pixmap pixmap;
EnterCriticalSection( &X11DRV_CritSection );
wine_tsx11_lock();
if (color != prevColor)
{
int r = GetRValue( color ) * DITHER_LEVELS;
......@@ -138,7 +138,7 @@ static Pixmap BRUSH_DitherColor( DC *dc, COLORREF color )
MATRIX_SIZE, MATRIX_SIZE, X11DRV_GetDepth() );
XPutImage( display, pixmap, BITMAP_colorGC, ditherImage, 0, 0,
0, 0, MATRIX_SIZE, MATRIX_SIZE );
LeaveCriticalSection( &X11DRV_CritSection );
wine_tsx11_unlock();
return pixmap;
}
......
......@@ -11,11 +11,12 @@
#if defined(HAVE_OPENGL)
#include "ts_xlib.h"
#include "x11drv.h"
/* As GLX relies on X, this is needed */
#define ENTER_GL() EnterCriticalSection( &X11DRV_CritSection )
#define LEAVE_GL() LeaveCriticalSection( &X11DRV_CritSection )
#define ENTER_GL() wine_tsx11_lock()
#define LEAVE_GL() wine_tsx11_unlock()
#undef APIENTRY
#undef CALLBACK
......
......@@ -359,8 +359,7 @@ int X11DRV_CLIPBOARD_CacheDataFormats( Atom SelectionName )
TRACE("Requesting TARGETS selection for '%s' (owner=%08x)...\n",
TSXGetAtomName(display, selectionCacheSrc), (unsigned)ownerSelection );
EnterCriticalSection( &X11DRV_CritSection );
wine_tsx11_lock();
XConvertSelection(display, selectionCacheSrc, aTargets,
TSXInternAtom(display, "SELECTION_DATA", False),
w, CurrentTime);
......@@ -374,7 +373,7 @@ int X11DRV_CLIPBOARD_CacheDataFormats( Atom SelectionName )
if( xe.xselection.selection == selectionCacheSrc )
break;
}
LeaveCriticalSection( &X11DRV_CritSection );
wine_tsx11_unlock();
/* Verify that the selection returned a valid TARGETS property */
if ( (xe.xselection.target != aTargets)
......@@ -797,7 +796,7 @@ void X11DRV_ReleaseClipboard(void)
TRACE("\tgiving up selection (spw = %08x)\n",
(unsigned)selectionPrevWindow);
EnterCriticalSection(&X11DRV_CritSection);
wine_tsx11_lock();
TRACE("Releasing CLIPBOARD selection\n");
XSetSelectionOwner(display, xaClipboard, None, CurrentTime);
......@@ -815,8 +814,7 @@ void X11DRV_ReleaseClipboard(void)
while( !XCheckTypedWindowEvent( display, selectionPrevWindow,
SelectionClear, &xe ) );
}
LeaveCriticalSection(&X11DRV_CritSection);
wine_tsx11_unlock();
}
/* Get rid of any Pixmap resources we may still have */
......@@ -1028,8 +1026,7 @@ BOOL X11DRV_GetClipboardData(UINT wFormat)
TRACE("Requesting %s selection from %s...\n",
TSXGetAtomName(display, propRequest),
TSXGetAtomName(display, selectionCacheSrc) );
EnterCriticalSection( &X11DRV_CritSection );
wine_tsx11_lock();
XConvertSelection(display, selectionCacheSrc, propRequest,
TSXInternAtom(display, "SELECTION_DATA", False),
w, CurrentTime);
......@@ -1042,7 +1039,7 @@ BOOL X11DRV_GetClipboardData(UINT wFormat)
if( xe.xselection.selection == selectionCacheSrc )
break;
}
LeaveCriticalSection( &X11DRV_CritSection );
wine_tsx11_unlock();
/*
* Read the contents of the X selection property into WINE's
......
......@@ -191,16 +191,15 @@ static void CALLBACK EVENT_ProcessAllEvents( ULONG_PTR arg )
TRACE( "called (thread %lx).\n", GetCurrentThreadId() );
EnterCriticalSection( &X11DRV_CritSection );
wine_tsx11_lock();
while ( XPending( display ) )
{
XNextEvent( display, &event );
LeaveCriticalSection( &X11DRV_CritSection );
wine_tsx11_unlock();
EVENT_ProcessEvent( &event );
EnterCriticalSection( &X11DRV_CritSection );
wine_tsx11_lock();
}
LeaveCriticalSection( &X11DRV_CritSection );
wine_tsx11_unlock();
}
/***********************************************************************
......@@ -894,7 +893,7 @@ static void EVENT_GetGeometry( Window win, int *px, int *py,
Window root, top;
int x, y, width, height, border, depth;
EnterCriticalSection( &X11DRV_CritSection );
wine_tsx11_lock();
/* Get the geometry of the window */
XGetGeometry( display, win, &root, &x, &y, &width, &height,
......@@ -903,7 +902,7 @@ static void EVENT_GetGeometry( Window win, int *px, int *py,
/* Translate the window origin to root coordinates */
XTranslateCoordinates( display, win, root, 0, 0, &x, &y, &top );
LeaveCriticalSection( &X11DRV_CritSection );
wine_tsx11_unlock();
*px = x;
*py = y;
......
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