diff --git a/.run/Run AquariWM (Wayland).run.xml b/.run/Run AquariWM (Wayland).run.xml
new file mode 100644
index 0000000..44bc9e9
--- /dev/null
+++ b/.run/Run AquariWM (Wayland).run.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.run/Run AquariWM (X11).run.xml b/.run/Run AquariWM (X11).run.xml
new file mode 100644
index 0000000..75fe281
--- /dev/null
+++ b/.run/Run AquariWM (X11).run.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/cli.rs b/src/cli.rs
index d5d9e9d..4e7cb06 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -16,6 +16,10 @@ pub struct Cli {
#[arg(long = "no-testing", alias = "no-test", overrides_with = "testing")]
pub no_testing: bool,
+ #[arg(long = "window-gap", alias = "gap")]
+ /// The gap between windows in a tiling layout.
+ pub window_gap: Option,
+
#[command(subcommand)]
pub subcommand: Subcommand,
}
diff --git a/src/display_server.rs b/src/display_server.rs
index 6197882..3d0b4db 100644
--- a/src/display_server.rs
+++ b/src/display_server.rs
@@ -9,6 +9,8 @@ pub use wayland::Wayland;
#[cfg(feature = "x11")]
pub use x11::X11;
+use crate::layout::LayoutSettings;
+
#[cfg(feature = "wayland")]
pub mod wayland;
#[cfg(feature = "x11")]
@@ -24,7 +26,7 @@ pub trait DisplayServer {
const NAME: &'static str;
/// Runs the AquariWM implementation for this display server.
- fn run(testing: bool) -> Self::Output;
+ fn run(testing: bool, settings: LayoutSettings) -> Self::Output;
/// Returns AquariWM's title, formatted with the display server [`NAME`].
///
diff --git a/src/display_server/wayland.rs b/src/display_server/wayland.rs
index 0a5a4c7..577dfe1 100644
--- a/src/display_server/wayland.rs
+++ b/src/display_server/wayland.rs
@@ -24,7 +24,10 @@ use smithay::{
use thiserror::Error;
use tracing::{event, span, Level};
-use crate::display_server::{DisplayServer, SyncDisplayServer};
+use crate::{
+ display_server::{DisplayServer, SyncDisplayServer},
+ layout::LayoutSettings,
+};
pub mod grabs;
mod input;
@@ -62,14 +65,14 @@ impl DisplayServer for Wayland {
type Output = Result<(), Error>;
const NAME: &'static str = "Wayland";
- fn run(testing: bool) -> Result<(), Error> {
+ fn run(testing: bool, settings: LayoutSettings) -> Result<(), Error> {
// Log initialisation.
let init_span = span!(Level::INFO, "Initialising").entered();
// Create an event loop for the compositor to run with.
let mut event_loop = >::try_new()?;
// Initialise the AquariWM state.
- let mut state = state::WaylandState::new(Display::new()?, &mut event_loop);
+ let mut state = state::WaylandState::new(Display::new()?, &mut event_loop, settings);
// Init winit for testing if the testing feature is enabled.
#[cfg(feature = "testing")]
diff --git a/src/display_server/wayland/state.rs b/src/display_server/wayland/state.rs
index 3f790a1..23386ed 100644
--- a/src/display_server/wayland/state.rs
+++ b/src/display_server/wayland/state.rs
@@ -292,7 +292,7 @@ delegate_shm!(WaylandState);
// }}}
impl WaylandState {
- pub fn new(display: Display, event_loop: &mut EventLoop) -> Self {
+ pub fn new(display: Display, event_loop: &mut EventLoop, settings: LayoutSettings) -> Self {
let start_time = time::Instant::now();
let display_handle = display.handle();
@@ -319,7 +319,7 @@ impl WaylandState {
space: Space::default(),
loop_signal: event_loop.get_signal(),
- aquariwm_state: crate::state::AquariWm::new(LayoutSettings::default()),
+ aquariwm_state: crate::state::AquariWm::new(settings),
// A whole bunch of Smithay-related state.
compositor_state: CompositorState::new::(&display_handle),
diff --git a/src/display_server/x11.rs b/src/display_server/x11.rs
index c15cae4..9dd6d9f 100644
--- a/src/display_server/x11.rs
+++ b/src/display_server/x11.rs
@@ -83,7 +83,7 @@ impl DisplayServer for X11 {
type Output = impl Future