- added thread-safety protection to XListPixmapFormats

- moved pixmap / image format matching ERRs to WARNs
This commit is contained in:
Lionel Ulmer 2000-04-29 17:16:53 +00:00 committed by Alexandre Julliard
parent f1a2532129
commit 00d5d77ddc
4 changed files with 21 additions and 8 deletions

View File

@ -49,7 +49,7 @@ int _common_depth_to_pixelformat(
int index = -2; int index = -2;
vi = TSXGetVisualInfo(display, VisualNoMask, &vt, &nvisuals); vi = TSXGetVisualInfo(display, VisualNoMask, &vt, &nvisuals);
pf = XListPixmapFormats(display, &npixmap); pf = TSXListPixmapFormats(display, &npixmap);
for (i = 0; i < npixmap; i++) { for (i = 0; i < npixmap; i++) {
if (pf[i].depth == depth) { if (pf[i].depth == depth) {
@ -83,7 +83,7 @@ int _common_depth_to_pixelformat(
goto clean_up_and_exit; goto clean_up_and_exit;
} }
} }
ERR("No visual corresponding to pixmap format !\n"); WARN("No visual corresponding to pixmap format !\n");
} }
} }
@ -694,7 +694,7 @@ static HRESULT WINAPI Xlib_IDirectDraw2Impl_EnumDisplayModes(
maxHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor); maxHeight = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
vi = TSXGetVisualInfo(display, VisualNoMask, &vt, &nvisuals); vi = TSXGetVisualInfo(display, VisualNoMask, &vt, &nvisuals);
pf = XListPixmapFormats(display, &npixmap); pf = TSXListPixmapFormats(display, &npixmap);
i = 0; i = 0;
emu = 0; emu = 0;
@ -756,7 +756,7 @@ static HRESULT WINAPI Xlib_IDirectDraw2Impl_EnumDisplayModes(
} }
} }
if (j == nvisuals) if (j == nvisuals)
ERR("Did not find visual corresponding the the pixmap format !\n"); WARN("Did not find visual corresponding the the pixmap format !\n");
} }
} }
i++; i++;
@ -799,7 +799,7 @@ static HRESULT WINAPI Xlib_IDirectDraw2Impl_EnumDisplayModes(
} }
if (send_mode == 0) if (send_mode == 0)
ERR("No visual corresponding to pixmap format !\n"); WARN("No visual corresponding to pixmap format !\n");
} }
} }
} }

View File

@ -38,6 +38,7 @@ extern KeySym TSXLookupKeysym(XKeyEvent*, int);
extern KeySym * TSXGetKeyboardMapping(Display*, unsigned int, int, int*); extern KeySym * TSXGetKeyboardMapping(Display*, unsigned int, int, int*);
extern char * TSXResourceManagerString(Display*); extern char * TSXResourceManagerString(Display*);
extern int TSXInitThreads(void); extern int TSXInitThreads(void);
extern XPixmapFormatValues * TSXListPixmapFormats(Display*, int*);
extern int * TSXListDepths(Display*, int, int*); extern int * TSXListDepths(Display*, int, int*);
extern int TSXReconfigureWMWindow(Display*, Window, int, unsigned int, XWindowChanges*); extern int TSXReconfigureWMWindow(Display*, Window, int, unsigned int, XWindowChanges*);
extern int TSXSetWMProtocols(Display*, Window, Atom*, int); extern int TSXSetWMProtocols(Display*, Window, Atom*, int);

View File

@ -91,6 +91,7 @@ XKeysymToKeycode
XKeysymToString XKeysymToString
XListDepths XListDepths
XListFonts XListFonts
XListPixmapFormats
XLoadQueryFont XLoadQueryFont
XLookupKeysym XLookupKeysym
XLookupString XLookupString

View File

@ -277,6 +277,17 @@ int TSXInitThreads(void)
return r; return r;
} }
XPixmapFormatValues * TSXListPixmapFormats(Display* a0, int* a1)
{
XPixmapFormatValues * r;
TRACE("Call XListPixmapFormats\n");
EnterCriticalSection( &X11DRV_CritSection );
r = XListPixmapFormats(a0, a1);
LeaveCriticalSection( &X11DRV_CritSection );
TRACE("Ret XListPixmapFormats\n");
return r;
}
int * TSXListDepths(Display* a0, int a1, int* a2) int * TSXListDepths(Display* a0, int a1, int* a2)
{ {
int * r; int * r;