pub struct FocusManager<H: Handle> {
pub workspace_history: VecDeque<usize>,
pub window_history: VecDeque<Option<WindowHandle<H>>>,
pub tag_history: VecDeque<TagId>,
pub tags_last_window: HashMap<TagId, WindowHandle<H>>,
pub last_mouse_position: Option<(i32, i32)>,
pub behaviour: FocusBehaviour,
pub focus_new_windows: bool,
pub sloppy_mouse_follows_focus: bool,
pub create_follows_cursor: bool,
}
Expand description
FocusManager
stores the history of which workspaces, tags, and windows had focus.
Fields§
§workspace_history: VecDeque<usize>
§window_history: VecDeque<Option<WindowHandle<H>>>
§tag_history: VecDeque<TagId>
§last_mouse_position: Option<(i32, i32)>
§behaviour: FocusBehaviour
§focus_new_windows: bool
§sloppy_mouse_follows_focus: bool
§create_follows_cursor: bool
Implementations§
Source§impl<H: Handle> FocusManager<H>
impl<H: Handle> FocusManager<H>
pub fn new(config: &impl Config) -> Self
Sourcepub fn workspace<'a, 'b>(
&self,
workspaces: &'a [Workspace],
) -> Option<&'b Workspace>where
'a: 'b,
pub fn workspace<'a, 'b>(
&self,
workspaces: &'a [Workspace],
) -> Option<&'b Workspace>where
'a: 'b,
Return the currently focused workspace.
Sourcepub fn workspace_mut<'a, 'b>(
&self,
workspaces: &'a mut [Workspace],
) -> Option<&'b mut Workspace>where
'a: 'b,
pub fn workspace_mut<'a, 'b>(
&self,
workspaces: &'a mut [Workspace],
) -> Option<&'b mut Workspace>where
'a: 'b,
Return the currently focused workspace.
Sourcepub fn tag(&self, offset: usize) -> Option<TagId>
pub fn tag(&self, offset: usize) -> Option<TagId>
Return the currently focused tag if the offset is 0. Offset is used to reach further down the history.
Sourcepub fn window<'a, 'b>(&self, windows: &'a [Window<H>]) -> Option<&'b Window<H>>where
'a: 'b,
pub fn window<'a, 'b>(&self, windows: &'a [Window<H>]) -> Option<&'b Window<H>>where
'a: 'b,
Return the currently focused window.
Sourcepub fn window_mut<'a, 'b>(
&self,
windows: &'a mut [Window<H>],
) -> Option<&'b mut Window<H>>where
'a: 'b,
pub fn window_mut<'a, 'b>(
&self,
windows: &'a mut [Window<H>],
) -> Option<&'b mut Window<H>>where
'a: 'b,
Return the currently focused window.
pub fn create_follows_cursor(&self) -> bool
Trait Implementations§
Source§impl<H: Clone + Handle> Clone for FocusManager<H>
impl<H: Clone + Handle> Clone for FocusManager<H>
Source§fn clone(&self) -> FocusManager<H>
fn clone(&self) -> FocusManager<H>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'de, H: Handle> Deserialize<'de> for FocusManager<H>
impl<'de, H: Handle> Deserialize<'de> for FocusManager<H>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<H> Freeze for FocusManager<H>
impl<H> RefUnwindSafe for FocusManager<H>where
H: RefUnwindSafe,
impl<H> Send for FocusManager<H>
impl<H> Sync for FocusManager<H>where
H: Sync,
impl<H> Unpin for FocusManager<H>where
H: Unpin,
impl<H> UnwindSafe for FocusManager<H>where
H: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more