Closed Bug 1516326 Opened 5 years ago Closed 5 years ago

Move key event handlers of nsWindow to nsGtkKeyUtils to make them loggable

Categories

(Core :: Widget: Gtk, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(2 files)

Currently, widget/gtk/nsWindow.cpp dispatches keyboard events with some complicated code.  However, there is no logging code for them.  Therefore, we cannot get a log to debug of bugs which can reproduce only in some environments like bug 1498823. So, we should move them into nsGtkKeyUtils.cpp and make them output their log.
Move all implementation of nsWindow::OnKeyPress() and nsWindow::OnKeyRelease()
into KeymapWrapper because the implementation is a little bit complicated
but not loggable.  When we get bug reports which depend on environment around
IME/key handling like bug 1498823, it's useful to log those methods behavior
too.
We haven't logged KeymapWrapper::HandleKeyPressEvent() nor
KeymapWrapper::HandleKeyReleaseEvent().  Therefore, this patch makes them
put their behavior into the log.

Additionally, KeymapWrapper::InitKeyEvent() does not log enough the result
of initialized WidgetkeyboardEvent.  This patch makes it log more.

With those changes, we can get the log of:
- detail of dispatched keyboard events
- which key event didn't cause keyboard events
- which keyboard event was consumed

Note that the utility methods are copied from widget/windows.  Perhaps,
we should create XP logging helper for keyboard/IME later.
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/7f3d73861dfe
part 1: Move implementation of nsWindow::OnKeyPress() and nsWindow::OnKeyRelease() into KeymapWrapper r=karlt
https://hg.mozilla.org/integration/autoland/rev/e80f4801231c
part 2: Log more in KeymapWrapper r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: