Class CanonicalWindowManagerPolicy

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class CanonicalWindowManagerPolicy : public miral::WindowManagementPolicy

Widely accepted defaults for window management.

Subclassed by KioskWindowManagerPolicy

Public Functions

explicit CanonicalWindowManagerPolicy(WindowManagerTools const &tools)
virtual auto place_new_window(ApplicationInfo const &app_info, WindowSpecification const &request_parameters) -> WindowSpecification override

Customize initial window placement.

Parameters:
  • app_info – the application requesting a new window

  • requested_specification – the requested specification (updated with default placement)

Returns:

the customized specification

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.

Called when (re)placing fullscreen, maximized, horizontally maximised and vertically maximized windows to allow adjustment for decorations.

Parameters:
  • window_info – the window

  • new_state – the new state

  • new_placement – the suggested placement

Returns:

the confirmed placement of the window

Protected Attributes

WindowManagerTools tools