mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	Use 0 for default width/height (rather than -1)
This commit is contained in:
		
							parent
							
								
									d1c0e6fe2c
								
							
						
					
					
						commit
						11c57d22b0
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
					@ -70,7 +70,7 @@ static void arrange_layer(struct wlr_output *output, struct wl_list *list) {
 | 
				
			||||||
		// Horizontal axis
 | 
							// Horizontal axis
 | 
				
			||||||
		const uint32_t both_horiz = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT
 | 
							const uint32_t both_horiz = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT
 | 
				
			||||||
			| ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT;
 | 
								| ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT;
 | 
				
			||||||
		if ((state->anchor & both_horiz) && box.width == -1) {
 | 
							if ((state->anchor & both_horiz) && box.width == 0) {
 | 
				
			||||||
			box.x = 0;
 | 
								box.x = 0;
 | 
				
			||||||
			box.width = output_area.width;
 | 
								box.width = output_area.width;
 | 
				
			||||||
		} else if ((state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT)) {
 | 
							} else if ((state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT)) {
 | 
				
			||||||
| 
						 | 
					@ -83,7 +83,7 @@ static void arrange_layer(struct wlr_output *output, struct wl_list *list) {
 | 
				
			||||||
		// Vertical axis
 | 
							// Vertical axis
 | 
				
			||||||
		const uint32_t both_vert = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP
 | 
							const uint32_t both_vert = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP
 | 
				
			||||||
			| ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM;
 | 
								| ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM;
 | 
				
			||||||
		if ((state->anchor & both_vert) && box.height == -1) {
 | 
							if ((state->anchor & both_vert) && box.height == 0) {
 | 
				
			||||||
			box.y = 0;
 | 
								box.y = 0;
 | 
				
			||||||
			box.height = output_area.height;
 | 
								box.height = output_area.height;
 | 
				
			||||||
		} else if ((state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP)) {
 | 
							} else if ((state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP)) {
 | 
				
			||||||
| 
						 | 
					@ -97,9 +97,9 @@ static void arrange_layer(struct wlr_output *output, struct wl_list *list) {
 | 
				
			||||||
				box.width, box.height, box.x, box.y);
 | 
									box.width, box.height, box.x, box.y);
 | 
				
			||||||
		roots_surface->geo = box;
 | 
							roots_surface->geo = box;
 | 
				
			||||||
		apply_exclusive(&output_area, state->anchor, state->exclusive_zone);
 | 
							apply_exclusive(&output_area, state->anchor, state->exclusive_zone);
 | 
				
			||||||
		if (box.width != (int)state->width
 | 
							if (!roots_surface->configured ||
 | 
				
			||||||
				|| box.height != (int)state->height
 | 
									box.width != (int)state->width ||
 | 
				
			||||||
				|| !roots_surface->configured) {
 | 
									box.height != (int)state->height) {
 | 
				
			||||||
			wlr_layer_surface_configure(layer, box.width, box.height);
 | 
								wlr_layer_surface_configure(layer, box.width, box.height);
 | 
				
			||||||
			roots_surface->configured = true;
 | 
								roots_surface->configured = true;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue