Windows QPA: Improve the event logging

Add more message codes and fix the whitespaces in the output:

 EVENT: hwd= 0x280484 WM_WINDOWPOSCHANGED msg=0x 47 et=0x 21e wp= 0 at -2208 -31887 handled= false
->
 EVENT: hwd=0x2204d6 WM_WINDOWPOSCHANGED msg=0x47 et=0x21e wp=0 at -3280,-19633 handled=false

Change-Id: I89a7b3bd328748ef39fe2dcd789497f43e9d4a2a
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Friedemann Kleint 2018-03-13 10:08:25 +01:00
parent 0e37558b6e
commit 910cc08f6b
2 changed files with 9 additions and 4 deletions

View File

@ -134,6 +134,7 @@ messageDebugEntries[] = {
{WM_XBUTTONUP, "WM_XBUTTONUP", true},
{WM_XBUTTONDBLCLK, "WM_XBUTTONDBLCLK", true},
{WM_MOUSEHWHEEL, "WM_MOUSEHWHEEL", true},
{WM_GETOBJECT, "WM_GETOBJECT", true},
{WM_IME_SETCONTEXT, "WM_IME_SETCONTEXT", true},
{WM_INPUTLANGCHANGE, "WM_INPUTLANGCHANGE", true},
{WM_IME_NOTIFY, "WM_IME_NOTIFY", true},
@ -162,6 +163,7 @@ messageDebugEntries[] = {
{WM_GETMINMAXINFO, "WM_GETMINMAXINFO", true},
{WM_WINDOWPOSCHANGING, "WM_WINDOWPOSCHANGING", true},
{WM_NCCREATE, "WM_NCCREATE", true},
{WM_NCDESTROY, "WM_NCDESTROY", true},
{WM_NCCALCSIZE, "WM_NCCALCSIZE", true},
{WM_NCACTIVATE, "WM_NCACTIVATE", true},
{WM_NCMOUSEMOVE, "WM_NCMOUSEMOVE", true},
@ -180,7 +182,9 @@ messageDebugEntries[] = {
{WM_CHANGECBCHAIN, "WM_CHANGECBCHAIN", true},
{WM_DISPLAYCHANGE, "WM_DISPLAYCHANGE", true},
{WM_DRAWCLIPBOARD, "WM_DRAWCLIPBOARD", true},
{WM_THEMECHANGED, "WM_THEMECHANGED", true}
{WM_THEMECHANGED, "WM_THEMECHANGED", true},
{0x90, "WM_UAHDESTROYWINDOW", true},
{0x272, "WM_UNREGISTER_WINDOW_SERVICES", true}
};
static inline const MessageDebugEntry *messageDebugEntry(UINT msg)

View File

@ -1364,9 +1364,10 @@ extern "C" LRESULT QT_WIN_CALLBACK qWindowsWndProc(HWND hwnd, UINT message, WPAR
const bool handled = QWindowsContext::instance()->windowsProc(hwnd, message, et, wParam, lParam, &result, &platformWindow);
if (QWindowsContext::verbose > 1 && lcQpaEvents().isDebugEnabled()) {
if (const char *eventName = QWindowsGuiEventDispatcher::windowsMessageName(message)) {
qCDebug(lcQpaEvents) << "EVENT: hwd=" << hwnd << eventName << hex << "msg=0x" << message
<< "et=0x" << et << dec << "wp=" << int(wParam) << "at"
<< GET_X_LPARAM(lParam) << GET_Y_LPARAM(lParam) << "handled=" << handled;
qCDebug(lcQpaEvents).nospace() << "EVENT: hwd=" << hwnd << ' ' << eventName
<< " msg=0x" << hex << message << " et=0x" << et << dec << " wp="
<< int(wParam) << " at " << GET_X_LPARAM(lParam) << ','
<< GET_Y_LPARAM(lParam) << " handled=" << handled;
}
}
if (!handled)