| 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 #ifndef UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ | 5 #ifndef UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ |
| 6 #define UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ | 6 #define UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // For those that know X11, this is really a wrapper around XWindowEvent | 55 // For those that know X11, this is really a wrapper around XWindowEvent |
| 56 // which still makes sure the preempted event is dispatched instead of | 56 // which still makes sure the preempted event is dispatched instead of |
| 57 // dropped on the floor. This method exists because mapping a window is | 57 // dropped on the floor. This method exists because mapping a window is |
| 58 // asynchronous (and we receive an XEvent when mapped), while there are also | 58 // asynchronous (and we receive an XEvent when mapped), while there are also |
| 59 // functions which require a mapped window. | 59 // functions which require a mapped window. |
| 60 void BlockUntilWindowMapped(XID window); | 60 void BlockUntilWindowMapped(XID window); |
| 61 | 61 |
| 62 XDisplay* display() { return display_; } | 62 XDisplay* display() { return display_; } |
| 63 Time last_seen_server_time() const { return last_seen_server_time_; } | 63 Time last_seen_server_time() const { return last_seen_server_time_; } |
| 64 | 64 |
| 65 // Explicitly asks the X11 server for the current timestamp, and updates |
| 66 // |last_seen_server_time| with this value. |
| 67 Time UpdateLastSeenServerTime(); |
| 68 |
| 65 void StopCurrentEventStream(); | 69 void StopCurrentEventStream(); |
| 66 void OnDispatcherListChanged(); | 70 void OnDispatcherListChanged(); |
| 67 | 71 |
| 68 protected: | 72 protected: |
| 69 // Extracts cookie data from |xevent| if it's of GenericType, and dispatches | 73 // Extracts cookie data from |xevent| if it's of GenericType, and dispatches |
| 70 // the event. This function also frees up the cookie data after dispatch is | 74 // the event. This function also frees up the cookie data after dispatch is |
| 71 // complete. | 75 // complete. |
| 72 void ExtractCookieDataDispatchEvent(XEvent* xevent); | 76 void ExtractCookieDataDispatchEvent(XEvent* xevent); |
| 73 | 77 |
| 74 // Handles updates after event has been dispatched. | 78 // Handles updates after event has been dispatched. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 90 bool continue_stream_ = true; | 94 bool continue_stream_ = true; |
| 91 | 95 |
| 92 std::unique_ptr<X11HotplugEventHandler> hotplug_event_handler_; | 96 std::unique_ptr<X11HotplugEventHandler> hotplug_event_handler_; |
| 93 | 97 |
| 94 DISALLOW_COPY_AND_ASSIGN(X11EventSource); | 98 DISALLOW_COPY_AND_ASSIGN(X11EventSource); |
| 95 }; | 99 }; |
| 96 | 100 |
| 97 } // namespace ui | 101 } // namespace ui |
| 98 | 102 |
| 99 #endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ | 103 #endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ |
| OLD | NEW |