OLD | NEW |
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 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ |
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ |
7 | 7 |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 9 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
10 #undef RootWindow | 10 #undef RootWindow |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 ACTIVE, | 69 ACTIVE, |
70 NOT_ACTIVE | 70 NOT_ACTIVE |
71 }; | 71 }; |
72 | 72 |
73 X11DesktopHandler(); | 73 X11DesktopHandler(); |
74 virtual ~X11DesktopHandler(); | 74 virtual ~X11DesktopHandler(); |
75 | 75 |
76 // Handles changes in activation. | 76 // Handles changes in activation. |
77 void OnActiveWindowChanged(::Window window, ActiveState active_state); | 77 void OnActiveWindowChanged(::Window window, ActiveState active_state); |
78 | 78 |
| 79 // Called when |window| has been created or destroyed. |window| may not be |
| 80 // managed by Chrome. |
| 81 void OnWindowCreatedOrDestroyed(int event_type, XID window); |
| 82 |
79 // The display and the native X window hosting the root window. | 83 // The display and the native X window hosting the root window. |
80 XDisplay* xdisplay_; | 84 XDisplay* xdisplay_; |
81 | 85 |
82 // The native root window. | 86 // The native root window. |
83 ::Window x_root_window_; | 87 ::Window x_root_window_; |
84 | 88 |
85 // The X11 server time of the most recent mouse click, touch, or key press | 89 // The X11 server time of the most recent mouse click, touch, or key press |
86 // on a Chrome window. | 90 // on a Chrome window. |
87 unsigned long wm_user_time_ms_; | 91 unsigned long wm_user_time_ms_; |
88 | 92 |
89 // The active window according to X11 server. | 93 // The active window according to X11 server. |
90 ::Window current_window_; | 94 ::Window current_window_; |
91 | 95 |
92 // Whether we should treat |current_window_| as active. In particular, we | 96 // Whether we should treat |current_window_| as active. In particular, we |
93 // pretend that a window is deactivated after a call to DeactivateWindow(). | 97 // pretend that a window is deactivated after a call to DeactivateWindow(). |
94 ActiveState current_window_active_state_; | 98 ActiveState current_window_active_state_; |
95 | 99 |
96 ui::X11AtomCache atom_cache_; | 100 ui::X11AtomCache atom_cache_; |
97 | 101 |
98 bool wm_supports_active_window_; | 102 bool wm_supports_active_window_; |
99 | 103 |
100 DISALLOW_COPY_AND_ASSIGN(X11DesktopHandler); | 104 DISALLOW_COPY_AND_ASSIGN(X11DesktopHandler); |
101 }; | 105 }; |
102 | 106 |
103 } // namespace views | 107 } // namespace views |
104 | 108 |
105 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ | 109 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ |
OLD | NEW |