| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 WINDOW_MANAGER_WINDOW_MANAGER_H_ | 5 #ifndef WINDOW_MANAGER_WINDOW_MANAGER_H_ |
| 6 #define WINDOW_MANAGER_WINDOW_MANAGER_H_ | 6 #define WINDOW_MANAGER_WINDOW_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 } | 90 } |
| 91 | 91 |
| 92 EventLoop* event_loop() { return event_loop_; } | 92 EventLoop* event_loop() { return event_loop_; } |
| 93 XConnection* xconn() { return xconn_; } | 93 XConnection* xconn() { return xconn_; } |
| 94 Compositor* compositor() { return compositor_; } | 94 Compositor* compositor() { return compositor_; } |
| 95 DBusInterface* dbus() { return dbus_; } | 95 DBusInterface* dbus() { return dbus_; } |
| 96 StackingManager* stacking_manager() { return stacking_manager_.get(); } | 96 StackingManager* stacking_manager() { return stacking_manager_.get(); } |
| 97 FocusManager* focus_manager() { return focus_manager_.get(); } | 97 FocusManager* focus_manager() { return focus_manager_.get(); } |
| 98 | 98 |
| 99 XWindow root() const { return root_; } | 99 XWindow root() const { return root_; } |
| 100 const Rect& root_bounds() const { return root_bounds_; } |
| 101 Size root_size() const { return root_bounds_.size(); } |
| 102 int root_depth() const { return root_depth_; } |
| 103 int width() const { return root_bounds_.width; } |
| 104 int height() const { return root_bounds_.height; } |
| 105 |
| 100 const Stacker<XWindow>& stacked_xids() const { | 106 const Stacker<XWindow>& stacked_xids() const { |
| 101 return *(stacked_xids_.get()); | 107 return *(stacked_xids_.get()); |
| 102 } | 108 } |
| 103 | 109 |
| 104 Compositor::StageActor* stage() { return stage_; } | 110 Compositor::StageActor* stage() { return stage_; } |
| 105 | 111 |
| 106 int width() const { return width_; } | |
| 107 int height() const { return height_; } | |
| 108 int root_depth() const { return root_depth_; } | |
| 109 Rect bounds() const { return Rect(0, 0, width_, height_); } | |
| 110 | |
| 111 XWindow wm_xid() const { return wm_xid_; } | 112 XWindow wm_xid() const { return wm_xid_; } |
| 112 XWindow active_window_xid() const { return active_window_xid_; } | 113 XWindow active_window_xid() const { return active_window_xid_; } |
| 113 | 114 |
| 114 KeyBindings* key_bindings() { return key_bindings_.get(); } | 115 KeyBindings* key_bindings() { return key_bindings_.get(); } |
| 115 WmIpc* wm_ipc() { return wm_ipc_.get(); } | 116 WmIpc* wm_ipc() { return wm_ipc_.get(); } |
| 116 int wm_ipc_version() const { return wm_ipc_version_; } | 117 int wm_ipc_version() const { return wm_ipc_version_; } |
| 117 | 118 |
| 118 bool logged_in() const { return logged_in_; } | 119 bool logged_in() const { return logged_in_; } |
| 119 bool damage_debugging_enabled() const { return damage_debugging_enabled_; } | 120 bool damage_debugging_enabled() const { return damage_debugging_enabled_; } |
| 120 | 121 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 XAtom atom, XWindow manager_win, XTime timestamp); | 350 XAtom atom, XWindow manager_win, XTime timestamp); |
| 350 | 351 |
| 351 // Tell the previous window and compositing managers to exit and register | 352 // Tell the previous window and compositing managers to exit and register |
| 352 // ourselves as the new managers. | 353 // ourselves as the new managers. |
| 353 bool RegisterExistence(); | 354 bool RegisterExistence(); |
| 354 | 355 |
| 355 // Set various one-time/unchanging properties on the root window as | 356 // Set various one-time/unchanging properties on the root window as |
| 356 // specified in the Extended Window Manager Hints. | 357 // specified in the Extended Window Manager Hints. |
| 357 bool SetEwmhGeneralProperties(); | 358 bool SetEwmhGeneralProperties(); |
| 358 | 359 |
| 359 // Set EWMH properties on the root window relating to the current screen | 360 // Set EWMH properties on the root window relating to the current screen size: |
| 360 // size (as stored in |width_| and |height_|): _NET_DESKTOP_GEOMETRY, | 361 // _NET_DESKTOP_GEOMETRY, _NET_DESKTOP_VIEWPORT, and _NET_WORKAREA (by way of |
| 361 // _NET_DESKTOP_VIEWPORT, and _NET_WORKAREA (by way of calling | 362 // calling SetEwmhWorkareaProperty()). |
| 362 // SetEwmhWorkareaProperty()). | |
| 363 bool SetEwmhSizeProperties(); | 363 bool SetEwmhSizeProperties(); |
| 364 | 364 |
| 365 // Set the _NET_WORKAREA property on the root window to the screen area | 365 // Set the _NET_WORKAREA property on the root window to the screen area |
| 366 // minus space used by panel docks. | 366 // minus space used by panel docks. |
| 367 bool SetEwmhWorkareaProperty(); | 367 bool SetEwmhWorkareaProperty(); |
| 368 | 368 |
| 369 // Register all of our key bindings. Called by Init(). | 369 // Register all of our key bindings. Called by Init(). |
| 370 void RegisterKeyBindings(); | 370 void RegisterKeyBindings(); |
| 371 | 371 |
| 372 // Query the X server for all toplevel windows and start tracking (and | 372 // Query the X server for all toplevel windows and start tracking (and |
| 373 // possibly managing) them. | 373 // possibly managing) them. |
| 374 bool ManageExistingWindows(); | 374 bool ManageExistingWindows(); |
| 375 | 375 |
| 376 // Start tracking this window (more specifically, create a Window object | 376 // Start tracking this window (more specifically, create a Window object |
| 377 // for it and register it in |client_windows_|). Returns NULL for | 377 // for it and register it in |client_windows_|). Returns NULL for |
| 378 // windows that we specifically shouldn't track (e.g. the compositor's | 378 // windows that we specifically shouldn't track (e.g. the compositor's |
| 379 // stage or the compositing overlay window). | 379 // stage or the compositing overlay window). |
| 380 Window* TrackWindow(XWindow xid, bool override_redirect, | 380 Window* TrackWindow(XWindow xid, bool override_redirect, |
| 381 XConnection::WindowGeometry& geometry); | 381 XConnection::WindowGeometry& geometry); |
| 382 | 382 |
| 383 // Handle a window getting mapped. This is primarily used by | 383 // Handle a window getting mapped. This is primarily used by |
| 384 // HandleMapNotify(), but is abstracted out into a separate method so | 384 // HandleMapNotify(), but is abstracted out into a separate method so |
| 385 // that ManageExistingWindows() can also use it to handle windows that | 385 // that ManageExistingWindows() can also use it to handle windows that |
| 386 // were already mapped when the WM started. | 386 // were already mapped when the WM started. |
| 387 void HandleMappedWindow(Window* win); | 387 void HandleMappedWindow(Window* win); |
| 388 | 388 |
| 389 // Handle the screen being resized. | 389 // Handle the screen being resized. |
| 390 void HandleScreenResize(int new_width, int new_height); | 390 void HandleScreenResize(const Size& new_size); |
| 391 | 391 |
| 392 // Set the WM_STATE property on a window. Per ICCCM 4.1.3.1, |state| can | 392 // Set the WM_STATE property on a window. Per ICCCM 4.1.3.1, |state| can |
| 393 // be 0 (WithdrawnState), 1 (NormalState), or 3 (IconicState). Per | 393 // be 0 (WithdrawnState), 1 (NormalState), or 3 (IconicState). Per |
| 394 // 4.1.4, IconicState means that the toplevel window isn't viewable, so | 394 // 4.1.4, IconicState means that the toplevel window isn't viewable, so |
| 395 // we should use NormalState even when drawing a scaled-down version of | 395 // we should use NormalState even when drawing a scaled-down version of |
| 396 // the window. | 396 // the window. |
| 397 bool SetWmStateProperty(XWindow xid, int state); | 397 bool SetWmStateProperty(XWindow xid, int state); |
| 398 | 398 |
| 399 // Update the _NET_CLIENT_LIST and _NET_CLIENT_LIST_STACKING properties | 399 // Update the _NET_CLIENT_LIST and _NET_CLIENT_LIST_STACKING properties |
| 400 // on the root window (as described in EWMH). | 400 // on the root window (as described in EWMH). |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 // chrome_watchdog_->SendPingToChrome(). | 458 // chrome_watchdog_->SendPingToChrome(). |
| 459 void PingChrome(); | 459 void PingChrome(); |
| 460 | 460 |
| 461 EventLoop* event_loop_; // not owned | 461 EventLoop* event_loop_; // not owned |
| 462 XConnection* xconn_; // not owned | 462 XConnection* xconn_; // not owned |
| 463 Compositor* compositor_; // not owned | 463 Compositor* compositor_; // not owned |
| 464 DBusInterface* dbus_; // not owned | 464 DBusInterface* dbus_; // not owned |
| 465 | 465 |
| 466 XWindow root_; | 466 XWindow root_; |
| 467 | 467 |
| 468 // Root window dimensions and depth. | 468 // Root window bounds and depth. |
| 469 int width_; | 469 Rect root_bounds_; |
| 470 int height_; | |
| 471 int root_depth_; | 470 int root_depth_; |
| 472 | 471 |
| 473 // Offscreen window that we just use for registering as the WM. | 472 // Offscreen window that we just use for registering as the WM. |
| 474 XWindow wm_xid_; | 473 XWindow wm_xid_; |
| 475 scoped_ptr<XConnection::WindowDestroyer> wm_xid_destroyer_; | 474 scoped_ptr<XConnection::WindowDestroyer> wm_xid_destroyer_; |
| 476 | 475 |
| 477 Compositor::StageActor* stage_; // not owned | 476 Compositor::StageActor* stage_; // not owned |
| 478 | 477 |
| 479 // Window containing the compositor's stage. | 478 // Window containing the compositor's stage. |
| 480 XWindow stage_xid_; | 479 XWindow stage_xid_; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 | 612 |
| 614 // Number of outstanding requests to force compositing. | 613 // Number of outstanding requests to force compositing. |
| 615 int num_compositing_requests_; | 614 int num_compositing_requests_; |
| 616 | 615 |
| 617 DISALLOW_COPY_AND_ASSIGN(WindowManager); | 616 DISALLOW_COPY_AND_ASSIGN(WindowManager); |
| 618 }; | 617 }; |
| 619 | 618 |
| 620 } // namespace window_manager | 619 } // namespace window_manager |
| 621 | 620 |
| 622 #endif // WINDOW_MANAGER_WINDOW_MANAGER_H_ | 621 #endif // WINDOW_MANAGER_WINDOW_MANAGER_H_ |
| OLD | NEW |