Revert of Listen for key events in SetupXI2ForXWindow()...

Revert of Listen for key events in SetupXI2ForXWindow() (https://codereview.chromium.org/404423002/)

Reason for revert:
The patch regressed editing behavior: crbug.com/401450

TBR=kpschoedel
NOTRY=true

Original issue's description:
> Listen for key events in SetupXI2ForXWindow()
> 
> BUG=368750
> R=sadrul
> TEST=on device and desktop
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=287772

Review URL: https://codereview.chromium.org/445413002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288039 0039d316-1c4b-4281-b951-d872f2087c98
parent b1c5ab68
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "ui/base/ime/composition_text_util_pango.h" #include "ui/base/ime/composition_text_util_pango.h"
#include "ui/base/ime/text_input_client.h" #include "ui/base/ime/text_input_client.h"
#include "ui/events/event.h" #include "ui/events/event.h"
#include "ui/events/keycodes/keyboard_code_conversion_x.h"
#include "ui/gfx/x/x11_types.h" #include "ui/gfx/x/x11_types.h"
namespace libgtk2ui { namespace libgtk2ui {
...@@ -192,16 +191,8 @@ void X11InputMethodContextImplGtk2::ResetXModifierKeycodesCache() { ...@@ -192,16 +191,8 @@ void X11InputMethodContextImplGtk2::ResetXModifierKeycodesCache() {
GdkEvent* X11InputMethodContextImplGtk2::GdkEventFromNativeEvent( GdkEvent* X11InputMethodContextImplGtk2::GdkEventFromNativeEvent(
const base::NativeEvent& native_event) { const base::NativeEvent& native_event) {
XEvent xkeyevent; const XKeyEvent& xkey = native_event->xkey;
if (native_event->type == GenericEvent) { DCHECK(xkey.type == KeyPress || xkey.type == KeyRelease);
// If this is an XI2 key event, build a matching core X event, to avoid
// having two cases for every use.
ui::InitXKeyEventFromXIDeviceEvent(*native_event, &xkeyevent);
} else {
DCHECK(native_event->type == KeyPress || native_event->type == KeyRelease);
xkeyevent.xkey = native_event->xkey;
}
XKeyEvent& xkey = xkeyevent.xkey;
// Get a GdkDisplay. // Get a GdkDisplay.
GdkDisplay* display = gdk_x11_lookup_xdisplay(xkey.display); GdkDisplay* display = gdk_x11_lookup_xdisplay(xkey.display);
...@@ -216,7 +207,7 @@ GdkEvent* X11InputMethodContextImplGtk2::GdkEventFromNativeEvent( ...@@ -216,7 +207,7 @@ GdkEvent* X11InputMethodContextImplGtk2::GdkEventFromNativeEvent(
// Get a keysym and group. // Get a keysym and group.
KeySym keysym = NoSymbol; KeySym keysym = NoSymbol;
guint8 keyboard_group = 0; guint8 keyboard_group = 0;
XLookupString(&xkey, NULL, 0, &keysym, NULL); XLookupString(&native_event->xkey, NULL, 0, &keysym, NULL);
GdkKeymap* keymap = gdk_keymap_get_for_display(display); GdkKeymap* keymap = gdk_keymap_get_for_display(display);
GdkKeymapKey* keys = NULL; GdkKeymapKey* keys = NULL;
guint* keyvals = NULL; guint* keyvals = NULL;
......
...@@ -210,8 +210,6 @@ void TouchFactory::SetupXI2ForXWindow(Window window) { ...@@ -210,8 +210,6 @@ void TouchFactory::SetupXI2ForXWindow(Window window) {
XISetMask(mask, XI_ButtonPress); XISetMask(mask, XI_ButtonPress);
XISetMask(mask, XI_ButtonRelease); XISetMask(mask, XI_ButtonRelease);
XISetMask(mask, XI_Motion); XISetMask(mask, XI_Motion);
XISetMask(mask, XI_KeyPress);
XISetMask(mask, XI_KeyRelease);
XIEventMask evmask; XIEventMask evmask;
evmask.deviceid = XIAllDevices; evmask.deviceid = XIAllDevices;
......
...@@ -1765,12 +1765,6 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( ...@@ -1765,12 +1765,6 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
SendEventToProcessor(&scrollev); SendEventToProcessor(&scrollev);
break; break;
} }
case ui::ET_KEY_PRESSED:
case ui::ET_KEY_RELEASED: {
ui::KeyEvent key_event(xev);
SendEventToProcessor(&key_event);
break;
}
case ui::ET_UNKNOWN: case ui::ET_UNKNOWN:
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment