Mir
Public Member Functions | Static Protected Attributes | List of all members
FloatingWindowManagerPolicy Class Reference

#include <floating_window_manager.h>

Inheritance diagram for FloatingWindowManagerPolicy:
[legend]

Public Member Functions

 FloatingWindowManagerPolicy (miral::WindowManagerTools const &tools, std::shared_ptr< SplashSession > const &spinner, miral::InternalClientLauncher const &launcher, std::function< void()> &shutdown_hook)
 
 ~FloatingWindowManagerPolicy ()
 
virtual miral::WindowSpecification place_new_window (miral::ApplicationInfo const &app_info, miral::WindowSpecification const &request_parameters) override
 Customize initial window placement. More...
 
example event handling:

o Switch apps: Alt+Tab, tap or click on the corresponding window o Switch window: Alt+`, tap or click on the corresponding window o Move window: Alt-leftmousebutton drag (three finger drag) o Resize window: Alt-middle_button drag (three finger pinch) o Maximize/restore current window (to display size): Alt-F11 o Maximize/restore current window (to display height): Shift-F11 o Maximize/restore current window (to display width): Ctrl-F11 o Switch workspace .

. . . . . . . . . : Meta-Alt-[F1|F2|F3|F4] o Switch workspace taking active window: Meta-Ctrl-[F1|F2|F3|F4]

bool handle_pointer_event (MirPointerEvent const *event) override
 pointer event handler More...
 
bool handle_touch_event (MirTouchEvent const *event) override
 touch event handler More...
 
bool handle_keyboard_event (MirKeyboardEvent const *event) override
 keyboard event handler More...
 
track events that affect titlebar
void advise_new_window (miral::WindowInfo const &window_info) override
 Notification that a window has been created. More...
 
void handle_window_ready (miral::WindowInfo &window_info) override
 notification that the first buffer has been posted More...
 
void advise_focus_lost (miral::WindowInfo const &info) override
 Notification that a window has lost focus. More...
 
void advise_focus_gained (miral::WindowInfo const &info) override
 Notification that a window has gained focus. More...
 
void advise_state_change (miral::WindowInfo const &window_info, MirWindowState state) override
 Notification that a window is about to change state. More...
 
void advise_resize (miral::WindowInfo const &window_info, Size const &new_size) override
 Notification that a window is about to resize. More...
 
void advise_delete_window (miral::WindowInfo const &window_info) override
 Notification that a window is about to be destroyed. More...
 
void handle_modify_window (miral::WindowInfo &window_info, miral::WindowSpecification const &modifications) override
 request from client to modify the window specification. More...
 
support for CSD invoked sizing and movement
void handle_request_drag_and_drop (miral::WindowInfo &window_info) override
 request from client to initiate drag and drop More...
 
void handle_request_move (miral::WindowInfo &window_info, MirInputEvent const *input_event) override
 request from client to initiate move More...
 
void handle_request_resize (miral::WindowInfo &window_info, MirInputEvent const *input_event, MirResizeEdge edge) override
 request from client to initiate resize More...
 
- Public Member Functions inherited from miral::CanonicalWindowManagerPolicy
 CanonicalWindowManagerPolicy (WindowManagerTools const &tools)
 
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 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_move_to (WindowInfo const &window_info, Point top_left)
 Notification that a window is about to move. 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 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)
 

Static Protected Attributes

static const int modifier_mask
 

Additional Inherited Members

- Protected Attributes inherited from miral::CanonicalWindowManagerPolicy
WindowManagerTools tools
 

Constructor & Destructor Documentation

◆ FloatingWindowManagerPolicy()

FloatingWindowManagerPolicy::FloatingWindowManagerPolicy ( miral::WindowManagerTools const &  tools,
std::shared_ptr< SplashSession > const &  spinner,
miral::InternalClientLauncher const &  launcher,
std::function< void()> &  shutdown_hook 
)

◆ ~FloatingWindowManagerPolicy()

FloatingWindowManagerPolicy::~FloatingWindowManagerPolicy ( )
default

Member Function Documentation

◆ advise_delete_window()

void FloatingWindowManagerPolicy::advise_delete_window ( miral::WindowInfo const &  window_info)
overridevirtual

Notification that a window is about to be destroyed.

Parameters
window_infothe window

Reimplemented from miral::WindowManagementPolicy.

◆ advise_focus_gained()

void FloatingWindowManagerPolicy::advise_focus_gained ( miral::WindowInfo const &  window_info)
overridevirtual

Notification that a window has gained focus.

Parameters
window_infothe window

Reimplemented from miral::WindowManagementPolicy.

◆ advise_focus_lost()

void FloatingWindowManagerPolicy::advise_focus_lost ( miral::WindowInfo const &  window_info)
overridevirtual

Notification that a window has lost focus.

Parameters
window_infothe window

Reimplemented from miral::WindowManagementPolicy.

◆ advise_new_window()

void FloatingWindowManagerPolicy::advise_new_window ( miral::WindowInfo const &  window_info)
overridevirtual

Notification that a window has been created.

Parameters
window_infothe window

Reimplemented from miral::WindowManagementPolicy.

◆ advise_resize()

void FloatingWindowManagerPolicy::advise_resize ( miral::WindowInfo const &  window_info,
Size const &  new_size 
)
overridevirtual

Notification that a window is about to resize.

Parameters
window_infothe window
new_sizethe new size

Reimplemented from miral::WindowManagementPolicy.

◆ advise_state_change()

void FloatingWindowManagerPolicy::advise_state_change ( miral::WindowInfo const &  window_info,
MirWindowState  state 
)
overridevirtual

Notification that a window is about to change state.

Parameters
window_infothe window
statethe new state

Reimplemented from miral::WindowManagementPolicy.

◆ handle_keyboard_event()

bool FloatingWindowManagerPolicy::handle_keyboard_event ( MirKeyboardEvent const *  event)
overridevirtual

keyboard event handler

Parameters
eventthe event
Returns
whether the policy has consumed the event

Implements miral::WindowManagementPolicy.

◆ handle_modify_window()

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

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

Implements miral::WindowManagementPolicy.

◆ handle_pointer_event()

bool FloatingWindowManagerPolicy::handle_pointer_event ( MirPointerEvent const *  event)
overridevirtual

pointer event handler

Parameters
eventthe event
Returns
whether the policy has consumed the event

Implements miral::WindowManagementPolicy.

◆ handle_request_drag_and_drop()

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

request from client to initiate drag and drop

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

Implements miral::WindowManagementPolicy.

◆ handle_request_move()

void FloatingWindowManagerPolicy::handle_request_move ( miral::WindowInfo window_info,
MirInputEvent const *  input_event 
)
overridevirtual

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

Implements miral::WindowManagementPolicy.

◆ handle_request_resize()

void FloatingWindowManagerPolicy::handle_request_resize ( miral::WindowInfo window_info,
MirInputEvent const *  input_event,
MirResizeEdge  edge 
)
overridevirtual

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

Implements miral::WindowManagementPolicy.

◆ handle_touch_event()

bool FloatingWindowManagerPolicy::handle_touch_event ( MirTouchEvent const *  event)
overridevirtual

touch event handler

Parameters
eventthe event
Returns
whether the policy has consumed the event

Implements miral::WindowManagementPolicy.

◆ handle_window_ready()

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

notification that the first buffer has been posted

Parameters
window_infothe window

Implements miral::WindowManagementPolicy.

◆ place_new_window()

WindowSpecification FloatingWindowManagerPolicy::place_new_window ( miral::ApplicationInfo const &  app_info,
miral::WindowSpecification const &  requested_specification 
)
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

Reimplemented from miral::CanonicalWindowManagerPolicy.

Member Data Documentation

◆ modifier_mask

const int FloatingWindowManagerPolicy::modifier_mask
staticprotected

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

Copyright © 2012-2018 Canonical Ltd.
Generated on Thu 12 Jul 10:49:10 UTC 2018