mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	ssd: add window drop-shadows (#1648)
Add optional drop-shadows to windows using server-side decoration. Shadows can be enabled/disabled rc.xml and their appearance configured in themerc. The default is no shadows to preserve current behaviour. The shadows are drawn in fixed corner and edge buffers shared between all windows, the edges are scaled to size depending on the size of each window. Two sets of buffers are used to give the different appearances for active and inactive windows. I use separate corner/edge buffers for a few reasons: - It avoids needing to store a separate large shadow buffer per window - It avoids needing to redraw the shadows when the window is being resized - Compositing the shadows onto the desktop should be faster as there are overall fewer pixels to blend, and scaling up the edge buffers only requires reading a tiny buffer which is then replicated.
This commit is contained in:
		
							parent
							
								
									b0ba585ff8
								
							
						
					
					
						commit
						ce0d2c2966
					
				
					 13 changed files with 606 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -884,6 +884,8 @@ entry(xmlNode *node, char *nodename, char *content)
 | 
			
		|||
		rc.corner_radius = atoi(content);
 | 
			
		||||
	} else if (!strcasecmp(nodename, "keepBorder.theme")) {
 | 
			
		||||
		set_bool(content, &rc.ssd_keep_border);
 | 
			
		||||
	} else if (!strcasecmp(nodename, "dropShadows.theme")) {
 | 
			
		||||
		set_bool(content, &rc.shadows_enabled);
 | 
			
		||||
	} else if (!strcmp(nodename, "name.font.theme")) {
 | 
			
		||||
		fill_font(nodename, content, font_place);
 | 
			
		||||
	} else if (!strcmp(nodename, "size.font.theme")) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1192,6 +1194,7 @@ rcxml_init(void)
 | 
			
		|||
	rc.xdg_shell_server_side_deco = true;
 | 
			
		||||
	rc.ssd_keep_border = true;
 | 
			
		||||
	rc.corner_radius = 8;
 | 
			
		||||
	rc.shadows_enabled = false;
 | 
			
		||||
 | 
			
		||||
	init_font_defaults(&rc.font_activewindow);
 | 
			
		||||
	init_font_defaults(&rc.font_inactivewindow);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue