Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Unified Diff: chrome/test/base/ui_controls_aurax11.cc

Issue 12086095: Fixed drag and drop into and out of Browser Plugin. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comments Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/base/ui_controls_aurax11.cc
diff --git a/chrome/test/base/ui_controls_aurax11.cc b/chrome/test/base/ui_controls_aurax11.cc
index 9d57fbc9b5c8b37f4d0d8013823875ff32747b4d..7e914e32c06015d4c4ff7a6aa88d12d8ec6b1ed5 100644
--- a/chrome/test/base/ui_controls_aurax11.cc
+++ b/chrome/test/base/ui_controls_aurax11.cc
@@ -166,30 +166,35 @@ class UIControlsX11 : public UIControlsAura {
xbutton->x = mouse_loc.x();
xbutton->y = mouse_loc.y();
xbutton->same_screen = True;
+ // According to http://tronche.com/gui/x/xlib/events/keyboard-pointer/
dcheng 2013/04/18 21:10:34 Nit: Just looking at the diff, it's not 100% clear
+ // keyboard-pointer.html#XButtonEvent, the state should be set to the
+ // button state just prior to the event.
+ xbutton->state = button_down_mask;
+ unsigned button = 0;
switch (type) {
case LEFT:
xbutton->button = Button1;
- xbutton->state = Button1Mask;
+ button = Button1Mask;
break;
case MIDDLE:
xbutton->button = Button2;
- xbutton->state = Button2Mask;
+ button = Button2Mask;
break;
case RIGHT:
xbutton->button = Button3;
- xbutton->state = Button3Mask;
+ button = Button3Mask;
break;
}
// RootWindow will take care of other necessary fields.
if (state & DOWN) {
xevent.xbutton.type = ButtonPress;
root_window_->PostNativeEvent(&xevent);
- button_down_mask |= xbutton->state;
+ button_down_mask |= button;
}
if (state & UP) {
xevent.xbutton.type = ButtonRelease;
root_window_->PostNativeEvent(&xevent);
- button_down_mask = (button_down_mask | xbutton->state) ^ xbutton->state;
+ button_down_mask &= ~button;
}
RunClosureAfterAllPendingUIEvents(closure);
return true;

Powered by Google App Engine
This is Rietveld 408576698