summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2012-01-13 13:30:53 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2012-01-15 13:55:46 +0000
commitd4e3df50cb54b78e820d0eec80c98e02843533c0 (patch)
treecc9d94cc6876359bb26bf146b176ab8c78a0ac4b
parente34038e67dd8e0290b84e78a350d5ec725699bb4 (diff)
Add some debugging
-rw-r--r--hw/xwin/winmultiwindowwindow.c29
-rw-r--r--hw/xwin/winmultiwindowwm.c91
2 files changed, 61 insertions, 59 deletions
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 14590109b..c785d2c97 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -131,18 +131,18 @@ winDestroyWindowMultiWindow (WindowPtr pWin)
winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winDestroyWindowMultiWindow - pWin: %p\n", pWin);
+ winTrace ("winDestroyWindowMultiWindow - pWin: %p\n", pWin);
#endif
-
- WIN_UNWRAP(DestroyWindow);
+
+ WIN_UNWRAP(DestroyWindow);
fResult = (*pScreen->DestroyWindow)(pWin);
WIN_WRAP(DestroyWindow, winDestroyWindowMultiWindow);
-
+
/* Flag that the window has been destroyed */
pWinPriv->fXKilled = TRUE;
-
+
/* Kill the MS Windows window associated with this window */
- winDestroyWindowsWindow (pWin);
+ winDestroyWindowsWindow (pWin);
return fResult;
}
@@ -178,21 +178,20 @@ winPositionWindowMultiWindow (WindowPtr pWin, int x, int y)
#if CYGMULTIWINDOW_DEBUG
winTrace ("winPositionWindowMultiWindow - pWin: %p\n", pWin);
#endif
-
+
WIN_UNWRAP(PositionWindow);
fResult = (*pScreen->PositionWindow)(pWin, x, y);
WIN_WRAP(PositionWindow, winPositionWindowMultiWindow);
-
+
#if CYGWINDOWING_DEBUG
- ErrorF ("winPositionWindowMultiWindow: (x, y) = (%d, %d)\n",
- x, y);
+ winTrace ("winPositionWindowMultiWindow: (x, y) = (%d, %d)\n", x, y);
#endif
/* Bail out if the Windows window handle is bad */
if (!hWnd)
{
#if CYGWINDOWING_DEBUG
- ErrorF ("\timmediately return since hWnd is NULL\n");
+ winTrace ("\timmediately return since hWnd is NULL\n");
#endif
return fResult;
}
@@ -234,11 +233,11 @@ winPositionWindowMultiWindow (WindowPtr pWin, int x, int y)
lpRc = &rcNew;
ErrorF ("winPositionWindowMultiWindow - (%d ms)rcNew (%d, %d)-(%d, %d)\n",
GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
-
+
lpRc = &rcOld;
ErrorF ("winPositionWindowMultiWindow - (%d ms)rcOld (%d, %d)-(%d, %d)\n",
GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
-
+
lpRc = &rcClient;
ErrorF ("(%d ms)rcClient (%d, %d)-(%d, %d)\n",
GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
@@ -911,9 +910,9 @@ winResizeWindowMultiWindow (WindowPtr pWin, int x, int y, unsigned int w,
winScreenPriv(pScreen);
#if CYGWINDOWING_DEBUG
- ErrorF ("ResizeWindowMultiWindow to (%d, %d) - %dx%d\n", x, y, w, h);
+ winTrace ("ResizeWindowMultiWindow to (%d, %d) - %dx%d\n", x, y, w, h);
#endif
- WIN_UNWRAP(ResizeWindow);
+ WIN_UNWRAP(ResizeWindow);
(*pScreen->ResizeWindow)(pWin, x, y, w, h, pSib);
WIN_WRAP(ResizeWindow, winResizeWindowMultiWindow);
}
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 1b9e5d27a..5146d566d 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -221,70 +221,77 @@ static HMODULE g_hmodOle32Dll = NULL;
static SHGETPROPERTYSTOREFORWINDOWPROC g_pSHGetPropertyStoreForWindow = NULL;
static PROPVARIANTCLEARPROC g_pPropVariantClear = NULL;
-/*
- * PushMessage - Push a message onto the queue
- */
-
-static void
-PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode)
+const char *
+msgTypeAsText(int msg)
{
+ const char *text = "";
- /* Lock the queue mutex */
- pthread_mutex_lock (&pQueue->pmMutex);
-
- pNode->pNext = NULL;
-
- if (pQueue->pTail != NULL)
- {
- pQueue->pTail->pNext = pNode;
- }
- pQueue->pTail = pNode;
-
- if (pQueue->pHead == NULL)
- {
- pQueue->pHead = pNode;
- }
-
-
-#if 0
- switch (pNode->msg.msg)
+ switch (msg)
{
case WM_WM_MOVE:
- ErrorF ("\tWM_WM_MOVE\n");
+ text = "WM_WM_MOVE";
break;
case WM_WM_SIZE:
- ErrorF ("\tWM_WM_SIZE\n");
+ text = "WM_WM_SIZE";
break;
case WM_WM_RAISE:
- ErrorF ("\tWM_WM_RAISE\n");
+ text = "WM_WM_RAISE";
break;
case WM_WM_LOWER:
- ErrorF ("\tWM_WM_LOWER\n");
+ text = "WM_WM_LOWER";
break;
case WM_WM_MAP:
- ErrorF ("\tWM_WM_MAP\n");
+ text = "WM_WM_MAP";
break;
case WM_WM_MAP2:
- ErrorF ("\tWM_WM_MAP2\n");
+ text = "WM_WM_MAP2";
break;
case WM_WM_MAP3:
- ErrorF ("\tWM_WM_MAP3\n");
+ text = "WM_WM_MAP3";
break;
case WM_WM_UNMAP:
- ErrorF ("\tWM_WM_UNMAP\n");
+ text = "WM_WM_UNMAP";
break;
case WM_WM_KILL:
- ErrorF ("\tWM_WM_KILL\n");
+ text = "WM_WM_KILL";
break;
case WM_WM_ACTIVATE:
- ErrorF ("\tWM_WM_ACTIVATE\n");
+ text = "WM_WM_ACTIVATE";
break;
default:
- ErrorF ("\tUnknown Message.\n");
- break;
+ text = "Unknown Message";
}
+
+ return text;
+}
+
+/*
+ * PushMessage - Push a message onto the queue
+ */
+
+static void
+PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode)
+{
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF("PushMessage() %s\n", msgTypeAsText(pNode->msg.msg));
#endif
+ /* Lock the queue mutex */
+ pthread_mutex_lock (&pQueue->pmMutex);
+
+ pNode->pNext = NULL;
+
+ if (pQueue->pTail != NULL)
+ {
+ pQueue->pTail->pNext = pNode;
+ }
+ pQueue->pTail = pNode;
+
+ if (pQueue->pHead == NULL)
+ {
+ pQueue->pHead = pNode;
+ }
+
/* Increase the count of elements in the queue by one */
++(pQueue->nQueueSize);
@@ -349,9 +356,9 @@ PopMessage (WMMsgQueuePtr pQueue, WMInfoPtr pWMInfo)
--(pQueue->nQueueSize);
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("Queue Size %d %d\n", pQueue->nQueueSize, QueueSize(pQueue));
+ winTrace("Queue Size %d %d\n", pQueue->nQueueSize, QueueSize(pQueue));
#endif
-
+
/* Release the queue mutex */
pthread_mutex_unlock (&pQueue->pmMutex);
@@ -1375,11 +1382,7 @@ void
winSendMessageToWM (void *pWMInfo, winWMMessagePtr pMsg)
{
WMMsgNodePtr pNode;
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winSendMessageToWM ()\n");
-#endif
-
+
pNode = (WMMsgNodePtr)malloc(sizeof(WMMsgNodeRec));
if (pNode != NULL)
{