Fixing the issue of GDK discarding unsupported XInput events.

Current implementation of message_pump_glib_x uses both X event queue and GDK's g_main_context_iteration to read event messages.

If the first X event in the X event queue can be dispatched directly, it will be extracted and dispatched.
If the first X event in the X event queue can't be dispatched directly, g_main_context_iteration will be called to translate X events into GDK evnets.
If the first X event can't be dispatched directly and is followed by X events that can be dispatched directly in the event queue,
those events that can be dispatched directly will also go through GDK and may get lost if GDK does not recognize them (e.g. XInput2 events).

To fix this, a GDK event filter is setup to intercept all the X events before they are translated into GDK events.
In the filter if the X events are found to be wanted, they will get dispatched directly instead of translated into GDK events.

BUG=
TEST=

Review URL: http://codereview.chromium.org/7050030
Patch from Yufeng Shen <miletus@chromium.org>.

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86610 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 74f44d5363ccc0692e127188a711efe4d4b144fc
2 files changed
tree: 5d152fee870338293772bc5e40314d32279bfd0e
  1. base/
  2. build/
  3. ipc/
  4. testing/
  5. third_party/