Compare commits
	
		
			2 commits
		
	
	
		
			6f66d11503
			...
			4fdc0d90e4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
							 | 
						4fdc0d90e4 | ||
| 
							 | 
						290a278919 | 
					 5 changed files with 30 additions and 20 deletions
				
			
		| 
						 | 
				
			
			@ -9,13 +9,6 @@ extern "C" fn constraints_master_area_factor(
 | 
			
		|||
    constraints::master_area_factor(master_area_factor)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[no_mangle]
 | 
			
		||||
extern "C" fn constraints_max_clients_in_master(
 | 
			
		||||
    max_clients_in_master: c_int,
 | 
			
		||||
) -> c_int {
 | 
			
		||||
    constraints::max_clients_in_master(max_clients_in_master)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[no_mangle]
 | 
			
		||||
extern "C" fn constraints_snap_distance(snap_distance: c_uint) -> c_uint {
 | 
			
		||||
    constraints::snap_distance(snap_distance)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -80,3 +80,20 @@ unsafe extern "C" fn settings_get_gap_size() -> c_int {
 | 
			
		|||
unsafe extern "C" fn settings_set_gap_size(value: c_int) {
 | 
			
		||||
    SETTINGS.unwrap().gap_size_set(value);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[no_mangle]
 | 
			
		||||
unsafe extern "C" fn settings_get_max_clients_in_master() -> c_int {
 | 
			
		||||
    match SETTINGS.unwrap().max_clients_in_master() {
 | 
			
		||||
        None => 0,
 | 
			
		||||
        Some(value) => value,
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[no_mangle]
 | 
			
		||||
unsafe extern "C" fn settings_set_max_clients_in_master(value: c_int) {
 | 
			
		||||
    SETTINGS.unwrap().max_clients_in_master_set(if value == 0 {
 | 
			
		||||
        None
 | 
			
		||||
    } else {
 | 
			
		||||
        Some(value)
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,6 @@
 | 
			
		|||
#define _CONSTRAINTS_H
 | 
			
		||||
 | 
			
		||||
float constraints_master_area_factor(float master_area_factor);
 | 
			
		||||
int constraints_max_clients_in_master(int max_clients_in_master);
 | 
			
		||||
unsigned int constraints_snap_distance(unsigned int snap_distance);
 | 
			
		||||
 | 
			
		||||
#endif // _CONSTRAINTS_H
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,6 @@
 | 
			
		|||
static SettingsForSingleWindow border_for_single_window = SETTINGS_FOR_SINGLE_WINDOW_NOBODY_IS_FULLSCREEN;
 | 
			
		||||
static SettingsForSingleWindow gap_for_single_window = SETTINGS_FOR_SINGLE_WINDOW_NOBODY_IS_FULLSCREEN;
 | 
			
		||||
static UnitKind master_area_factor_per_unit = UNIT_MONITOR;
 | 
			
		||||
static int max_clients_in_master = 0; // 0 for no maximum
 | 
			
		||||
static bool respect_resize_hints_in_floating_layout = false;
 | 
			
		||||
static bool show_bar_by_default = true;
 | 
			
		||||
static UnitKind show_bar_per_unit = UNIT_MONITOR;
 | 
			
		||||
| 
						 | 
				
			
			@ -45,17 +44,6 @@ void settings_set_master_area_factor_per_unit(const UnitKind new_master_area_fac
 | 
			
		|||
	// TODO: notify WM to rearrange clients
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int settings_get_max_clients_in_master()
 | 
			
		||||
{
 | 
			
		||||
	return max_clients_in_master;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void settings_set_max_clients_in_master(const int new_max_clients_in_master)
 | 
			
		||||
{
 | 
			
		||||
	max_clients_in_master = constraints_max_clients_in_master(new_max_clients_in_master);
 | 
			
		||||
	// TODO: notify WM to rearrange clients
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool settings_get_respect_resize_hints_in_floating_layout()
 | 
			
		||||
{
 | 
			
		||||
	return respect_resize_hints_in_floating_layout;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,6 +11,7 @@ pub struct Settings {
 | 
			
		|||
    enable_swallowing: bool,
 | 
			
		||||
    focus_on_wheel: bool,
 | 
			
		||||
    gap_size: c_int,
 | 
			
		||||
    max_clients_in_master: Option<c_int>,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl Default for Settings {
 | 
			
		||||
| 
						 | 
				
			
			@ -23,6 +24,7 @@ impl Default for Settings {
 | 
			
		|||
            enable_swallowing: true,
 | 
			
		||||
            focus_on_wheel: true,
 | 
			
		||||
            gap_size: 10,
 | 
			
		||||
            max_clients_in_master: None,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -83,7 +85,18 @@ impl Settings {
 | 
			
		|||
        self.gap_size
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // TODO: notify WM to rearrange clients
 | 
			
		||||
    pub fn gap_size_set(&mut self, value: c_int) {
 | 
			
		||||
        self.gap_size = constraints::gap_size(value);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    pub fn max_clients_in_master(&self) -> Option<c_int> {
 | 
			
		||||
        self.max_clients_in_master
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // TODO: notify WM to rearrange clients
 | 
			
		||||
    pub fn max_clients_in_master_set(&mut self, value: Option<c_int>) {
 | 
			
		||||
        self.max_clients_in_master =
 | 
			
		||||
            value.map(|value| constraints::max_clients_in_master(value));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue