Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@ pub enum FullscreenType {
NoParam,
}

/// This enum holds the params to the [DispatchType::ToggleFullscreenState] dispatcher
#[allow(missing_docs)]
#[derive(Debug, Clone, Copy)]
pub enum FullscreenState {
Current = -1,
None = 0,
Maximize = 1,
Fullscreen = 2,
MaximizeFullscreen = 3,
}

impl std::fmt::Display for FullscreenState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", *self as u8)
}
}

/// This enum holds directions, typically used for moving
#[derive(Debug, Clone, Display)]
#[allow(missing_docs)]
Expand Down Expand Up @@ -409,6 +426,8 @@ pub enum DispatchType<'a> {
ToggleFloating(Option<WindowIdentifier<'a>>),
/// This dispatcher toggles the current window fullscreen state
ToggleFullscreen(FullscreenType),
/// This dispatcher sets the focused window’s fullscreen mode and the one sent to the client
ToggleFullscreenState(FullscreenState, FullscreenState),
/// This dispatcher toggles the focused window’s internal
/// fullscreen state without altering the geometry
ToggleFakeFullscreen,
Expand Down Expand Up @@ -654,6 +673,7 @@ pub(crate) fn gen_dispatch_str(cmd: DispatchType, dispatch: bool) -> crate::Resu
ToggleFloating(Some(v)) => format!("togglefloating{sep}{v}"),
ToggleFloating(None) => "togglefloating".to_string(),
ToggleFullscreen(ftype) => format!("fullscreen{sep}{ftype}"),
ToggleFullscreenState(int, cl) => format!("fullscreenstate{sep}{int} {cl}"),
ToggleFakeFullscreen => "fakefullscreen".to_string(),
ToggleDPMS(stat, mon) => {
format!(
Expand Down