| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/platform_window/x11/x11_window_base.h" | 5 #include "ui/platform_window/x11/x11_window_base.h" |
| 6 | 6 |
| 7 #include <X11/extensions/XInput2.h> | 7 #include <X11/extensions/XInput2.h> |
| 8 #include <X11/Xatom.h> | 8 #include <X11/Xatom.h> |
| 9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
| 10 #include <X11/Xutil.h> | 10 #include <X11/Xutil.h> |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "ui/base/x/x11_window_event_manager.h" |
| 15 #include "ui/events/devices/x11/touch_factory_x11.h" | 16 #include "ui/events/devices/x11/touch_factory_x11.h" |
| 16 #include "ui/events/event.h" | 17 #include "ui/events/event.h" |
| 17 #include "ui/events/event_utils.h" | 18 #include "ui/events/event_utils.h" |
| 18 #include "ui/events/platform/platform_event_dispatcher.h" | 19 #include "ui/events/platform/platform_event_dispatcher.h" |
| 19 #include "ui/events/platform/platform_event_source.h" | 20 #include "ui/events/platform/platform_event_source.h" |
| 20 #include "ui/events/platform/x11/x11_event_source.h" | 21 #include "ui/events/platform/x11/x11_event_source.h" |
| 21 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
| 22 #include "ui/platform_window/platform_window_delegate.h" | 23 #include "ui/platform_window/platform_window_delegate.h" |
| 23 | 24 |
| 24 namespace ui { | 25 namespace ui { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 InputOutput, | 83 InputOutput, |
| 83 CopyFromParent, // visual | 84 CopyFromParent, // visual |
| 84 CWBackPixmap | CWBitGravity | CWOverrideRedirect, &swa); | 85 CWBackPixmap | CWBitGravity | CWOverrideRedirect, &swa); |
| 85 | 86 |
| 86 // Setup XInput event mask. | 87 // Setup XInput event mask. |
| 87 long event_mask = ButtonPressMask | ButtonReleaseMask | FocusChangeMask | | 88 long event_mask = ButtonPressMask | ButtonReleaseMask | FocusChangeMask | |
| 88 KeyPressMask | KeyReleaseMask | EnterWindowMask | | 89 KeyPressMask | KeyReleaseMask | EnterWindowMask | |
| 89 LeaveWindowMask | ExposureMask | VisibilityChangeMask | | 90 LeaveWindowMask | ExposureMask | VisibilityChangeMask | |
| 90 StructureNotifyMask | PropertyChangeMask | | 91 StructureNotifyMask | PropertyChangeMask | |
| 91 PointerMotionMask; | 92 PointerMotionMask; |
| 92 XSelectInput(xdisplay_, xwindow_, event_mask); | 93 xwindow_events_.reset(new ui::XScopedEventSelector(xwindow_, event_mask)); |
| 93 | 94 |
| 94 // Setup XInput2 event mask. | 95 // Setup XInput2 event mask. |
| 95 unsigned char mask[XIMaskLen(XI_LASTEVENT)]; | 96 unsigned char mask[XIMaskLen(XI_LASTEVENT)]; |
| 96 memset(mask, 0, sizeof(mask)); | 97 memset(mask, 0, sizeof(mask)); |
| 97 | 98 |
| 98 XISetMask(mask, XI_TouchBegin); | 99 XISetMask(mask, XI_TouchBegin); |
| 99 XISetMask(mask, XI_TouchUpdate); | 100 XISetMask(mask, XI_TouchUpdate); |
| 100 XISetMask(mask, XI_TouchEnd); | 101 XISetMask(mask, XI_TouchEnd); |
| 101 XISetMask(mask, XI_ButtonPress); | 102 XISetMask(mask, XI_ButtonPress); |
| 102 XISetMask(mask, XI_ButtonRelease); | 103 XISetMask(mask, XI_ButtonRelease); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 } | 292 } |
| 292 | 293 |
| 293 namespace test { | 294 namespace test { |
| 294 | 295 |
| 295 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { | 296 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { |
| 296 g_override_redirect = override_redirect; | 297 g_override_redirect = override_redirect; |
| 297 } | 298 } |
| 298 | 299 |
| 299 } // namespace test | 300 } // namespace test |
| 300 } // namespace ui | 301 } // namespace ui |
| OLD | NEW |