Mir
Public Member Functions | Protected Attributes | List of all members
miral::CanonicalWindowManagerPolicy Class Reference

Widely accepted defaults for window management. More...

#include <canonical_window_manager.h>

Inheritance diagram for miral::CanonicalWindowManagerPolicy:
[legend]

Public Member Functions

 CanonicalWindowManagerPolicy (WindowManagerTools const &tools)
 
virtual auto place_new_window (ApplicationInfo const &app_info, WindowSpecification const &request_parameters) -> WindowSpecification override
 Customize initial window placement. More...
 
void handle_window_ready (WindowInfo &window_info) override
 Tries to focus on the newly ready window. More...
 
void handle_modify_window (WindowInfo &window_info, WindowSpecification const &modifications) override
 Applies the requested modifications. More...
 
void handle_raise_window (WindowInfo &window_info) override
 Tries to focus on the newly ready window. More...
 
void handle_request_drag_and_drop (WindowInfo &window_info) override
 request from client to initiate drag and drop More...
 
void advise_focus_gained (WindowInfo const &info) override
 Raises the window (and any children) More...
 
auto confirm_inherited_move (WindowInfo const &window_info, Displacement movement) -> Rectangle override
 Move the child window with the parent. More...
 
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. More...
 
- Public Member Functions inherited from miral::WindowManagementPolicy
virtual void advise_begin ()
 before any related calls begin More...
 
virtual void advise_end ()
 after any related calls end More...
 
virtual ~WindowManagementPolicy ()=default
 
 WindowManagementPolicy ()=default
 
 WindowManagementPolicy (WindowManagementPolicy const &)=delete
 
WindowManagementPolicyoperator= (WindowManagementPolicy const &)=delete
 
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...
 
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_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...
 
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...
 
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)
 
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)
 

Protected Attributes

WindowManagerTools tools
 

Detailed Description

Widely accepted defaults for window management.

Constructor & Destructor Documentation

◆ CanonicalWindowManagerPolicy()

miral::CanonicalWindowManagerPolicy::CanonicalWindowManagerPolicy ( WindowManagerTools const &  tools)
explicit

Member Function Documentation

◆ advise_focus_gained()

void miral::CanonicalWindowManagerPolicy::advise_focus_gained ( WindowInfo const &  info)
overridevirtual

Raises the window (and any children)

Reimplemented from miral::WindowManagementPolicy.

◆ confirm_inherited_move()

auto miral::CanonicalWindowManagerPolicy::confirm_inherited_move ( WindowInfo const &  window_info,
Displacement  movement 
) -> Rectangle
overridevirtual

Move the child window with the parent.

Implements miral::WindowManagementPolicy.

◆ confirm_placement_on_display()

auto miral::CanonicalWindowManagerPolicy::confirm_placement_on_display ( WindowInfo const &  window_info,
MirWindowState  new_state,
Rectangle const &  new_placement 
) -> Rectangle
overridevirtual

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

Implements miral::WindowManagementPolicy.

◆ handle_modify_window()

void miral::CanonicalWindowManagerPolicy::handle_modify_window ( WindowInfo window_info,
WindowSpecification const &  modifications 
)
overridevirtual

Applies the requested modifications.

Implements miral::WindowManagementPolicy.

◆ handle_raise_window()

void miral::CanonicalWindowManagerPolicy::handle_raise_window ( WindowInfo window_info)
overridevirtual

Tries to focus on the newly ready window.

Implements miral::WindowManagementPolicy.

◆ handle_request_drag_and_drop()

void miral::CanonicalWindowManagerPolicy::handle_request_drag_and_drop ( WindowInfo window_info)
overridevirtual

request from client to initiate drag and drop

Note
this is a legacy of Unity8's content-hub and should probably be ignored going forward

Implements miral::WindowManagementPolicy.

◆ handle_window_ready()

void miral::CanonicalWindowManagerPolicy::handle_window_ready ( WindowInfo window_info)
overridevirtual

Tries to focus on the newly ready window.

Implements miral::WindowManagementPolicy.

◆ place_new_window()

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

Customize initial window placement.

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

Implements miral::WindowManagementPolicy.

Reimplemented in KioskWindowManagerPolicy.

Member Data Documentation

◆ tools

WindowManagerTools miral::CanonicalWindowManagerPolicy::tools
protected

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

Copyright © 2012-2022 Canonical Ltd.
Generated on śro, 1 cze 2022, 16:52:55 UTC
This documentation is licensed under the GPL version 2 or 3.