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_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
7 | 7 |
8 #include <X11/extensions/shape.h> | 8 #include <X11/extensions/shape.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 | 10 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 void InitModalType(ui::ModalType modal_type) override; | 140 void InitModalType(ui::ModalType modal_type) override; |
141 void FlashFrame(bool flash_frame) override; | 141 void FlashFrame(bool flash_frame) override; |
142 void OnRootViewLayout() override; | 142 void OnRootViewLayout() override; |
143 void OnNativeWidgetFocus() override; | 143 void OnNativeWidgetFocus() override; |
144 void OnNativeWidgetBlur() override; | 144 void OnNativeWidgetBlur() override; |
145 bool IsAnimatingClosed() const override; | 145 bool IsAnimatingClosed() const override; |
146 bool IsTranslucentWindowOpacitySupported() const override; | 146 bool IsTranslucentWindowOpacitySupported() const override; |
147 void SizeConstraintsChanged() override; | 147 void SizeConstraintsChanged() override; |
148 | 148 |
149 // Overridden from aura::WindowTreeHost: | 149 // Overridden from aura::WindowTreeHost: |
| 150 gfx::Transform GetRootTransform() const override; |
150 ui::EventSource* GetEventSource() override; | 151 ui::EventSource* GetEventSource() override; |
151 gfx::AcceleratedWidget GetAcceleratedWidget() override; | 152 gfx::AcceleratedWidget GetAcceleratedWidget() override; |
152 void Show() override; | 153 void Show() override; |
153 void Hide() override; | 154 void Hide() override; |
154 gfx::Rect GetBounds() const override; | 155 gfx::Rect GetBounds() const override; |
155 void SetBounds(const gfx::Rect& requested_bounds) override; | 156 void SetBounds(const gfx::Rect& requested_bounds_in_pixels) override; |
156 gfx::Point GetLocationOnNativeScreen() const override; | 157 gfx::Point GetLocationOnNativeScreen() const override; |
157 void SetCapture() override; | 158 void SetCapture() override; |
158 void ReleaseCapture() override; | 159 void ReleaseCapture() override; |
159 void SetCursorNative(gfx::NativeCursor cursor) override; | 160 void SetCursorNative(gfx::NativeCursor cursor) override; |
160 void MoveCursorToNative(const gfx::Point& location) override; | 161 void MoveCursorToNative(const gfx::Point& location) override; |
161 void OnCursorVisibilityChangedNative(bool show) override; | 162 void OnCursorVisibilityChangedNative(bool show) override; |
162 | 163 |
163 // Overridden frm ui::EventSource | 164 // Overridden frm ui::EventSource |
164 ui::EventProcessor* GetEventProcessor() override; | 165 ui::EventProcessor* GetEventProcessor() override; |
165 | 166 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 235 |
235 void SetWindowTransparency(); | 236 void SetWindowTransparency(); |
236 | 237 |
237 // Relayout the widget's client and non-client views. | 238 // Relayout the widget's client and non-client views. |
238 void Relayout(); | 239 void Relayout(); |
239 | 240 |
240 // ui::PlatformEventDispatcher: | 241 // ui::PlatformEventDispatcher: |
241 bool CanDispatchEvent(const ui::PlatformEvent& event) override; | 242 bool CanDispatchEvent(const ui::PlatformEvent& event) override; |
242 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; | 243 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; |
243 | 244 |
244 void DelayedResize(const gfx::Size& size); | 245 void DelayedResize(const gfx::Size& size_in_pixels); |
| 246 |
| 247 gfx::Rect GetWorkAreaBoundsInPixels() const; |
| 248 gfx::Rect ToDIPRect(const gfx::Rect& rect_in_pixels) const; |
| 249 gfx::Rect ToPixelRect(const gfx::Rect& rect_in_dip) const; |
245 | 250 |
246 // X11 things | 251 // X11 things |
247 // The display and the native X window hosting the root window. | 252 // The display and the native X window hosting the root window. |
248 XDisplay* xdisplay_; | 253 XDisplay* xdisplay_; |
249 ::Window xwindow_; | 254 ::Window xwindow_; |
250 | 255 |
251 // The native root window. | 256 // The native root window. |
252 ::Window x_root_window_; | 257 ::Window x_root_window_; |
253 | 258 |
254 ui::X11AtomCache atom_cache_; | 259 ui::X11AtomCache atom_cache_; |
255 | 260 |
256 // Is the window mapped to the screen? | 261 // Is the window mapped to the screen? |
257 bool window_mapped_; | 262 bool window_mapped_; |
258 | 263 |
259 // The bounds of |xwindow_|. | 264 // The bounds of |xwindow_|. |
260 gfx::Rect bounds_; | 265 gfx::Rect bounds_in_pixels_; |
261 | 266 |
262 // Whenever the bounds are set, we keep the previous set of bounds around so | 267 // Whenever the bounds are set, we keep the previous set of bounds around so |
263 // we can have a better chance of getting the real |restored_bounds_|. Window | 268 // we can have a better chance of getting the real |
264 // managers tend to send a Configure message with the maximized bounds, and | 269 // |restored_bounds_in_pixels_|. Window managers tend to send a Configure |
265 // then set the window maximized property. (We don't rely on this for when we | 270 // message with the maximized bounds, and then set the window maximized |
266 // request that the window be maximized, only when we detect that some other | 271 // property. (We don't rely on this for when we request that the window be |
267 // process has requested that we become the maximized window.) | 272 // maximized, only when we detect that some other process has requested that |
268 gfx::Rect previous_bounds_; | 273 // we become the maximized window.) |
| 274 gfx::Rect previous_bounds_in_pixels_; |
269 | 275 |
270 // The bounds of our window before we were maximized. | 276 // The bounds of our window before we were maximized. |
271 gfx::Rect restored_bounds_; | 277 gfx::Rect restored_bounds_in_pixels_; |
272 | 278 |
273 // |xwindow_|'s minimum size. | 279 // |xwindow_|'s minimum size. |
274 gfx::Size min_size_; | 280 gfx::Size min_size_in_pixels_; |
275 | 281 |
276 // |xwindow_|'s maximum size. | 282 // |xwindow_|'s maximum size. |
277 gfx::Size max_size_; | 283 gfx::Size max_size_in_pixels_; |
278 | 284 |
279 // The window manager state bits. | 285 // The window manager state bits. |
280 std::set< ::Atom> window_properties_; | 286 std::set< ::Atom> window_properties_; |
281 | 287 |
282 // Whether |xwindow_| was requested to be fullscreen via SetFullscreen(). | 288 // Whether |xwindow_| was requested to be fullscreen via SetFullscreen(). |
283 bool is_fullscreen_; | 289 bool is_fullscreen_; |
284 | 290 |
285 // True if the window should stay on top of most other windows. | 291 // True if the window should stay on top of most other windows. |
286 bool is_always_on_top_; | 292 bool is_always_on_top_; |
287 | 293 |
(...skipping 26 matching lines...) Expand all Loading... |
314 | 320 |
315 ObserverList<DesktopWindowTreeHostObserverX11> observer_list_; | 321 ObserverList<DesktopWindowTreeHostObserverX11> observer_list_; |
316 | 322 |
317 // The window shape if the window is non-rectangular. | 323 // The window shape if the window is non-rectangular. |
318 ::Region window_shape_; | 324 ::Region window_shape_; |
319 | 325 |
320 // Whether |window_shape_| was set via SetShape(). | 326 // Whether |window_shape_| was set via SetShape(). |
321 bool custom_window_shape_; | 327 bool custom_window_shape_; |
322 | 328 |
323 // The size of the window manager provided borders (if any). | 329 // The size of the window manager provided borders (if any). |
324 gfx::Insets native_window_frame_borders_; | 330 gfx::Insets native_window_frame_borders_in_pixels_; |
325 | 331 |
326 // The current DesktopWindowTreeHostX11 which has capture. Set synchronously | 332 // The current DesktopWindowTreeHostX11 which has capture. Set synchronously |
327 // when capture is requested via SetCapture(). | 333 // when capture is requested via SetCapture(). |
328 static DesktopWindowTreeHostX11* g_current_capture; | 334 static DesktopWindowTreeHostX11* g_current_capture; |
329 | 335 |
330 // A list of all (top-level) windows that have been created but not yet | 336 // A list of all (top-level) windows that have been created but not yet |
331 // destroyed. | 337 // destroyed. |
332 static std::list<XID>* open_windows_; | 338 static std::list<XID>* open_windows_; |
333 | 339 |
334 base::string16 window_title_; | 340 base::string16 window_title_; |
335 | 341 |
336 // Whether we currently are flashing our frame. This feature is implemented | 342 // Whether we currently are flashing our frame. This feature is implemented |
337 // by setting the urgency hint with the window manager, which can draw | 343 // by setting the urgency hint with the window manager, which can draw |
338 // attention to the window or completely ignore the hint. We stop flashing | 344 // attention to the window or completely ignore the hint. We stop flashing |
339 // the frame when |xwindow_| gains focus or handles a mouse button event. | 345 // the frame when |xwindow_| gains focus or handles a mouse button event. |
340 bool urgency_hint_set_; | 346 bool urgency_hint_set_; |
341 | 347 |
342 base::CancelableCallback<void()> delayed_resize_task_; | 348 base::CancelableCallback<void()> delayed_resize_task_; |
343 | 349 |
344 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; | 350 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; |
345 | 351 |
346 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); | 352 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); |
347 }; | 353 }; |
348 | 354 |
349 } // namespace views | 355 } // namespace views |
350 | 356 |
351 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 357 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
OLD | NEW |