Mir
Public Member Functions | List of all members
miral::WindowManagementPolicy Class Referenceabstract

The interface through which the window management policy is determined. More...

#include <window_management_policy.h>

Inheritance diagram for miral::WindowManagementPolicy:
[legend]

Public Member Functions

virtual void advise_begin ()
 before any related calls begin More...
 
virtual void advise_end ()
 after any related calls end More...
 
virtual auto place_new_window (ApplicationInfo const &app_info, WindowSpecification const &requested_specification) -> WindowSpecification=0
 Customize initial window placement. More...
 
virtual auto confirm_inherited_move (WindowInfo const &window_info, Displacement movement) -> Rectangle=0
 Confirm (and optionally adjust) the motion of a child window when the parent is moved. More...
 
virtual ~WindowManagementPolicy ()=default
 
 WindowManagementPolicy ()=default
 
 WindowManagementPolicy (WindowManagementPolicy const &)=delete
 
WindowManagementPolicyoperator= (WindowManagementPolicy const &)=delete
 
handle events originating from the client

The policy is expected to update the model as appropriate

virtual void handle_window_ready (WindowInfo &window_info)=0
 notification that the first buffer has been posted More...
 
virtual void handle_modify_window (WindowInfo &window_info, WindowSpecification const &modifications)=0
 request from client to modify the window specification. More...
 
virtual void handle_raise_window (WindowInfo &window_info)=0
 request from client to raise the window More...
 
virtual auto confirm_placement_on_display (WindowInfo const &window_info, MirWindowState new_state, Rectangle const &new_placement) -> Rectangle=0
 Confirm (and optionally adjust) the placement of a window on the display. More...
 
handle events originating from user

The policy is expected to interpret (and optionally consume) the event

virtual bool handle_keyboard_event (MirKeyboardEvent const *event)=0
 keyboard event handler More...
 
virtual bool handle_touch_event (MirTouchEvent const *event)=0
 touch event handler More...
 
virtual bool handle_pointer_event (MirPointerEvent const *event)=0
 pointer event handler More...
 
notification of WM events that the policy may need to track.
virtual void advise_new_app (ApplicationInfo &application)
 Notification that a new application has connected. More...
 
virtual void advise_delete_app (ApplicationInfo const &application)
 Notification that an application has disconnected. More...
 
virtual void advise_new_window (WindowInfo const &window_info)
 Notification that a window has been created. More...
 
virtual void advise_focus_lost (WindowInfo const &window_info)
 Notification that a window has lost focus. More...
 
virtual void advise_focus_gained (WindowInfo const &window_info)
 Notification that a window has gained focus. More...
 
virtual void advise_state_change (WindowInfo const &window_info, MirWindowState state)
 Notification that a window is about to change state. More...
 
virtual void advise_move_to (WindowInfo const &window_info, Point top_left)
 Notification that a window is about to move. More...
 
virtual void advise_resize (WindowInfo const &window_info, Size const &new_size)
 Notification that a window is about to resize. More...
 
virtual void advise_delete_window (WindowInfo const &window_info)
 Notification that a window is about to be destroyed. More...
 
virtual void advise_raise (std::vector< Window > const &windows)
 Notification that windows are being raised to the top. More...
 
virtual void advise_adding_to_workspace (std::shared_ptr< Workspace > const &workspace, std::vector< Window > const &windows)
 Notification that windows are being added to a workspace. More...
 
virtual void advise_removing_from_workspace (std::shared_ptr< Workspace > const &workspace, std::vector< Window > const &windows)
 Notification that windows are being removed from a workspace. More...
 
handle requests originating from the client

The policy is expected to update the model as appropriate

virtual void handle_request_drag_and_drop (WindowInfo &window_info)=0
 request from client to initiate drag and drop More...
 
virtual void handle_request_move (WindowInfo &window_info, MirInputEvent const *input_event)=0
 request from client to initiate move More...
 
