1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
use crate::config::Keybind;
use crate::models::Window;
use crate::models::WindowHandle;
use crate::models::WindowState;
use serde::{Deserialize, Serialize};
/// These are responses from the Window manager.
/// The display server should act on these actions.
#[allow(clippy::large_enum_variant)]
#[derive(Serialize, Deserialize, Clone, Debug)]
pub enum DisplayAction {
/// Nicely ask a window if it would please close at its convenience.
KillWindow(WindowHandle),
/// Get triggered after a new window is discovered and WE are
/// managing it.
AddedWindow(WindowHandle, bool),
/// Makes sure the mouse is over a given window.
MoveMouseOver(WindowHandle),
/// Makes sure the mouse is over a given point.
MoveMouseOverPoint((i32, i32)),
/// Change a windows state.
SetState(WindowHandle, bool, WindowState),
/// Sets the "z-index" order of the windows
/// first in the array is top most
SetWindowOrder(Vec<WindowHandle>),
/// Tell the DS we no longer care about the this window and other
/// cleanup.
DestroyedWindow(WindowHandle),
/// Tell a window that it is to become focused.
WindowTakeFocus(Window),
/// Remove focus on any visible window by focusing the root window
Unfocus,
/// To the window under the cursor to take the focus
FocusWindowUnderCursor,
/// Tell the DM we are going to resize a window and only send that
/// type of events.
StartResizingWindow(WindowHandle),
/// Tell the DM we are going to move a window and only send that
/// type of events.
StartMovingWindow(WindowHandle),
/// Used to let the WM know of the current displayed tag changes.
SetCurrentTags(String),
/// Used to let the WM know of the tag for a given window.
SetWindowTags(WindowHandle, String),
/// Tell the DM to return to normal mode if it is not (ie resize a
/// window or moving a window).
NormalMode,
/// SoftReload keygrabs, needed when keyboard changes
ReloadKeyGrabs(Vec<Keybind>),
}