diff --git a/src/api/settings.rs b/src/api/settings.rs index 3573243..81dea11 100644 --- a/src/api/settings.rs +++ b/src/api/settings.rs @@ -132,3 +132,13 @@ unsafe extern "C" fn settings_get_snap_distance() -> c_uint { unsafe extern "C" fn settings_set_snap_distance(value: c_uint) { SETTINGS.unwrap().snap_distance_set(value); } + +#[no_mangle] +unsafe extern "C" fn settings_get_swallow_floatting() -> bool { + SETTINGS.unwrap().swallow_floating() +} + +#[no_mangle] +unsafe extern "C" fn settings_set_swallow_floating(value: bool) { + SETTINGS.unwrap().swallow_floating_set(value); +} diff --git a/src/settings.c b/src/settings.c index a4054fa..d40eb34 100644 --- a/src/settings.c +++ b/src/settings.c @@ -6,7 +6,6 @@ static SettingsForSingleWindow border_for_single_window = SETTINGS_FOR_SINGLE_WI static SettingsForSingleWindow gap_for_single_window = SETTINGS_FOR_SINGLE_WINDOW_NOBODY_IS_FULLSCREEN; static UnitKind master_area_factor_per_unit = UNIT_MONITOR; static UnitKind show_bar_per_unit = UNIT_MONITOR; -static bool swallow_floating = false; SettingsForSingleWindow settings_get_border_for_single_window() { @@ -51,13 +50,3 @@ void settings_set_show_bar_per_unit(const UnitKind new_show_bar_per_unit) show_bar_per_unit = new_show_bar_per_unit; // TODO: notify WM to rearrange clients } - -bool settings_get_swallow_floating() -{ - return swallow_floating; -} - -void settings_set_swallow_floating(const bool new_swallow_floating) -{ - swallow_floating = new_swallow_floating; -} diff --git a/src/settings.rs b/src/settings.rs index 6891454..1cc1b55 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -15,6 +15,7 @@ pub struct Settings { respect_resize_hints_in_floating_layout: bool, show_bar_by_default: bool, snap_distance: c_uint, + swallow_floating: bool, } impl Default for Settings { @@ -31,6 +32,7 @@ impl Default for Settings { respect_resize_hints_in_floating_layout: false, show_bar_by_default: true, snap_distance: 32, + swallow_floating: false, } } } @@ -130,4 +132,12 @@ impl Settings { pub fn snap_distance_set(&mut self, value: c_uint) { self.snap_distance = constraints::snap_distance(value); } + + pub fn swallow_floating(&self) -> bool { + self.swallow_floating + } + + pub fn swallow_floating_set(&mut self, value: bool) { + self.swallow_floating = value; + } }