virtual void handle_request_resize (WindowInfo &window_info, MirInputEvent const *input_event, MirResizeEdge edge)=0
 request from client to initiate resize More...
 
notification of changes to the (connected, active) outputs.
virtual void advise_output_create (Output const &output)
 
virtual void advise_output_update (Output const &updated, Output const &original)
 
virtual void advise_output_delete (Output const &output)
 
notification of changes to the current application zones

An application zone is the area a maximized application will fill.

There is often (but not necessarily) one zone per output. The areas normal applications windows should avoid (such as the areas covered by panels) will not be part of an application zone

virtual void advise_application_zone_create (Zone const &application_zone)
 
virtual void advise_application_zone_update (Zone const &updated, Zone const &original)
 
virtual void advise_application_zone_delete (Zone const &application_zone)
 

Detailed Description

The interface through which the window management policy is determined.

Constructor & Destructor Documentation

◆ ~WindowManagementPolicy()

virtual miral::WindowManagementPolicy::~WindowManagementPolicy ( )
virtualdefault

◆ WindowManagementPolicy() [1/2]

miral::WindowManagementPolicy::WindowManagementPolicy ( )
default

◆ WindowManagementPolicy() [2/2]

miral::WindowManagementPolicy::WindowManagementPolicy ( WindowManagementPolicy const &  )
delete

Member Function Documentation

◆ advise_adding_to_workspace()

virtual void miral::WindowManagementPolicy::advise_adding_to_workspace ( std::shared_ptr< Workspace > const &  workspace,
std::vector< Window > const &  windows 
)
virtual

Notification that windows are being added to a workspace.

These windows are ordered with parents before children, and form a single tree rooted at the first element.

Parameters
workspacethe workspace
windowsthe windows

◆ advise_application_zone_create()

virtual void miral::WindowManagementPolicy::advise_application_zone_create ( Zone const &  application_zone)
virtual

◆ advise_application_zone_delete()

virtual void miral::WindowManagementPolicy::advise_application_zone_delete ( Zone const &  application_zone)
virtual

◆ advise_application_zone_update()

virtual void miral::WindowManagementPolicy::advise_application_zone_update ( Zone const &  updated,
Zone const &  original 
)
virtual

◆ advise_begin()

virtual void miral::WindowManagementPolicy::advise_begin ( )
virtual

before any related calls begin

◆ advise_delete_app()

virtual void miral::WindowManagementPolicy::advise_delete_app ( ApplicationInfo const &  application)
virtual

Notification that an application has disconnected.

Parameters
applicationthe application

Reimplemented in TilingWindowManagerPolicy.

◆ advise_delete_window()

virtual void miral::WindowManagementPolicy::advise_delete_window ( WindowInfo const &  window_info)
virtual

Notification that a window is about to be destroyed.

Parameters
window_infothe window

◆ advise_end()

virtual void miral::WindowManagementPolicy::advise_end ( )
virtual

after any related calls end

Reimplemented in TilingWindowManagerPolicy.

◆ advise_focus_gained()

virtual void miral::WindowManagementPolicy::advise_focus_gained ( WindowInfo const &  window_info)
virtual

Notification that a window has gained focus.

Parameters
window_infothe window

Reimplemented in miral::MinimalWindowManager, miral::CanonicalWindowManagerPolicy, FloatingWindowManagerPolicy, TilingWindowManagerPolicy, and KioskWindowManagerPolicy.

◆ advise_focus_lost()

virtual void miral::WindowManagementPolicy::advise_focus_lost ( WindowInfo const &  window_info)
virtual

Notification that a window has lost focus.

Parameters
window_infothe window

◆ advise_move_to()

virtual void miral::WindowManagementPolicy::advise_move_to ( WindowInfo const &  window_info,
Point  top_left 
)
virtual

Notification that a window is about to move.

Parameters
window_infothe window
top_leftthe new position

◆ advise_new_app()

virtual void miral::WindowManagementPolicy::advise_new_app ( ApplicationInfo application)
virtual

Notification that a new application has connected.

Parameters
applicationthe application

Reimplemented in TilingWindowManagerPolicy.

◆ advise_new_window()

virtual void miral::WindowManagementPolicy::advise_new_window ( WindowInfo const &  window_info)
virtual

Notification that a window has been created.

Parameters
window_infothe window

Reimplemented in TilingWindowManagerPolicy, and FloatingWindowManagerPolicy.

◆ advise_output_create()

virtual void miral::WindowManagementPolicy::advise_output_create ( Output const &  output)
virtual

◆ advise_output_delete()

virtual void miral::WindowManagementPolicy::advise_output_delete ( Output const &  output)
virtual

◆ advise_output_update()

virtual void miral::WindowManagementPolicy::advise_output_update ( Output const &  updated,
Output const &  original 
)
virtual

◆ advise_raise()

virtual void miral::WindowManagementPolicy::advise_raise ( std::vector< Window > const &  windows)
virtual

Notification that windows are being raised to the top.

These windows are ordered with parents before children, and form a single tree rooted at the first element.

Parameters
windowsthe windows
Note
The relative Z-order of these windows will be maintained, they will be raised en bloc.

◆ advise_removing_from_workspace()

virtual void miral::WindowManagementPolicy::advise_removing_from_workspace ( std::shared_ptr< Workspace > const &  workspace,
std::vector< Window > const &  windows 
)
virtual

Notification that windows are being removed from a workspace.

These windows are ordered with parents before children, and form a single tree rooted at the first element.

Parameters
workspacethe workspace
windowsthe windows

◆ advise_resize()

virtual void miral::WindowManagementPolicy::advise_resize ( WindowInfo const &  window_info,
Size const &  new_size 
)
virtual

Notification that a window is about to resize.

Parameters
window_infothe window
new_sizethe new size

◆ advise_state_change()

virtual void miral::WindowManagementPolicy::advise_state_change ( WindowInfo const &  window_info,
MirWindowState  state 
)
virtual

Notification that a window is about to change state.

Parameters
window_infothe window
statethe new state

◆ confirm_inherited_move()

virtual auto miral::WindowManagementPolicy::confirm_inherited_move ( WindowInfo const &  window_info,
Displacement  movement 
) -> Rectangle
pure virtual

Confirm (and optionally adjust) the motion of a child window when the parent is moved.

Parameters
window_infothe window
movementthe movement of the parent
Returns
the confirmed placement of the window

Implemented in miral::MinimalWindowManager, miral::CanonicalWindowManagerPolicy, and TilingWindowManagerPolicy.

◆ confirm_placement_on_display()

virtual auto miral::WindowManagementPolicy::confirm_placement_on_display ( WindowInfo const &  window_info,
MirWindowState  new_state,
Rectangle const &  new_placement 
) -> Rectangle
pure virtual

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_infothe window
new_statethe new state
new_placementthe suggested placement
Returns
the confirmed placement of the window

Implemented in miral::CanonicalWindowManagerPolicy, miral::MinimalWindowManager, TilingWindowManagerPolicy, and KioskWindowManagerPolicy.

◆ handle_keyboard_event()

virtual bool miral::WindowManagementPolicy::handle_keyboard_event ( MirKeyboardEvent const *  event)
pure virtual

keyboard event handler

Parameters
eventthe event
Returns
whether the policy has consumed the event

Implemented in FloatingWindowManagerPolicy, TilingWindowManagerPolicy, miral::MinimalWindowManager, and KioskWindowManagerPolicy.

◆ handle_modify_window()

virtual void miral::WindowManagementPolicy::handle_modify_window ( WindowInfo window_info,
WindowSpecification const &  modifications 
)
pure virtual

request from client to modify the window specification.

Note
the request has already been validated against the type definition
Parameters
window_infothe window
modificationsthe requested changes

