mirror of
				https://codeberg.org/dwl/dwl.git
				synced 2025-11-03 09:01:45 -05:00 
			
		
		
		
	wait to get window geometry until map time
This commit is contained in:
		
							parent
							
								
									34d5045d84
								
							
						
					
					
						commit
						40d0d0f829
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		
							
								
								
									
										6
									
								
								dwl.c
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								dwl.c
									
										
									
									
									
								
							| 
						 | 
					@ -403,9 +403,6 @@ createnotify(struct wl_listener *listener, void *data)
 | 
				
			||||||
	Client *c = xdg_surface->data = calloc(1, sizeof(*c));
 | 
						Client *c = xdg_surface->data = calloc(1, sizeof(*c));
 | 
				
			||||||
	c->xdg_surface = xdg_surface;
 | 
						c->xdg_surface = xdg_surface;
 | 
				
			||||||
	c->bw = borderpx;
 | 
						c->bw = borderpx;
 | 
				
			||||||
	wlr_xdg_surface_get_geometry(c->xdg_surface, &c->geom);
 | 
					 | 
				
			||||||
	c->geom.width += 2 * c->bw;
 | 
					 | 
				
			||||||
	c->geom.height += 2 * c->bw;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Tell the client not to try anything fancy */
 | 
						/* Tell the client not to try anything fancy */
 | 
				
			||||||
	wlr_xdg_toplevel_set_tiled(c->xdg_surface, true);
 | 
						wlr_xdg_toplevel_set_tiled(c->xdg_surface, true);
 | 
				
			||||||
| 
						 | 
					@ -658,6 +655,9 @@ maprequest(struct wl_listener *listener, void *data)
 | 
				
			||||||
	/* Called when the surface is mapped, or ready to display on-screen. */
 | 
						/* Called when the surface is mapped, or ready to display on-screen. */
 | 
				
			||||||
	Client *c = wl_container_of(listener, c, map);
 | 
						Client *c = wl_container_of(listener, c, map);
 | 
				
			||||||
	/* XXX Apply client rules here */
 | 
						/* XXX Apply client rules here */
 | 
				
			||||||
 | 
						wlr_xdg_surface_get_geometry(c->xdg_surface, &c->geom);
 | 
				
			||||||
 | 
						c->geom.width += 2 * c->bw;
 | 
				
			||||||
 | 
						c->geom.height += 2 * c->bw;
 | 
				
			||||||
	/* Insert this client into the list and put it on selmon. */
 | 
						/* Insert this client into the list and put it on selmon. */
 | 
				
			||||||
	wl_list_insert(&clients, &c->link);
 | 
						wl_list_insert(&clients, &c->link);
 | 
				
			||||||
	wl_list_insert(&fstack, &c->flink);
 | 
						wl_list_insert(&fstack, &c->flink);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue