XQuartz: Added thread debugging to xprFrame.c

(cherry picked from commit 41542502b3)
This commit is contained in:
Jeremy Huddleston 2008-04-28 12:36:54 -07:00
parent 8349732a67
commit 07382a70c7

View File

@ -43,6 +43,8 @@
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include "windowstr.h" #include "windowstr.h"
#include "threadSafety.h"
#include <pthread.h> #include <pthread.h>
#define DEFINE_ATOM_HELPER(func,atom_name) \ #define DEFINE_ATOM_HELPER(func,atom_name) \
@ -69,7 +71,8 @@ static inline xp_error
xprConfigureWindow(xp_window_id id, unsigned int mask, xprConfigureWindow(xp_window_id id, unsigned int mask,
const xp_window_changes *values) const xp_window_changes *values)
{ {
// ErrorF("xprConfigureWindow()\n"); TA_SERVER();
if (!no_configure_window) if (!no_configure_window)
return xp_configure_window(id, mask, values); return xp_configure_window(id, mask, values);
else else
@ -84,6 +87,8 @@ xprSetNativeProperty(RootlessWindowPtr pFrame)
unsigned int native_id; unsigned int native_id;
long data; long data;
TA_SERVER();
err = xp_get_native_window((xp_window_id) pFrame->wid, &native_id); err = xp_get_native_window((xp_window_id) pFrame->wid, &native_id);
if (err == Success) if (err == Success)
{ {
@ -108,6 +113,8 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
unsigned int mask = 0; unsigned int mask = 0;
xp_error err; xp_error err;
TA_SERVER();
wc.x = newX; wc.x = newX;
wc.y = newY; wc.y = newY;
wc.width = pFrame->width; wc.width = pFrame->width;
@ -169,6 +176,8 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
void void
xprDestroyFrame(RootlessFrameID wid) xprDestroyFrame(RootlessFrameID wid)
{ {
TA_SERVER();
pthread_mutex_lock(&window_hash_mutex); pthread_mutex_lock(&window_hash_mutex);
x_hash_table_remove(window_hash, wid); x_hash_table_remove(window_hash, wid);
pthread_mutex_unlock(&window_hash_mutex); pthread_mutex_unlock(&window_hash_mutex);
@ -183,6 +192,8 @@ xprDestroyFrame(RootlessFrameID wid)
void void
xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY) xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
{ {
TA_SERVER();
xp_window_changes wc; xp_window_changes wc;
wc.x = newX; wc.x = newX;
@ -202,6 +213,8 @@ xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
{ {
xp_window_changes wc; xp_window_changes wc;
TA_SERVER();
wc.x = newX; wc.x = newX;
wc.y = newY; wc.y = newY;
wc.width = newW; wc.width = newW;
@ -223,7 +236,9 @@ xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
{ {
xp_window_changes wc; xp_window_changes wc;
/* Stack frame below nextWid it if it exists, or raise TA_SERVER();
/* Stack frame below nextWid it if it exists, or raise
frame above everything otherwise. */ frame above everything otherwise. */
if (nextWid == NULL) if (nextWid == NULL)
@ -249,6 +264,8 @@ xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
{ {
xp_window_changes wc; xp_window_changes wc;
TA_SERVER();
if (pShape != NULL) if (pShape != NULL)
{ {
wc.shape_nrects = REGION_NUM_RECTS(pShape); wc.shape_nrects = REGION_NUM_RECTS(pShape);
@ -274,6 +291,8 @@ xprUnmapFrame(RootlessFrameID wid)
{ {
xp_window_changes wc; xp_window_changes wc;
TA_SERVER();
wc.stack_mode = XP_UNMAPPED; wc.stack_mode = XP_UNMAPPED;
wc.sibling = 0; wc.sibling = 0;
@ -292,6 +311,8 @@ xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
unsigned int rowbytes[2]; unsigned int rowbytes[2];
xp_error err; xp_error err;
TA_SERVER();
err = xp_lock_window((xp_window_id) wid, NULL, NULL, data, rowbytes, NULL); err = xp_lock_window((xp_window_id) wid, NULL, NULL, data, rowbytes, NULL);
if (err != Success) if (err != Success)
FatalError("Could not lock window %i for drawing.", (int) wid); FatalError("Could not lock window %i for drawing.", (int) wid);
@ -307,6 +328,8 @@ xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
void void
xprStopDrawing(RootlessFrameID wid, Bool flush) xprStopDrawing(RootlessFrameID wid, Bool flush)
{ {
TA_SERVER();
xp_unlock_window((xp_window_id) wid, flush); xp_unlock_window((xp_window_id) wid, flush);
} }
@ -317,6 +340,8 @@ xprStopDrawing(RootlessFrameID wid, Bool flush)
void void
xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage) xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage)
{ {
TA_SERVER();
xp_flush_window((xp_window_id) wid); xp_flush_window((xp_window_id) wid);
} }
@ -328,6 +353,8 @@ void
xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects, xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects,
int shift_x, int shift_y) int shift_x, int shift_y)
{ {
TA_SERVER();
xp_mark_window((xp_window_id) wid, nrects, rects, shift_x, shift_y); xp_mark_window((xp_window_id) wid, nrects, rects, shift_x, shift_y);
} }
@ -341,6 +368,8 @@ xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin)
{ {
DeleteProperty(serverClient, oldWin, xa_native_window_id()); DeleteProperty(serverClient, oldWin, xa_native_window_id());
TA_SERVER();
xprSetNativeProperty(pFrame); xprSetNativeProperty(pFrame);
} }
@ -352,6 +381,8 @@ Bool xprDoReorderWindow(RootlessWindowPtr pFrame)
{ {
WindowPtr pWin = pFrame->win; WindowPtr pWin = pFrame->win;
TA_SERVER();
return AppleWMDoReorderWindow(pWin); return AppleWMDoReorderWindow(pWin);
} }
@ -364,6 +395,8 @@ void
xprCopyWindow(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects, xprCopyWindow(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects,
int dx, int dy) int dx, int dy)
{ {
TA_SERVER();
xp_copy_window((xp_window_id) wid, (xp_window_id) wid, xp_copy_window((xp_window_id) wid, (xp_window_id) wid,
dstNrects, dstRects, dx, dy); dstNrects, dstRects, dx, dy);
} }
@ -398,6 +431,8 @@ xprInit(ScreenPtr pScreen)
{ {
RootlessInit(pScreen, &xprRootlessProcs); RootlessInit(pScreen, &xprRootlessProcs);
TA_SERVER();
rootless_CopyBytes_threshold = xp_copy_bytes_threshold; rootless_CopyBytes_threshold = xp_copy_bytes_threshold;
rootless_FillBytes_threshold = xp_fill_bytes_threshold; rootless_FillBytes_threshold = xp_fill_bytes_threshold;
rootless_CompositePixels_threshold = xp_composite_area_threshold; rootless_CompositePixels_threshold = xp_composite_area_threshold;
@ -418,6 +453,8 @@ xprGetXWindow(xp_window_id wid)
{ {
RootlessWindowRec *winRec; RootlessWindowRec *winRec;
TA_SERVER();
if (window_hash == NULL) if (window_hash == NULL)
return NULL; return NULL;
@ -437,6 +474,8 @@ xprGetXWindowFromAppKit(int windowNumber)
Bool ret; Bool ret;
xp_window_id wid; xp_window_id wid;
TA_SERVER();
if (window_hash == NULL) if (window_hash == NULL)
return FALSE; return FALSE;
@ -468,6 +507,8 @@ xprIsX11Window(void *nsWindow, int windowNumber)
Bool ret; Bool ret;
xp_window_id wid; xp_window_id wid;
TA_SERVER();
if (window_hash == NULL) if (window_hash == NULL)
return FALSE; return FALSE;
@ -498,6 +539,8 @@ xprHideWindows(Bool hide)
int screen; int screen;
WindowPtr pRoot, pWin; WindowPtr pRoot, pWin;
TA_SERVER();
for (screen = 0; screen < screenInfo.numScreens; screen++) { for (screen = 0; screen < screenInfo.numScreens; screen++) {
pRoot = WindowTable[screenInfo.screens[screen]->myNum]; pRoot = WindowTable[screenInfo.screens[screen]->myNum];
RootlessFrameID prevWid = NULL; RootlessFrameID prevWid = NULL;