mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	rcxml: set default mousebind
...if none specified by the user in ~/.config/labwc/rc.xml
This commit is contained in:
		
							parent
							
								
									62d93d54c5
								
							
						
					
					
						commit
						b5acf387b8
					
				
					 1 changed files with 25 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -375,6 +375,27 @@ load_default_key_bindings(void)
 | 
			
		|||
	bind("A-Down", "MoveToEdge", "down");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static struct {
 | 
			
		||||
	const char *context, *button, *event, *action, *command;
 | 
			
		||||
} mouse_combos[] = {
 | 
			
		||||
	{ "TitleBar", "Left", "DoubleClick", "ToggleMaximize", NULL },
 | 
			
		||||
	{ NULL, NULL, NULL, NULL, NULL },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
load_default_mouse_bindings(void)
 | 
			
		||||
{
 | 
			
		||||
	for (int i = 0; mouse_combos[i].context; i++) {
 | 
			
		||||
		struct mousebind *m = mousebind_create(mouse_combos[i].context);
 | 
			
		||||
		m->button = mousebind_button_from_str(mouse_combos[i].button);
 | 
			
		||||
		m->mouse_event = mousebind_event_from_str(mouse_combos[i].event);
 | 
			
		||||
		m->action = strdup(mouse_combos[i].action);
 | 
			
		||||
		if (mouse_combos[i].command) {
 | 
			
		||||
			m->command = strdup(mouse_combos[i].command);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
post_processing(void)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -382,6 +403,10 @@ post_processing(void)
 | 
			
		|||
		wlr_log(WLR_INFO, "load default key bindings");
 | 
			
		||||
		load_default_key_bindings();
 | 
			
		||||
	}
 | 
			
		||||
	if (!wl_list_length(&rc.mousebinds)) {
 | 
			
		||||
		wlr_log(WLR_INFO, "load default mouse bindings");
 | 
			
		||||
		load_default_mouse_bindings();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!rc.font_name_activewindow) {
 | 
			
		||||
		rc.font_name_activewindow = strdup("sans");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue