mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	src/config/rcxml.c: reset default values on Reconfigure
Reported-by: <umk3> via IRC
This commit is contained in:
		
							parent
							
								
									00ebcdc290
								
							
						
					
					
						commit
						ce6b760b4b
					
				
					 2 changed files with 22 additions and 12 deletions
				
			
		| 
						 | 
					@ -5,12 +5,12 @@
 | 
				
			||||||
struct lab_data_buffer;
 | 
					struct lab_data_buffer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum font_slant {
 | 
					enum font_slant {
 | 
				
			||||||
	FONT_SLANT_NORMAL,
 | 
						FONT_SLANT_NORMAL = 0,
 | 
				
			||||||
	FONT_SLANT_ITALIC
 | 
						FONT_SLANT_ITALIC
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum font_weight {
 | 
					enum font_weight {
 | 
				
			||||||
	FONT_WEIGHT_NORMAL,
 | 
						FONT_WEIGHT_NORMAL = 0,
 | 
				
			||||||
	FONT_WEIGHT_BOLD
 | 
						FONT_WEIGHT_BOLD
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -535,23 +535,35 @@ rcxml_parse_xml(struct buf *b)
 | 
				
			||||||
	xmlCleanupParser();
 | 
						xmlCleanupParser();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void
 | 
				
			||||||
 | 
					init_font_defaults(struct font *font)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						font->size = 10;
 | 
				
			||||||
 | 
						font->slant = FONT_SLANT_NORMAL;
 | 
				
			||||||
 | 
						font->weight = FONT_WEIGHT_NORMAL;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
rcxml_init(void)
 | 
					rcxml_init(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	static bool has_run;
 | 
						static bool has_run;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (has_run) {
 | 
						if (!has_run) {
 | 
				
			||||||
		return;
 | 
							wl_list_init(&rc.keybinds);
 | 
				
			||||||
 | 
							wl_list_init(&rc.mousebinds);
 | 
				
			||||||
 | 
							wl_list_init(&rc.libinput_categories);
 | 
				
			||||||
 | 
							wl_list_init(&rc.workspace_config.workspaces);
 | 
				
			||||||
 | 
							wl_list_init(&rc.regions);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	has_run = true;
 | 
						has_run = true;
 | 
				
			||||||
	wl_list_init(&rc.keybinds);
 | 
					
 | 
				
			||||||
	wl_list_init(&rc.mousebinds);
 | 
					 | 
				
			||||||
	wl_list_init(&rc.libinput_categories);
 | 
					 | 
				
			||||||
	rc.xdg_shell_server_side_deco = true;
 | 
						rc.xdg_shell_server_side_deco = true;
 | 
				
			||||||
	rc.corner_radius = 8;
 | 
						rc.corner_radius = 8;
 | 
				
			||||||
	rc.font_activewindow.size = 10;
 | 
					
 | 
				
			||||||
	rc.font_menuitem.size = 10;
 | 
						init_font_defaults(&rc.font_activewindow);
 | 
				
			||||||
	rc.font_osd.size = 10;
 | 
						init_font_defaults(&rc.font_menuitem);
 | 
				
			||||||
 | 
						init_font_defaults(&rc.font_osd);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	rc.doubleclick_time = 500;
 | 
						rc.doubleclick_time = 500;
 | 
				
			||||||
	rc.repeat_rate = 25;
 | 
						rc.repeat_rate = 25;
 | 
				
			||||||
	rc.repeat_delay = 600;
 | 
						rc.repeat_delay = 600;
 | 
				
			||||||
| 
						 | 
					@ -562,8 +574,6 @@ rcxml_init(void)
 | 
				
			||||||
	rc.cycle_preview_contents = false;
 | 
						rc.cycle_preview_contents = false;
 | 
				
			||||||
	rc.cycle_preview_outlines = true;
 | 
						rc.cycle_preview_outlines = true;
 | 
				
			||||||
	rc.workspace_config.popuptime = INT_MIN;
 | 
						rc.workspace_config.popuptime = INT_MIN;
 | 
				
			||||||
	wl_list_init(&rc.workspace_config.workspaces);
 | 
					 | 
				
			||||||
	wl_list_init(&rc.regions);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct {
 | 
					static struct {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue