mirror of
				https://github.com/DreamMaoMao/maomaowm.git
				synced 2025-11-03 09:01:47 -05:00 
			
		
		
		
	feat: add windowrule option force_tile_state
This commit is contained in:
		
							parent
							
								
									1161fdf2e8
								
							
						
					
					
						commit
						16442890a5
					
				
					 2 changed files with 16 additions and 0 deletions
				
			
		| 
						 | 
					@ -72,6 +72,7 @@ typedef struct {
 | 
				
			||||||
	int no_force_center;
 | 
						int no_force_center;
 | 
				
			||||||
	int isterm;
 | 
						int isterm;
 | 
				
			||||||
	int allow_csd;
 | 
						int allow_csd;
 | 
				
			||||||
 | 
						int force_tile_state;
 | 
				
			||||||
	int noswallow;
 | 
						int noswallow;
 | 
				
			||||||
	float focused_opacity;
 | 
						float focused_opacity;
 | 
				
			||||||
	float unfocused_opacity;
 | 
						float unfocused_opacity;
 | 
				
			||||||
| 
						 | 
					@ -1483,6 +1484,7 @@ void parse_option(Config *config, char *key, char *value) {
 | 
				
			||||||
		rule->isnosizehint = -1;
 | 
							rule->isnosizehint = -1;
 | 
				
			||||||
		rule->isterm = -1;
 | 
							rule->isterm = -1;
 | 
				
			||||||
		rule->allow_csd = -1;
 | 
							rule->allow_csd = -1;
 | 
				
			||||||
 | 
							rule->force_tile_state = -1;
 | 
				
			||||||
		rule->noswallow = -1;
 | 
							rule->noswallow = -1;
 | 
				
			||||||
		rule->nofadein = -1;
 | 
							rule->nofadein = -1;
 | 
				
			||||||
		rule->nofadeout = -1;
 | 
							rule->nofadeout = -1;
 | 
				
			||||||
| 
						 | 
					@ -1576,6 +1578,8 @@ void parse_option(Config *config, char *key, char *value) {
 | 
				
			||||||
					rule->isterm = atoi(val);
 | 
										rule->isterm = atoi(val);
 | 
				
			||||||
				} else if (strcmp(key, "allow_csd") == 0) {
 | 
									} else if (strcmp(key, "allow_csd") == 0) {
 | 
				
			||||||
					rule->allow_csd = atoi(val);
 | 
										rule->allow_csd = atoi(val);
 | 
				
			||||||
 | 
									} else if (strcmp(key, "force_tile_state") == 0) {
 | 
				
			||||||
 | 
										rule->force_tile_state = atoi(val);
 | 
				
			||||||
				} else if (strcmp(key, "noswallow") == 0) {
 | 
									} else if (strcmp(key, "noswallow") == 0) {
 | 
				
			||||||
					rule->noswallow = atoi(val);
 | 
										rule->noswallow = atoi(val);
 | 
				
			||||||
				} else if (strcmp(key, "scroller_proportion") == 0) {
 | 
									} else if (strcmp(key, "scroller_proportion") == 0) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								src/mango.c
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								src/mango.c
									
										
									
									
									
								
							| 
						 | 
					@ -325,6 +325,7 @@ struct Client {
 | 
				
			||||||
	struct dwl_animation animation;
 | 
						struct dwl_animation animation;
 | 
				
			||||||
	int isterm, noswallow;
 | 
						int isterm, noswallow;
 | 
				
			||||||
	int allow_csd;
 | 
						int allow_csd;
 | 
				
			||||||
 | 
						int force_tile_state;
 | 
				
			||||||
	pid_t pid;
 | 
						pid_t pid;
 | 
				
			||||||
	Client *swallowing, *swallowedby;
 | 
						Client *swallowing, *swallowedby;
 | 
				
			||||||
	bool is_clip_to_hide;
 | 
						bool is_clip_to_hide;
 | 
				
			||||||
| 
						 | 
					@ -1139,6 +1140,7 @@ void toggle_hotarea(int x_root, int y_root) {
 | 
				
			||||||
static void apply_rule_properties(Client *c, const ConfigWinRule *r) {
 | 
					static void apply_rule_properties(Client *c, const ConfigWinRule *r) {
 | 
				
			||||||
	APPLY_INT_PROP(c, r, isterm);
 | 
						APPLY_INT_PROP(c, r, isterm);
 | 
				
			||||||
	APPLY_INT_PROP(c, r, allow_csd);
 | 
						APPLY_INT_PROP(c, r, allow_csd);
 | 
				
			||||||
 | 
						APPLY_INT_PROP(c, r, force_tile_state);
 | 
				
			||||||
	APPLY_INT_PROP(c, r, noswallow);
 | 
						APPLY_INT_PROP(c, r, noswallow);
 | 
				
			||||||
	APPLY_INT_PROP(c, r, nofadein);
 | 
						APPLY_INT_PROP(c, r, nofadein);
 | 
				
			||||||
	APPLY_INT_PROP(c, r, nofadeout);
 | 
						APPLY_INT_PROP(c, r, nofadeout);
 | 
				
			||||||
| 
						 | 
					@ -3428,6 +3430,7 @@ void init_client_properties(Client *c) {
 | 
				
			||||||
	c->stack_innder_per = 0.0f;
 | 
						c->stack_innder_per = 0.0f;
 | 
				
			||||||
	c->isterm = 0;
 | 
						c->isterm = 0;
 | 
				
			||||||
	c->allow_csd = 0;
 | 
						c->allow_csd = 0;
 | 
				
			||||||
 | 
						c->force_tile_state = 1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void // old fix to 0.5
 | 
					void // old fix to 0.5
 | 
				
			||||||
| 
						 | 
					@ -4345,6 +4348,15 @@ setfloating(Client *c, int floating) {
 | 
				
			||||||
		set_size_per(c->mon, c);
 | 
							set_size_per(c->mon, c);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!c->force_tile_state) {
 | 
				
			||||||
 | 
							if (c->isfloating) {
 | 
				
			||||||
 | 
								client_set_tiled(c, WLR_EDGE_NONE);
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT |
 | 
				
			||||||
 | 
														WLR_EDGE_RIGHT);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	arrange(c->mon, false);
 | 
						arrange(c->mon, false);
 | 
				
			||||||
	setborder_color(c);
 | 
						setborder_color(c);
 | 
				
			||||||
	printstatus();
 | 
						printstatus();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue