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

Side by Side Diff: ui/aura/root_window_host_x11.cc

Issue 22264002: Mark mouse events created for Enter/Leave notify as synthesized as they're not real mouse events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/views/corewm/compound_event_filter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/root_window_host_x11.h" 5 #include "ui/aura/root_window_host_x11.h"
6 6
7 #include <strings.h> 7 #include <strings.h>
8 #include <X11/cursorfont.h> 8 #include <X11/cursorfont.h>
9 #include <X11/extensions/Xfixes.h> 9 #include <X11/extensions/Xfixes.h>
10 #include <X11/extensions/XInput2.h> 10 #include <X11/extensions/XInput2.h>
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 XDestroyWindow(xdisplay_, xwindow_); 451 XDestroyWindow(xdisplay_, xwindow_);
452 } 452 }
453 453
454 bool RootWindowHostX11::Dispatch(const base::NativeEvent& event) { 454 bool RootWindowHostX11::Dispatch(const base::NativeEvent& event) {
455 XEvent* xev = event; 455 XEvent* xev = event;
456 456
457 if (FindEventTarget(event) == x_root_window_) 457 if (FindEventTarget(event) == x_root_window_)
458 return DispatchEventForRootWindow(event); 458 return DispatchEventForRootWindow(event);
459 459
460 switch (xev->type) { 460 switch (xev->type) {
461 case EnterNotify: 461 case EnterNotify: {
462 ui::MouseEvent mouse_event(xev);
463 // EnterNotify creates ET_MOUSE_MOVE. Mark as synthesized as this is not
464 // real mouse move event.
465 mouse_event.set_flags(mouse_event.flags() | ui::EF_IS_SYNTHESIZED);
466 TranslateAndDispatchMouseEvent(&mouse_event);
467 break;
468 }
462 case LeaveNotify: { 469 case LeaveNotify: {
463 ui::MouseEvent mouse_event(xev); 470 ui::MouseEvent mouse_event(xev);
464 TranslateAndDispatchMouseEvent(&mouse_event); 471 TranslateAndDispatchMouseEvent(&mouse_event);
465 break; 472 break;
466 } 473 }
467 case Expose: { 474 case Expose: {
468 gfx::Rect damage_rect(xev->xexpose.x, xev->xexpose.y, 475 gfx::Rect damage_rect(xev->xexpose.x, xev->xexpose.y,
469 xev->xexpose.width, xev->xexpose.height); 476 xev->xexpose.width, xev->xexpose.height);
470 delegate_->AsRootWindow()->ScheduleRedrawRect(damage_rect); 477 delegate_->AsRootWindow()->ScheduleRedrawRect(damage_rect);
471 break; 478 break;
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 } 1146 }
1140 1147
1141 namespace test { 1148 namespace test {
1142 1149
1143 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { 1150 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) {
1144 default_override_redirect = override_redirect; 1151 default_override_redirect = override_redirect;
1145 } 1152 }
1146 1153
1147 } // namespace test 1154 } // namespace test
1148 } // namespace aura 1155 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ui/views/corewm/compound_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698