mirror of
				https://codeberg.org/dwl/dwl.git
				synced 2025-11-03 09:01:45 -05:00 
			
		
		
		
	make XWayland clients inherit tags and monitors
Revert 3213088 because the linked bug can no longer be reproduced with
wlroots 0.17, and update client_get_parent() so it doesn't segfault with
XWayland surfaces. This also allows reusing the p variable in the next
commit.
			
			
This commit is contained in:
		
							parent
							
								
									0b72dbb23d
								
							
						
					
					
						commit
						d41a57c50f
					
				
					 2 changed files with 6 additions and 4 deletions
				
			
		
							
								
								
									
										7
									
								
								client.h
									
										
									
									
									
								
							
							
						
						
									
										7
									
								
								client.h
									
										
									
									
									
								
							| 
						 | 
					@ -172,8 +172,11 @@ client_get_parent(Client *c)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	Client *p = NULL;
 | 
						Client *p = NULL;
 | 
				
			||||||
#ifdef XWAYLAND
 | 
					#ifdef XWAYLAND
 | 
				
			||||||
	if (client_is_x11(c) && c->surface.xwayland->parent)
 | 
					    if (client_is_x11(c)) {
 | 
				
			||||||
		toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL);
 | 
					        if (c->surface.xwayland->parent)
 | 
				
			||||||
 | 
					            toplevel_from_wlr_surface(c->surface.xwayland->parent->surface, &p, NULL);
 | 
				
			||||||
 | 
					        return p;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	if (c->surface.xdg->toplevel->parent)
 | 
						if (c->surface.xdg->toplevel->parent)
 | 
				
			||||||
		toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);
 | 
							toplevel_from_wlr_surface(c->surface.xdg->toplevel->parent->base->surface, &p, NULL);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										3
									
								
								dwl.c
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								dwl.c
									
										
									
									
									
								
							| 
						 | 
					@ -1542,8 +1542,7 @@ mapnotify(struct wl_listener *listener, void *data)
 | 
				
			||||||
	 * we always consider floating, clients that have parent and thus
 | 
						 * we always consider floating, clients that have parent and thus
 | 
				
			||||||
	 * we set the same tags and monitor than its parent, if not
 | 
						 * we set the same tags and monitor than its parent, if not
 | 
				
			||||||
	 * try to apply rules for them */
 | 
						 * try to apply rules for them */
 | 
				
			||||||
	/* TODO: https://github.com/djpohly/dwl/pull/334#issuecomment-1330166324 */
 | 
						if ((p = client_get_parent(c))) {
 | 
				
			||||||
	if (c->type == XDGShell && (p = client_get_parent(c))) {
 | 
					 | 
				
			||||||
		c->isfloating = 1;
 | 
							c->isfloating = 1;
 | 
				
			||||||
		setmon(c, p->mon, p->tags);
 | 
							setmon(c, p->mon, p->tags);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue