mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	implement Resize as an action
this requires action() to know the resize edges to use, so thread them through
This commit is contained in:
		
							parent
							
								
									8eab1e8132
								
							
						
					
					
						commit
						031ced85ef
					
				
					 5 changed files with 24 additions and 13 deletions
				
			
		| 
						 | 
				
			
			@ -20,7 +20,7 @@ show_menu(struct server *server, const char *menu)
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
action(struct server *server, const char *action, const char *command)
 | 
			
		||||
action(struct server *server, const char *action, const char *command, uint32_t resize_edges)
 | 
			
		||||
{
 | 
			
		||||
	if (!action)
 | 
			
		||||
		return;
 | 
			
		||||
| 
						 | 
				
			
			@ -77,6 +77,11 @@ action(struct server *server, const char *action, const char *command)
 | 
			
		|||
		if (view) {
 | 
			
		||||
			interactive_begin(view, LAB_INPUT_STATE_MOVE, 0);
 | 
			
		||||
		}
 | 
			
		||||
	} else if (!strcasecmp(action, "Resize")) {
 | 
			
		||||
		struct view *view = desktop_view_at_cursor(server);
 | 
			
		||||
		if (view) {
 | 
			
		||||
			interactive_begin(view, LAB_INPUT_STATE_RESIZE, resize_edges);
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		wlr_log(WLR_ERROR, "action (%s) not supported", action);
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue