2
* Copyright © 2017 Canonical Ltd.
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 3,
6
* as published by the Free Software Foundation.
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.
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/>.
16
* Authored by: Alan Griffiths <alan@octopull.co.uk>
19
#ifndef MIRAL_WINDOW_MANAGEMENT_POLICY_ADDENDUM3_H
20
#define MIRAL_WINDOW_MANAGEMENT_POLICY_ADDENDUM3_H
22
#include <mir_toolkit/client_types.h>
24
#include <mir/geometry/rectangles.h>
25
#include <mir_toolkit/mir_version_number.h>
29
using namespace mir::geometry;
33
* Handle additional client requests.
35
* \note This interface is intended to be implemented by a WindowManagementPolicy
36
* implementation, we can't add these functions directly to that interface without
37
* breaking ABI (the vtab could be incompatible).
38
* When initializing the window manager this interface will be detected by
39
* dynamic_cast and registered accordingly.
41
class WindowManagementPolicyAddendum3
44
/** Confirm (and optionally adjust) the placement of a window on the display.
45
* Called when (re)placing fullscreen, maximized, horizontally maximised and
46
* vertically maximized windows to allow adjustment for decorations.
48
* @param window_info the window
49
* @param new_placement the suggested placement
51
* @return the confirmed placement of the window
53
virtual auto confirm_placement_on_display(
54
WindowInfo const& window_info,
55
MirWindowState new_state,
56
Rectangle const& new_placement) -> Rectangle = 0;
58
virtual ~WindowManagementPolicyAddendum3() = default;
59
WindowManagementPolicyAddendum3() = default;
60
WindowManagementPolicyAddendum3(WindowManagementPolicyAddendum3 const&) = delete;
61
WindowManagementPolicyAddendum3& operator=(WindowManagementPolicyAddendum3 const&) = delete;
63
#if MIRAL_VERSION >= MIR_VERSION_NUMBER(2, 0, 0)
64
#error "We've presumably broken ABI - please roll this interface into WindowManagementPolicy"
68
#endif //MIRAL_WINDOW_MANAGEMENT_POLICY_ADDENDUM3_H