Class CanonicalWindowManagerPolicy¶
Defined in File canonical_window_manager.h
Inheritance Relationships¶
Base Type¶
public miral::WindowManagementPolicy
(Class WindowManagementPolicy)
Class Documentation¶
-
class CanonicalWindowManagerPolicy : public miral::WindowManagementPolicy¶
Widely accepted defaults for window management.
Public Functions
-
explicit CanonicalWindowManagerPolicy(WindowManagerTools const &tools)¶
-
virtual auto place_new_window(ApplicationInfo const &app_info, WindowSpecification const &request_parameters) -> WindowSpecification override¶
Given the
app_info
andrequested_specification
, this method returns a new miral::WindowSpecification that defines how the new window should be placed.This method is called before advise_new_window.
- Parameters:
app_info – the application requesting a new window
requested_specification – the requested specification with a default position and size
- Returns:
the customized placement
-
virtual void handle_window_ready(WindowInfo &window_info) override¶
Tries to focus on the newly ready window.
-
virtual void handle_modify_window(WindowInfo &window_info, WindowSpecification const &modifications) override¶
Applies the requested modifications.
-
virtual void handle_raise_window(WindowInfo &window_info) override¶
Tries to focus on the newly ready window.
-
virtual void advise_focus_gained(WindowInfo const &info) override¶
Raises the window (and any children)
-
virtual auto confirm_inherited_move(WindowInfo const &window_info, Displacement movement) -> Rectangle override¶
Move the child window with the parent.
-
virtual 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.
This is called when placing a fullscreen, maximized, horizontally maximized, and vertically maximized window to allow adjustment for decorations.
If the author wishes to do nothing in response, they may simply return
new_placement
.- Parameters:
window_info – the window
new_state – the new state
new_placement – the suggested placement
- Returns:
the final placement
Protected Attributes
-
WindowManagerTools tools¶
-
explicit CanonicalWindowManagerPolicy(WindowManagerTools const &tools)¶