Mir
canonical_window_manager.h
Go to the documentation of this file.
1/*
2 * Copyright © Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 or 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef MIRAL_CANONICAL_WINDOW_MANAGER_H_
18#define MIRAL_CANONICAL_WINDOW_MANAGER_H_
19
20#include <miral/window_management_policy.h>
21#include <miral/window_manager_tools.h>
22
23namespace miral
24{
25/// Widely accepted defaults for window management
27{
28public:
29
31
32 virtual auto place_new_window(
33 ApplicationInfo const& app_info,
34 WindowSpecification const& request_parameters)
35 -> WindowSpecification override;
36
37 /// Tries to focus on the newly ready window
38 void handle_window_ready(WindowInfo& window_info) override;
39
40 /// Applies the requested modifications
41 void handle_modify_window(WindowInfo& window_info, WindowSpecification const& modifications) override;
42
43 /// Tries to focus on the newly ready window
44 void handle_raise_window(WindowInfo& window_info) override;
45
46 /// request from client to initiate drag and drop
47 /// \note this is a legacy of Unity8's content-hub and should probably be ignored going forward
48 void handle_request_drag_and_drop(WindowInfo& window_info) override;
49
50 /// Raises the window (and any children)
51 void advise_focus_gained(WindowInfo const& info) override;
52
53 /// Move the child window with the parent
54 auto confirm_inherited_move(WindowInfo const& window_info, Displacement movement) -> Rectangle override;
55
57 WindowInfo const& window_info,
58 MirWindowState new_state,
59 Rectangle const& new_placement) -> Rectangle override;
60
61protected:
63};
64}
65
66#endif /* MIRAL_CANONICAL_WINDOW_MANAGER_H_ */
Widely accepted defaults for window management.
Definition: canonical_window_manager.h:27
WindowManagerTools tools
Definition: canonical_window_manager.h:62
CanonicalWindowManagerPolicy(WindowManagerTools const &tools)
auto confirm_placement_on_display(WindowInfo const &window_info, MirWindowState new_state, Rectangle const &new_placement) -> Rectangle override
Confirm (and optionally adjust) the placement of a window on the display.
void handle_request_drag_and_drop(WindowInfo &window_info) override
request from client to initiate drag and drop
virtual auto place_new_window(ApplicationInfo const &app_info, WindowSpecification const &request_parameters) -> WindowSpecification override
Customize initial window placement.
void advise_focus_gained(WindowInfo const &info) override
Raises the window (and any children)
void handle_modify_window(WindowInfo &window_info, WindowSpecification const &modifications) override
Applies the requested modifications.
void handle_raise_window(WindowInfo &window_info) override
Tries to focus on the newly ready window.
auto confirm_inherited_move(WindowInfo const &window_info, Displacement movement) -> Rectangle override
Move the child window with the parent.
void handle_window_ready(WindowInfo &window_info) override
Tries to focus on the newly ready window.
The interface through which the window management policy is determined.
Definition: window_management_policy.h:50
Window management functions for querying and updating MirAL's model.
Definition: window_manager_tools.h:58
Definition: window_specification.h:42
Mir Abstraction Layer.
Definition: runner.h:35
Definition: application_info.h:30
Definition: window_info.h:31

Copyright © 2012-2023 Canonical Ltd.
Generated on Tue 2 May 10:01:24 UTC 2023
This documentation is licensed under the GPL version 2 or 3.