OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.h" | 5 #include "ui/platform_window/x11/x11_window.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> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 window_mapped_(false) { | 49 window_mapped_(false) { |
50 CHECK(delegate_); | 50 CHECK(delegate_); |
51 TouchFactory::SetTouchDeviceListFromCommandLine(); | 51 TouchFactory::SetTouchDeviceListFromCommandLine(); |
52 } | 52 } |
53 | 53 |
54 X11Window::~X11Window() { | 54 X11Window::~X11Window() { |
55 Destroy(); | 55 Destroy(); |
56 } | 56 } |
57 | 57 |
58 void X11Window::Destroy() { | 58 void X11Window::Destroy() { |
59 delegate_->OnClosed(); | |
60 if (xwindow_ == None) | 59 if (xwindow_ == None) |
61 return; | 60 return; |
62 | 61 |
63 // Stop processing events. | 62 // Stop processing events. |
64 PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); | 63 PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); |
65 XDestroyWindow(xdisplay_, xwindow_); | 64 XDestroyWindow(xdisplay_, xwindow_); |
66 xwindow_ = None; | 65 xwindow_ = None; |
67 } | 66 } |
68 | 67 |
69 void X11Window::ProcessXInput2Event(XEvent* xev) { | 68 void X11Window::ProcessXInput2Event(XEvent* xev) { |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 350 |
352 case GenericEvent: { | 351 case GenericEvent: { |
353 ProcessXInput2Event(xev); | 352 ProcessXInput2Event(xev); |
354 break; | 353 break; |
355 } | 354 } |
356 } | 355 } |
357 return POST_DISPATCH_STOP_PROPAGATION; | 356 return POST_DISPATCH_STOP_PROPAGATION; |
358 } | 357 } |
359 | 358 |
360 } // namespace ui | 359 } // namespace ui |
OLD | NEW |