Bug 1751281 - Enable Windows Event logging with separate logging module and message parameters r=cmartin

Differential Revision: https://phabricator.services.mozilla.com/D141728
This commit is contained in:
Max Vollmer 2022-03-25 15:27:39 +00:00
Родитель c6f02ebaa8
Коммит d4159632e0
7 изменённых файлов: 385 добавлений и 370 удалений

Просмотреть файл

@ -212,14 +212,12 @@ static void DumpNeuteredMessage(HWND hwnd, UINT uMsg) {
nsAutoCString log("Received \"nonqueued\" ");
// classify messages
if (uMsg < WM_USER) {
int idx = 0;
while (mozilla::widget::gAllEvents[idx].mId != uMsg &&
mozilla::widget::gAllEvents[idx].mStr != nullptr) {
idx++;
}
if (mozilla::widget::gAllEvents[idx].mStr) {
log.AppendPrintf("ui message \"%s\"",
mozilla::widget::gAllEvents[idx].mStr);
const auto eventMsgInfo = mozilla::widget::gAllEvents.find(uMsg);
const char* msgText = eventMsgInfo != mozilla::widget::gAllEvents.end()
? eventMsgInfo->second.mStr
: nullptr;
if (msgText) {
log.AppendPrintf("ui message \"%s\"", msgText);
} else {
log.AppendPrintf("ui message (0x%X)", uMsg);
}

Просмотреть файл

@ -72,342 +72,345 @@ using namespace mozilla::gfx;
namespace mozilla {
namespace widget {
#define ENTRY(_msg) \
{ #_msg, _msg }
EventMsgInfo gAllEvents[] = {ENTRY(WM_NULL),
ENTRY(WM_CREATE),
ENTRY(WM_DESTROY),
ENTRY(WM_MOVE),
ENTRY(WM_SIZE),
ENTRY(WM_ACTIVATE),
ENTRY(WM_SETFOCUS),
ENTRY(WM_KILLFOCUS),
ENTRY(WM_ENABLE),
ENTRY(WM_SETREDRAW),
ENTRY(WM_SETTEXT),
ENTRY(WM_GETTEXT),
ENTRY(WM_GETTEXTLENGTH),
ENTRY(WM_PAINT),
ENTRY(WM_CLOSE),
ENTRY(WM_QUERYENDSESSION),
ENTRY(WM_QUIT),
ENTRY(WM_QUERYOPEN),
ENTRY(WM_ERASEBKGND),
ENTRY(WM_SYSCOLORCHANGE),
ENTRY(WM_ENDSESSION),
ENTRY(WM_SHOWWINDOW),
ENTRY(WM_SETTINGCHANGE),
ENTRY(WM_DEVMODECHANGE),
ENTRY(WM_ACTIVATEAPP),
ENTRY(WM_FONTCHANGE),
ENTRY(WM_TIMECHANGE),
ENTRY(WM_CANCELMODE),
ENTRY(WM_SETCURSOR),
ENTRY(WM_MOUSEACTIVATE),
ENTRY(WM_CHILDACTIVATE),
ENTRY(WM_QUEUESYNC),
ENTRY(WM_GETMINMAXINFO),
ENTRY(WM_PAINTICON),
ENTRY(WM_ICONERASEBKGND),
ENTRY(WM_NEXTDLGCTL),
ENTRY(WM_SPOOLERSTATUS),
ENTRY(WM_DRAWITEM),
ENTRY(WM_MEASUREITEM),
ENTRY(WM_DELETEITEM),
ENTRY(WM_VKEYTOITEM),
ENTRY(WM_CHARTOITEM),
ENTRY(WM_SETFONT),
ENTRY(WM_GETFONT),
ENTRY(WM_SETHOTKEY),
ENTRY(WM_GETHOTKEY),
ENTRY(WM_QUERYDRAGICON),
ENTRY(WM_COMPAREITEM),
ENTRY(WM_GETOBJECT),
ENTRY(WM_COMPACTING),
ENTRY(WM_COMMNOTIFY),
ENTRY(WM_WINDOWPOSCHANGING),
ENTRY(WM_WINDOWPOSCHANGED),
ENTRY(WM_POWER),
ENTRY(WM_COPYDATA),
ENTRY(WM_CANCELJOURNAL),
ENTRY(WM_NOTIFY),
ENTRY(WM_INPUTLANGCHANGEREQUEST),
ENTRY(WM_INPUTLANGCHANGE),
ENTRY(WM_TCARD),
ENTRY(WM_HELP),
ENTRY(WM_USERCHANGED),
ENTRY(WM_NOTIFYFORMAT),
ENTRY(WM_CONTEXTMENU),
ENTRY(WM_STYLECHANGING),
ENTRY(WM_STYLECHANGED),
ENTRY(WM_DISPLAYCHANGE),
ENTRY(WM_GETICON),
ENTRY(WM_SETICON),
ENTRY(WM_NCCREATE),
ENTRY(WM_NCDESTROY),
ENTRY(WM_NCCALCSIZE),
ENTRY(WM_NCHITTEST),
ENTRY(WM_NCPAINT),
ENTRY(WM_NCACTIVATE),
ENTRY(WM_GETDLGCODE),
ENTRY(WM_SYNCPAINT),
ENTRY(WM_NCMOUSEMOVE),
ENTRY(WM_NCLBUTTONDOWN),
ENTRY(WM_NCLBUTTONUP),
ENTRY(WM_NCLBUTTONDBLCLK),
ENTRY(WM_NCRBUTTONDOWN),
ENTRY(WM_NCRBUTTONUP),
ENTRY(WM_NCRBUTTONDBLCLK),
ENTRY(WM_NCMBUTTONDOWN),
ENTRY(WM_NCMBUTTONUP),
ENTRY(WM_NCMBUTTONDBLCLK),
ENTRY(EM_GETSEL),
ENTRY(EM_SETSEL),
ENTRY(EM_GETRECT),
ENTRY(EM_SETRECT),
ENTRY(EM_SETRECTNP),
ENTRY(EM_SCROLL),
ENTRY(EM_LINESCROLL),
ENTRY(EM_SCROLLCARET),
ENTRY(EM_GETMODIFY),
ENTRY(EM_SETMODIFY),
ENTRY(EM_GETLINECOUNT),
ENTRY(EM_LINEINDEX),
ENTRY(EM_SETHANDLE),
ENTRY(EM_GETHANDLE),
ENTRY(EM_GETTHUMB),
ENTRY(EM_LINELENGTH),
ENTRY(EM_REPLACESEL),
ENTRY(EM_GETLINE),
ENTRY(EM_LIMITTEXT),
ENTRY(EM_CANUNDO),
ENTRY(EM_UNDO),
ENTRY(EM_FMTLINES),
ENTRY(EM_LINEFROMCHAR),
ENTRY(EM_SETTABSTOPS),
ENTRY(EM_SETPASSWORDCHAR),
ENTRY(EM_EMPTYUNDOBUFFER),
ENTRY(EM_GETFIRSTVISIBLELINE),
ENTRY(EM_SETREADONLY),
ENTRY(EM_SETWORDBREAKPROC),
ENTRY(EM_GETWORDBREAKPROC),
ENTRY(EM_GETPASSWORDCHAR),
ENTRY(EM_SETMARGINS),
ENTRY(EM_GETMARGINS),
ENTRY(EM_GETLIMITTEXT),
ENTRY(EM_POSFROMCHAR),
ENTRY(EM_CHARFROMPOS),
ENTRY(EM_SETIMESTATUS),
ENTRY(EM_GETIMESTATUS),
ENTRY(SBM_SETPOS),
ENTRY(SBM_GETPOS),
ENTRY(SBM_SETRANGE),
ENTRY(SBM_SETRANGEREDRAW),
ENTRY(SBM_GETRANGE),
ENTRY(SBM_ENABLE_ARROWS),
ENTRY(SBM_SETSCROLLINFO),
ENTRY(SBM_GETSCROLLINFO),
ENTRY(WM_KEYDOWN),
ENTRY(WM_KEYUP),
ENTRY(WM_CHAR),
ENTRY(WM_DEADCHAR),
ENTRY(WM_SYSKEYDOWN),
ENTRY(WM_SYSKEYUP),
ENTRY(WM_SYSCHAR),
ENTRY(WM_SYSDEADCHAR),
ENTRY(WM_KEYLAST),
ENTRY(WM_IME_STARTCOMPOSITION),
ENTRY(WM_IME_ENDCOMPOSITION),
ENTRY(WM_IME_COMPOSITION),
ENTRY(WM_INITDIALOG),
ENTRY(WM_COMMAND),
ENTRY(WM_SYSCOMMAND),
ENTRY(WM_TIMER),
ENTRY(WM_HSCROLL),
ENTRY(WM_VSCROLL),
ENTRY(WM_INITMENU),
ENTRY(WM_INITMENUPOPUP),
ENTRY(WM_MENUSELECT),
ENTRY(WM_MENUCHAR),
ENTRY(WM_ENTERIDLE),
ENTRY(WM_MENURBUTTONUP),
ENTRY(WM_MENUDRAG),
ENTRY(WM_MENUGETOBJECT),
ENTRY(WM_UNINITMENUPOPUP),
ENTRY(WM_MENUCOMMAND),
ENTRY(WM_CHANGEUISTATE),
ENTRY(WM_UPDATEUISTATE),
ENTRY(WM_CTLCOLORMSGBOX),
ENTRY(WM_CTLCOLOREDIT),
ENTRY(WM_CTLCOLORLISTBOX),
ENTRY(WM_CTLCOLORBTN),
ENTRY(WM_CTLCOLORDLG),
ENTRY(WM_CTLCOLORSCROLLBAR),
ENTRY(WM_CTLCOLORSTATIC),
ENTRY(CB_GETEDITSEL),
ENTRY(CB_LIMITTEXT),
ENTRY(CB_SETEDITSEL),
ENTRY(CB_ADDSTRING),
ENTRY(CB_DELETESTRING),
ENTRY(CB_DIR),
ENTRY(CB_GETCOUNT),
ENTRY(CB_GETCURSEL),
ENTRY(CB_GETLBTEXT),
ENTRY(CB_GETLBTEXTLEN),
ENTRY(CB_INSERTSTRING),
ENTRY(CB_RESETCONTENT),
ENTRY(CB_FINDSTRING),
ENTRY(CB_SELECTSTRING),
ENTRY(CB_SETCURSEL),
ENTRY(CB_SHOWDROPDOWN),
ENTRY(CB_GETITEMDATA),
ENTRY(CB_SETITEMDATA),
ENTRY(CB_GETDROPPEDCONTROLRECT),
ENTRY(CB_SETITEMHEIGHT),
ENTRY(CB_GETITEMHEIGHT),
ENTRY(CB_SETEXTENDEDUI),
ENTRY(CB_GETEXTENDEDUI),
ENTRY(CB_GETDROPPEDSTATE),
ENTRY(CB_FINDSTRINGEXACT),
ENTRY(CB_SETLOCALE),
ENTRY(CB_GETLOCALE),
ENTRY(CB_GETTOPINDEX),
ENTRY(CB_SETTOPINDEX),
ENTRY(CB_GETHORIZONTALEXTENT),
ENTRY(CB_SETHORIZONTALEXTENT),
ENTRY(CB_GETDROPPEDWIDTH),
ENTRY(CB_SETDROPPEDWIDTH),
ENTRY(CB_INITSTORAGE),
ENTRY(CB_MSGMAX),
ENTRY(LB_ADDSTRING),
ENTRY(LB_INSERTSTRING),
ENTRY(LB_DELETESTRING),
ENTRY(LB_SELITEMRANGEEX),
ENTRY(LB_RESETCONTENT),
ENTRY(LB_SETSEL),
ENTRY(LB_SETCURSEL),
ENTRY(LB_GETSEL),
ENTRY(LB_GETCURSEL),
ENTRY(LB_GETTEXT),
ENTRY(LB_GETTEXTLEN),
ENTRY(LB_GETCOUNT),
ENTRY(LB_SELECTSTRING),
ENTRY(LB_DIR),
ENTRY(LB_GETTOPINDEX),
ENTRY(LB_FINDSTRING),
ENTRY(LB_GETSELCOUNT),
ENTRY(LB_GETSELITEMS),
ENTRY(LB_SETTABSTOPS),
ENTRY(LB_GETHORIZONTALEXTENT),
ENTRY(LB_SETHORIZONTALEXTENT),
ENTRY(LB_SETCOLUMNWIDTH),
ENTRY(LB_ADDFILE),
ENTRY(LB_SETTOPINDEX),
ENTRY(LB_GETITEMRECT),
ENTRY(LB_GETITEMDATA),
ENTRY(LB_SETITEMDATA),
ENTRY(LB_SELITEMRANGE),
ENTRY(LB_SETANCHORINDEX),
ENTRY(LB_GETANCHORINDEX),
ENTRY(LB_SETCARETINDEX),
ENTRY(LB_GETCARETINDEX),
ENTRY(LB_SETITEMHEIGHT),
ENTRY(LB_GETITEMHEIGHT),
ENTRY(LB_FINDSTRINGEXACT),
ENTRY(LB_SETLOCALE),
ENTRY(LB_GETLOCALE),
ENTRY(LB_SETCOUNT),
ENTRY(LB_INITSTORAGE),
ENTRY(LB_ITEMFROMPOINT),
ENTRY(LB_MSGMAX),
ENTRY(WM_MOUSEMOVE),
ENTRY(WM_LBUTTONDOWN),
ENTRY(WM_LBUTTONUP),
ENTRY(WM_LBUTTONDBLCLK),
ENTRY(WM_RBUTTONDOWN),
ENTRY(WM_RBUTTONUP),
ENTRY(WM_RBUTTONDBLCLK),
ENTRY(WM_MBUTTONDOWN),
ENTRY(WM_MBUTTONUP),
ENTRY(WM_MBUTTONDBLCLK),
ENTRY(WM_MOUSEWHEEL),
ENTRY(WM_MOUSEHWHEEL),
ENTRY(WM_PARENTNOTIFY),
ENTRY(WM_ENTERMENULOOP),
ENTRY(WM_EXITMENULOOP),
ENTRY(WM_NEXTMENU),
ENTRY(WM_SIZING),
ENTRY(WM_CAPTURECHANGED),
ENTRY(WM_MOVING),
ENTRY(WM_POWERBROADCAST),
ENTRY(WM_DEVICECHANGE),
ENTRY(WM_MDICREATE),
ENTRY(WM_MDIDESTROY),
ENTRY(WM_MDIACTIVATE),
ENTRY(WM_MDIRESTORE),
ENTRY(WM_MDINEXT),
ENTRY(WM_MDIMAXIMIZE),
ENTRY(WM_MDITILE),
ENTRY(WM_MDICASCADE),
ENTRY(WM_MDIICONARRANGE),
ENTRY(WM_MDIGETACTIVE),
ENTRY(WM_MDISETMENU),
ENTRY(WM_ENTERSIZEMOVE),
ENTRY(WM_EXITSIZEMOVE),
ENTRY(WM_DROPFILES),
ENTRY(WM_MDIREFRESHMENU),
ENTRY(WM_IME_SETCONTEXT),
ENTRY(WM_IME_NOTIFY),
ENTRY(WM_IME_CONTROL),
ENTRY(WM_IME_COMPOSITIONFULL),
ENTRY(WM_IME_SELECT),
ENTRY(WM_IME_CHAR),
ENTRY(WM_IME_REQUEST),
ENTRY(WM_IME_KEYDOWN),
ENTRY(WM_IME_KEYUP),
ENTRY(WM_NCMOUSEHOVER),
ENTRY(WM_MOUSEHOVER),
ENTRY(WM_MOUSELEAVE),
ENTRY(WM_CUT),
ENTRY(WM_COPY),
ENTRY(WM_PASTE),
ENTRY(WM_CLEAR),
ENTRY(WM_UNDO),
ENTRY(WM_RENDERFORMAT),
ENTRY(WM_RENDERALLFORMATS),
ENTRY(WM_DESTROYCLIPBOARD),
ENTRY(WM_DRAWCLIPBOARD),
ENTRY(WM_PAINTCLIPBOARD),
ENTRY(WM_VSCROLLCLIPBOARD),
ENTRY(WM_SIZECLIPBOARD),
ENTRY(WM_ASKCBFORMATNAME),
ENTRY(WM_CHANGECBCHAIN),
ENTRY(WM_HSCROLLCLIPBOARD),
ENTRY(WM_QUERYNEWPALETTE),
ENTRY(WM_PALETTEISCHANGING),
ENTRY(WM_PALETTECHANGED),
ENTRY(WM_HOTKEY),
ENTRY(WM_PRINT),
ENTRY(WM_PRINTCLIENT),
ENTRY(WM_THEMECHANGED),
ENTRY(WM_HANDHELDFIRST),
ENTRY(WM_HANDHELDLAST),
ENTRY(WM_AFXFIRST),
ENTRY(WM_AFXLAST),
ENTRY(WM_PENWINFIRST),
ENTRY(WM_PENWINLAST),
ENTRY(WM_APP),
ENTRY(WM_DWMCOMPOSITIONCHANGED),
ENTRY(WM_DWMNCRENDERINGCHANGED),
ENTRY(WM_DWMCOLORIZATIONCOLORCHANGED),
ENTRY(WM_DWMWINDOWMAXIMIZEDCHANGE),
ENTRY(WM_DWMSENDICONICTHUMBNAIL),
ENTRY(WM_DWMSENDICONICLIVEPREVIEWBITMAP),
ENTRY(WM_TABLET_QUERYSYSTEMGESTURESTATUS),
ENTRY(WM_GESTURE),
ENTRY(WM_GESTURENOTIFY),
ENTRY(WM_GETTITLEBARINFOEX),
{nullptr, 0x0}};
#define ENTRY(_msg) \
{ \
_msg, { #_msg, _msg } \
}
std::unordered_map<UINT, EventMsgInfo> gAllEvents = {
ENTRY(WM_NULL),
ENTRY(WM_CREATE),
ENTRY(WM_DESTROY),
ENTRY(WM_MOVE),
ENTRY(WM_SIZE),
ENTRY(WM_ACTIVATE),
ENTRY(WM_SETFOCUS),
ENTRY(WM_KILLFOCUS),
ENTRY(WM_ENABLE),
ENTRY(WM_SETREDRAW),
ENTRY(WM_SETTEXT),
ENTRY(WM_GETTEXT),
ENTRY(WM_GETTEXTLENGTH),
ENTRY(WM_PAINT),
ENTRY(WM_CLOSE),
ENTRY(WM_QUERYENDSESSION),
ENTRY(WM_QUIT),
ENTRY(WM_QUERYOPEN),
ENTRY(WM_ERASEBKGND),
ENTRY(WM_SYSCOLORCHANGE),
ENTRY(WM_ENDSESSION),
ENTRY(WM_SHOWWINDOW),
ENTRY(WM_SETTINGCHANGE),
ENTRY(WM_DEVMODECHANGE),
ENTRY(WM_ACTIVATEAPP),
ENTRY(WM_FONTCHANGE),
ENTRY(WM_TIMECHANGE),
ENTRY(WM_CANCELMODE),
ENTRY(WM_SETCURSOR),
ENTRY(WM_MOUSEACTIVATE),
ENTRY(WM_CHILDACTIVATE),
ENTRY(WM_QUEUESYNC),
ENTRY(WM_GETMINMAXINFO),
ENTRY(WM_PAINTICON),
ENTRY(WM_ICONERASEBKGND),
ENTRY(WM_NEXTDLGCTL),
ENTRY(WM_SPOOLERSTATUS),
ENTRY(WM_DRAWITEM),
ENTRY(WM_MEASUREITEM),
ENTRY(WM_DELETEITEM),
ENTRY(WM_VKEYTOITEM),
ENTRY(WM_CHARTOITEM),
ENTRY(WM_SETFONT),
ENTRY(WM_GETFONT),
ENTRY(WM_SETHOTKEY),
ENTRY(WM_GETHOTKEY),
ENTRY(WM_QUERYDRAGICON),
ENTRY(WM_COMPAREITEM),
ENTRY(WM_GETOBJECT),
ENTRY(WM_COMPACTING),
ENTRY(WM_COMMNOTIFY),
ENTRY(WM_WINDOWPOSCHANGING),
ENTRY(WM_WINDOWPOSCHANGED),
ENTRY(WM_POWER),
ENTRY(WM_COPYDATA),
ENTRY(WM_CANCELJOURNAL),
ENTRY(WM_NOTIFY),
ENTRY(WM_INPUTLANGCHANGEREQUEST),
ENTRY(WM_INPUTLANGCHANGE),
ENTRY(WM_TCARD),
ENTRY(WM_HELP),
ENTRY(WM_USERCHANGED),
ENTRY(WM_NOTIFYFORMAT),
ENTRY(WM_CONTEXTMENU),
ENTRY(WM_STYLECHANGING),
ENTRY(WM_STYLECHANGED),
ENTRY(WM_DISPLAYCHANGE),
ENTRY(WM_GETICON),
ENTRY(WM_SETICON),
ENTRY(WM_NCCREATE),
ENTRY(WM_NCDESTROY),
ENTRY(WM_NCCALCSIZE),
ENTRY(WM_NCHITTEST),
ENTRY(WM_NCPAINT),
ENTRY(WM_NCACTIVATE),
ENTRY(WM_GETDLGCODE),
ENTRY(WM_SYNCPAINT),
ENTRY(WM_NCMOUSEMOVE),
ENTRY(WM_NCLBUTTONDOWN),
ENTRY(WM_NCLBUTTONUP),
ENTRY(WM_NCLBUTTONDBLCLK),
ENTRY(WM_NCRBUTTONDOWN),
ENTRY(WM_NCRBUTTONUP),
ENTRY(WM_NCRBUTTONDBLCLK),
ENTRY(WM_NCMBUTTONDOWN),
ENTRY(WM_NCMBUTTONUP),
ENTRY(WM_NCMBUTTONDBLCLK),
ENTRY(EM_GETSEL),
ENTRY(EM_SETSEL),
ENTRY(EM_GETRECT),
ENTRY(EM_SETRECT),
ENTRY(EM_SETRECTNP),
ENTRY(EM_SCROLL),
ENTRY(EM_LINESCROLL),
ENTRY(EM_SCROLLCARET),
ENTRY(EM_GETMODIFY),
ENTRY(EM_SETMODIFY),
ENTRY(EM_GETLINECOUNT),
ENTRY(EM_LINEINDEX),
ENTRY(EM_SETHANDLE),
ENTRY(EM_GETHANDLE),
ENTRY(EM_GETTHUMB),
ENTRY(EM_LINELENGTH),
ENTRY(EM_REPLACESEL),
ENTRY(EM_GETLINE),
ENTRY(EM_LIMITTEXT),
ENTRY(EM_CANUNDO),
ENTRY(EM_UNDO),
ENTRY(EM_FMTLINES),
ENTRY(EM_LINEFROMCHAR),
ENTRY(EM_SETTABSTOPS),
ENTRY(EM_SETPASSWORDCHAR),
ENTRY(EM_EMPTYUNDOBUFFER),
ENTRY(EM_GETFIRSTVISIBLELINE),
ENTRY(EM_SETREADONLY),
ENTRY(EM_SETWORDBREAKPROC),
ENTRY(EM_GETWORDBREAKPROC),
ENTRY(EM_GETPASSWORDCHAR),
ENTRY(EM_SETMARGINS),
ENTRY(EM_GETMARGINS),
ENTRY(EM_GETLIMITTEXT),
ENTRY(EM_POSFROMCHAR),
ENTRY(EM_CHARFROMPOS),
ENTRY(EM_SETIMESTATUS),
ENTRY(EM_GETIMESTATUS),
ENTRY(SBM_SETPOS),
ENTRY(SBM_GETPOS),
ENTRY(SBM_SETRANGE),
ENTRY(SBM_SETRANGEREDRAW),
ENTRY(SBM_GETRANGE),
ENTRY(SBM_ENABLE_ARROWS),
ENTRY(SBM_SETSCROLLINFO),
ENTRY(SBM_GETSCROLLINFO),
ENTRY(WM_KEYDOWN),
ENTRY(WM_KEYUP),
ENTRY(WM_CHAR),
ENTRY(WM_DEADCHAR),
ENTRY(WM_SYSKEYDOWN),
ENTRY(WM_SYSKEYUP),
ENTRY(WM_SYSCHAR),
ENTRY(WM_SYSDEADCHAR),
ENTRY(WM_KEYLAST),
ENTRY(WM_IME_STARTCOMPOSITION),
ENTRY(WM_IME_ENDCOMPOSITION),
ENTRY(WM_IME_COMPOSITION),
ENTRY(WM_INITDIALOG),
ENTRY(WM_COMMAND),
ENTRY(WM_SYSCOMMAND),
ENTRY(WM_TIMER),
ENTRY(WM_HSCROLL),
ENTRY(WM_VSCROLL),
ENTRY(WM_INITMENU),
ENTRY(WM_INITMENUPOPUP),
ENTRY(WM_MENUSELECT),
ENTRY(WM_MENUCHAR),
ENTRY(WM_ENTERIDLE),
ENTRY(WM_MENURBUTTONUP),
ENTRY(WM_MENUDRAG),
ENTRY(WM_MENUGETOBJECT),
ENTRY(WM_UNINITMENUPOPUP),
ENTRY(WM_MENUCOMMAND),
ENTRY(WM_CHANGEUISTATE),
ENTRY(WM_UPDATEUISTATE),
ENTRY(WM_CTLCOLORMSGBOX),
ENTRY(WM_CTLCOLOREDIT),
ENTRY(WM_CTLCOLORLISTBOX),
ENTRY(WM_CTLCOLORBTN),
ENTRY(WM_CTLCOLORDLG),
ENTRY(WM_CTLCOLORSCROLLBAR),
ENTRY(WM_CTLCOLORSTATIC),
ENTRY(CB_GETEDITSEL),
ENTRY(CB_LIMITTEXT),
ENTRY(CB_SETEDITSEL),
ENTRY(CB_ADDSTRING),
ENTRY(CB_DELETESTRING),
ENTRY(CB_DIR),
ENTRY(CB_GETCOUNT),
ENTRY(CB_GETCURSEL),
ENTRY(CB_GETLBTEXT),
ENTRY(CB_GETLBTEXTLEN),
ENTRY(CB_INSERTSTRING),
ENTRY(CB_RESETCONTENT),
ENTRY(CB_FINDSTRING),
ENTRY(CB_SELECTSTRING),
ENTRY(CB_SETCURSEL),
ENTRY(CB_SHOWDROPDOWN),
ENTRY(CB_GETITEMDATA),
ENTRY(CB_SETITEMDATA),
ENTRY(CB_GETDROPPEDCONTROLRECT),
ENTRY(CB_SETITEMHEIGHT),
ENTRY(CB_GETITEMHEIGHT),
ENTRY(CB_SETEXTENDEDUI),
ENTRY(CB_GETEXTENDEDUI),
ENTRY(CB_GETDROPPEDSTATE),
ENTRY(CB_FINDSTRINGEXACT),
ENTRY(CB_SETLOCALE),
ENTRY(CB_GETLOCALE),
ENTRY(CB_GETTOPINDEX),
ENTRY(CB_SETTOPINDEX),
ENTRY(CB_GETHORIZONTALEXTENT),
ENTRY(CB_SETHORIZONTALEXTENT),
ENTRY(CB_GETDROPPEDWIDTH),
ENTRY(CB_SETDROPPEDWIDTH),
ENTRY(CB_INITSTORAGE),
ENTRY(CB_MSGMAX),
ENTRY(LB_ADDSTRING),
ENTRY(LB_INSERTSTRING),
ENTRY(LB_DELETESTRING),
ENTRY(LB_SELITEMRANGEEX),
ENTRY(LB_RESETCONTENT),
ENTRY(LB_SETSEL),
ENTRY(LB_SETCURSEL),
ENTRY(LB_GETSEL),
ENTRY(LB_GETCURSEL),
ENTRY(LB_GETTEXT),
ENTRY(LB_GETTEXTLEN),
ENTRY(LB_GETCOUNT),
ENTRY(LB_SELECTSTRING),
ENTRY(LB_DIR),
ENTRY(LB_GETTOPINDEX),
ENTRY(LB_FINDSTRING),
ENTRY(LB_GETSELCOUNT),
ENTRY(LB_GETSELITEMS),
ENTRY(LB_SETTABSTOPS),
ENTRY(LB_GETHORIZONTALEXTENT),
ENTRY(LB_SETHORIZONTALEXTENT),
ENTRY(LB_SETCOLUMNWIDTH),
ENTRY(LB_ADDFILE),
ENTRY(LB_SETTOPINDEX),
ENTRY(LB_GETITEMRECT),
ENTRY(LB_GETITEMDATA),
ENTRY(LB_SETITEMDATA),
ENTRY(LB_SELITEMRANGE),
ENTRY(LB_SETANCHORINDEX),
ENTRY(LB_GETANCHORINDEX),
ENTRY(LB_SETCARETINDEX),
ENTRY(LB_GETCARETINDEX),
ENTRY(LB_SETITEMHEIGHT),
ENTRY(LB_GETITEMHEIGHT),
ENTRY(LB_FINDSTRINGEXACT),
ENTRY(LB_SETLOCALE),
ENTRY(LB_GETLOCALE),
ENTRY(LB_SETCOUNT),
ENTRY(LB_INITSTORAGE),
ENTRY(LB_ITEMFROMPOINT),
ENTRY(LB_MSGMAX),
ENTRY(WM_MOUSEMOVE),
ENTRY(WM_LBUTTONDOWN),
ENTRY(WM_LBUTTONUP),
ENTRY(WM_LBUTTONDBLCLK),
ENTRY(WM_RBUTTONDOWN),
ENTRY(WM_RBUTTONUP),
ENTRY(WM_RBUTTONDBLCLK),
ENTRY(WM_MBUTTONDOWN),
ENTRY(WM_MBUTTONUP),
ENTRY(WM_MBUTTONDBLCLK),
ENTRY(WM_MOUSEWHEEL),
ENTRY(WM_MOUSEHWHEEL),
ENTRY(WM_PARENTNOTIFY),
ENTRY(WM_ENTERMENULOOP),
ENTRY(WM_EXITMENULOOP),
ENTRY(WM_NEXTMENU),
ENTRY(WM_SIZING),
ENTRY(WM_CAPTURECHANGED),
ENTRY(WM_MOVING),
ENTRY(WM_POWERBROADCAST),
ENTRY(WM_DEVICECHANGE),
ENTRY(WM_MDICREATE),
ENTRY(WM_MDIDESTROY),
ENTRY(WM_MDIACTIVATE),
ENTRY(WM_MDIRESTORE),
ENTRY(WM_MDINEXT),
ENTRY(WM_MDIMAXIMIZE),
ENTRY(WM_MDITILE),
ENTRY(WM_MDICASCADE),
ENTRY(WM_MDIICONARRANGE),
ENTRY(WM_MDIGETACTIVE),
ENTRY(WM_MDISETMENU),
ENTRY(WM_ENTERSIZEMOVE),
ENTRY(WM_EXITSIZEMOVE),
ENTRY(WM_DROPFILES),
ENTRY(WM_MDIREFRESHMENU),
ENTRY(WM_IME_SETCONTEXT),
ENTRY(WM_IME_NOTIFY),
ENTRY(WM_IME_CONTROL),
ENTRY(WM_IME_COMPOSITIONFULL),
ENTRY(WM_IME_SELECT),
ENTRY(WM_IME_CHAR),
ENTRY(WM_IME_REQUEST),
ENTRY(WM_IME_KEYDOWN),
ENTRY(WM_IME_KEYUP),
ENTRY(WM_NCMOUSEHOVER),
ENTRY(WM_MOUSEHOVER),
ENTRY(WM_MOUSELEAVE),
ENTRY(WM_CUT),
ENTRY(WM_COPY),
ENTRY(WM_PASTE),
ENTRY(WM_CLEAR),
ENTRY(WM_UNDO),
ENTRY(WM_RENDERFORMAT),
ENTRY(WM_RENDERALLFORMATS),
ENTRY(WM_DESTROYCLIPBOARD),
ENTRY(WM_DRAWCLIPBOARD),
ENTRY(WM_PAINTCLIPBOARD),
ENTRY(WM_VSCROLLCLIPBOARD),
ENTRY(WM_SIZECLIPBOARD),
ENTRY(WM_ASKCBFORMATNAME),
ENTRY(WM_CHANGECBCHAIN),
ENTRY(WM_HSCROLLCLIPBOARD),
ENTRY(WM_QUERYNEWPALETTE),
ENTRY(WM_PALETTEISCHANGING),
ENTRY(WM_PALETTECHANGED),
ENTRY(WM_HOTKEY),
ENTRY(WM_PRINT),
ENTRY(WM_PRINTCLIENT),
ENTRY(WM_THEMECHANGED),
ENTRY(WM_HANDHELDFIRST),
ENTRY(WM_HANDHELDLAST),
ENTRY(WM_AFXFIRST),
ENTRY(WM_AFXLAST),
ENTRY(WM_PENWINFIRST),
ENTRY(WM_PENWINLAST),
ENTRY(WM_APP),
ENTRY(WM_DWMCOMPOSITIONCHANGED),
ENTRY(WM_DWMNCRENDERINGCHANGED),
ENTRY(WM_DWMCOLORIZATIONCOLORCHANGED),
ENTRY(WM_DWMWINDOWMAXIMIZEDCHANGE),
ENTRY(WM_DWMSENDICONICTHUMBNAIL),
ENTRY(WM_DWMSENDICONICLIVEPREVIEWBITMAP),
ENTRY(WM_TABLET_QUERYSYSTEMGESTURESTATUS),
ENTRY(WM_GESTURE),
ENTRY(WM_GESTURENOTIFY),
ENTRY(WM_GETTITLEBARINFOEX),
{0x0, {nullptr, 0x0}}};
#undef ENTRY
#ifdef MOZ_PLACES

Просмотреть файл

@ -96,7 +96,7 @@ typedef struct {
const char* mStr;
UINT mId;
} EventMsgInfo;
extern EventMsgInfo gAllEvents[];
extern std::unordered_map<UINT, EventMsgInfo> gAllEvents;
// More complete QS definitions for MsgWaitForMultipleObjects() and
// GetQueueStatus() that include newer win8 specific defines.

Просмотреть файл

@ -5014,15 +5014,24 @@ bool nsWindow::ExternalHandlerProcessMessage(UINT aMessage, WPARAM& aWParam,
return false;
}
// The main windows message processing method.
// The main windows message processing method. Wraps ProcessMessageInternal so
// we can log aRetValue.
bool nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
LRESULT* aRetValue) {
#if defined(EVENT_DEBUG_OUTPUT)
// First param shows all events, second param indicates whether
// to show mouse move events. See nsWindowDbg for details.
PrintEvent(msg, SHOW_REPEAT_EVENTS, SHOW_MOUSEMOVE_EVENTS);
#endif
bool result = ProcessMessageInternal(msg, wParam, lParam, aRetValue);
// SHOW_REPEAT_EVENTS indicates whether to show all (repeating) events,
// SHOW_MOUSEMOVE_EVENTS indicates whether to show mouse move events.
// See nsWindowDbg for details.
PrintEvent(msg, wParam, lParam, *aRetValue, result, SHOW_REPEAT_EVENTS,
SHOW_MOUSEMOVE_EVENTS);
return result;
}
// The main windows message processing method. Called by ProcessMessage.
bool nsWindow::ProcessMessageInternal(UINT msg, WPARAM& wParam, LPARAM& lParam,
LRESULT* aRetValue) {
MSGResult msgResult(aRetValue);
if (ExternalHandlerProcessMessage(msg, wParam, lParam, msgResult)) {
return (msgResult.mConsumed || !mWnd);

Просмотреть файл

@ -554,6 +554,9 @@ class nsWindow final : public nsBaseWidget {
void RelayMouseEvent(UINT aMsg, WPARAM wParam, LPARAM lParam);
bool ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
LRESULT* aRetValue);
// We wrap this in ProcessMessage so we can log the return value
bool ProcessMessageInternal(UINT msg, WPARAM& wParam, LPARAM& lParam,
LRESULT* aRetValue);
bool ExternalHandlerProcessMessage(UINT aMessage, WPARAM& aWParam,
LPARAM& aLParam, MSGResult& aResult);
LRESULT ProcessCharMessage(const MSG& aMsg, bool* aEventDispatched);

Просмотреть файл

@ -14,6 +14,7 @@
using namespace mozilla;
using namespace mozilla::widget;
extern mozilla::LazyLogModule gWindowsLog;
static mozilla::LazyLogModule gWindowsEventLog("WindowsEvent");
#if defined(POPUP_ROLLUP_DEBUG_OUTPUT)
MSGFEventMsgInfo gMSGFEvents[] = {
@ -23,19 +24,24 @@ MSGFEventMsgInfo gMSGFEvents[] = {
#endif
static long gEventCounter = 0;
static long gLastEventMsg = 0;
static UINT gLastEventMsg = 0;
void PrintEvent(UINT msg, bool aShowAllEvents, bool aShowMouseMoves) {
int inx = 0;
while (gAllEvents[inx].mId != msg && gAllEvents[inx].mStr != nullptr) {
inx++;
}
if (aShowAllEvents || (!aShowAllEvents && gLastEventMsg != (long)msg)) {
// Size of WPARAM, LPARAM, and LRESULT depends on 32 or 64 bit build,
// we use 64 bit types here to ensure it works in either case.
void PrintEvent(UINT msg, uint64_t wParam, uint64_t lParam, uint64_t retValue,
bool result, bool aShowAllEvents, bool aShowMouseMoves) {
const auto eventMsgInfo = gAllEvents.find(msg);
const char* msgText =
eventMsgInfo != gAllEvents.end() ? eventMsgInfo->second.mStr : nullptr;
if (aShowAllEvents || (gLastEventMsg != msg)) {
if (aShowMouseMoves ||
(!aShowMouseMoves && msg != 0x0020 && msg != 0x0200 && msg != 0x0084)) {
MOZ_LOG(gWindowsLog, LogLevel::Info,
("%6d - 0x%04X %s\n", gEventCounter++, msg,
gAllEvents[inx].mStr ? gAllEvents[inx].mStr : "Unknown"));
(msg != WM_SETCURSOR && msg != WM_MOUSEMOVE && msg != WM_NCHITTEST)) {
MOZ_LOG(
gWindowsEventLog, LogLevel::Info,
("%6d - 0x%04X (0x%08llX 0x%08llX) %s: 0x%08llX (%s)\n",
gEventCounter++, msg, wParam, lParam, msgText ? msgText : "Unknown",
retValue, result ? "true" : "false"));
gLastEventMsg = msg;
}
}

Просмотреть файл

@ -12,9 +12,6 @@
#include "nsWindowDefs.h"
// Enabled main event loop debug event output
//#define EVENT_DEBUG_OUTPUT
// Enables debug output for popup rollup hooks
//#define POPUP_ROLLUP_DEBUG_OUTPUT
@ -29,12 +26,11 @@
//#define DEBUG_VK
// Main event loop debug output flags
#if defined(EVENT_DEBUG_OUTPUT)
# define SHOW_REPEAT_EVENTS true
# define SHOW_MOUSEMOVE_EVENTS false
#endif // defined(EVENT_DEBUG_OUTPUT)
#define SHOW_REPEAT_EVENTS true
#define SHOW_MOUSEMOVE_EVENTS false
void PrintEvent(UINT msg, bool aShowAllEvents, bool aShowMouseMoves);
void PrintEvent(UINT msg, uint64_t wParam, uint64_t lParam, uint64_t retValue,
bool result, bool aShowAllEvents, bool aShowMouseMoves);
#if defined(POPUP_ROLLUP_DEBUG_OUTPUT)
typedef struct {