Implemented in miral::MinimalWindowManager, miral::CanonicalWindowManagerPolicy, FloatingWindowManagerPolicy, TilingWindowManagerPolicy, and KioskWindowManagerPolicy.

◆ handle_pointer_event()

virtual bool miral::WindowManagementPolicy::handle_pointer_event ( MirPointerEvent const *  event)
pure virtual

pointer event handler

Parameters
eventthe event
Returns
whether the policy has consumed the event

Implemented in TilingWindowManagerPolicy, FloatingWindowManagerPolicy, miral::MinimalWindowManager, and KioskWindowManagerPolicy.

◆ handle_raise_window()

virtual void miral::WindowManagementPolicy::handle_raise_window ( WindowInfo window_info)
pure virtual

request from client to raise the window

Note
the request has already been validated against the requesting event
Parameters
window_infothe window

Implemented in miral::MinimalWindowManager, miral::CanonicalWindowManagerPolicy, and TilingWindowManagerPolicy.

◆ handle_request_drag_and_drop()

virtual void miral::WindowManagementPolicy::handle_request_drag_and_drop ( WindowInfo window_info)
pure virtual

request from client to initiate drag and drop

Note
the request has already been validated against the requesting event
Parameters
window_infothe window

Implemented in miral::MinimalWindowManager, miral::CanonicalWindowManagerPolicy, TilingWindowManagerPolicy, and KioskWindowManagerPolicy.

◆ handle_request_move()

virtual void miral::WindowManagementPolicy::handle_request_move ( WindowInfo window_info,
MirInputEvent const *  input_event 
)
pure virtual

request from client to initiate move

Note
the request has already been validated against the requesting event
Parameters
window_infothe window
input_eventthe requesting event

Implemented in miral::MinimalWindowManager, TilingWindowManagerPolicy, and KioskWindowManagerPolicy.

◆ handle_request_resize()

virtual void miral::WindowManagementPolicy::handle_request_resize ( WindowInfo window_info,
MirInputEvent const *  input_event,
MirResizeEdge  edge 
)
pure virtual

request from client to initiate resize

Note
the request has already been validated against the requesting event
Parameters
window_infothe window
input_eventthe requesting event
edgethe edge(s) being dragged

Implemented in miral::MinimalWindowManager, TilingWindowManagerPolicy, and KioskWindowManagerPolicy.

◆ handle_touch_event()

virtual bool miral::WindowManagementPolicy::handle_touch_event ( MirTouchEvent const *  event)
pure virtual

touch event handler

Parameters
eventthe event
Returns
whether the policy has consumed the event

Implemented in TilingWindowManagerPolicy, FloatingWindowManagerPolicy, miral::MinimalWindowManager, and KioskWindowManagerPolicy.

◆ handle_window_ready()

virtual void miral::WindowManagementPolicy::handle_window_ready ( WindowInfo window_info)
pure virtual

notification that the first buffer has been posted

Parameters
window_infothe window

Implemented in miral::MinimalWindowManager, miral::CanonicalWindowManagerPolicy, FloatingWindowManagerPolicy, and TilingWindowManagerPolicy.

◆ operator=()

WindowManagementPolicy& miral::WindowManagementPolicy::operator= ( WindowManagementPolicy const &  )
delete

◆ place_new_window()

virtual auto miral::WindowManagementPolicy::place_new_window ( ApplicationInfo const &  app_info,
WindowSpecification const &  requested_specification 
) -> WindowSpecification
pure virtual

Customize initial window placement.

Parameters
app_infothe application requesting a new window
requested_specificationthe requested specification (updated with default placement)
Returns
the customized specification

Implemented in FloatingWindowManagerPolicy, TilingWindowManagerPolicy, KioskWindowManagerPolicy, miral::MinimalWindowManager, and miral::CanonicalWindowManagerPolicy.


The documentation for this class was generated from the following file:

Copyright © 2012-2021 Canonical Ltd.
Generated on Wed Oct 6 15:21:46 UTC 2021
This documentation is licensed under the GPL version 2 or 3.