mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	xdg: only position topmost view
This commit is contained in:
		
							parent
							
								
									33d02aa83e
								
							
						
					
					
						commit
						5351299cdd
					
				
					 1 changed files with 10 additions and 3 deletions
				
			
		| 
						 | 
					@ -142,6 +142,11 @@ static struct border xdg_shell_border(struct view *view)
 | 
				
			||||||
	return border;
 | 
						return border;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static bool istopmost(struct view *view)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						return view->xdg_surface->toplevel->parent == NULL;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void xdg_toplevel_view_map(struct view *view)
 | 
					static void xdg_toplevel_view_map(struct view *view)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	view->mapped = true;
 | 
						view->mapped = true;
 | 
				
			||||||
| 
						 | 
					@ -154,10 +159,12 @@ static void xdg_toplevel_view_map(struct view *view)
 | 
				
			||||||
			view->margin = xdg_shell_border(view);
 | 
								view->margin = xdg_shell_border(view);
 | 
				
			||||||
			view->xdg_grab_offset = -view->margin.left;
 | 
								view->xdg_grab_offset = -view->margin.left;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							if (istopmost(view)) {
 | 
				
			||||||
			/* align to edge of screen */
 | 
								/* align to edge of screen */
 | 
				
			||||||
			view->x += view->margin.left;
 | 
								view->x += view->margin.left;
 | 
				
			||||||
			view->y += view->margin.top;
 | 
								view->y += view->margin.top;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	view->been_mapped = true;
 | 
						view->been_mapped = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wl_signal_add(&view->xdg_surface->surface->events.commit,
 | 
						wl_signal_add(&view->xdg_surface->surface->events.commit,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue