mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	xdg-shell: center view on first map
...and take into account output layout co-ordinates. Previously xdg-shell views were just positioned at (0, 0) on first map regardless of output co-ordinates. Fix issue #39
This commit is contained in:
		
							parent
							
								
									cb98f8f197
								
							
						
					
					
						commit
						3034da776b
					
				
					 1 changed files with 4 additions and 6 deletions
				
			
		
							
								
								
									
										10
									
								
								src/xdg.c
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								src/xdg.c
									
										
									
									
									
								
							| 
						 | 
					@ -224,11 +224,9 @@ static void
 | 
				
			||||||
position_xdg_toplevel_view(struct view *view)
 | 
					position_xdg_toplevel_view(struct view *view)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (istopmost(view)) {
 | 
						if (istopmost(view)) {
 | 
				
			||||||
		/*
 | 
							view->w = view->xdg_surface->geometry.width;
 | 
				
			||||||
		 * For topmost xdg-toplevel, we just top/left align for the
 | 
							view->h = view->xdg_surface->geometry.height;
 | 
				
			||||||
		 * time being
 | 
							view_center(view);
 | 
				
			||||||
		 */
 | 
					 | 
				
			||||||
		view->x = view->y = 0;
 | 
					 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		/*
 | 
							/*
 | 
				
			||||||
		 * If child-toplevel-views, we center-align relative to their
 | 
							 * If child-toplevel-views, we center-align relative to their
 | 
				
			||||||
| 
						 | 
					@ -274,8 +272,8 @@ xdg_toplevel_view_map(struct view *view)
 | 
				
			||||||
				 parent_link) {
 | 
									 parent_link) {
 | 
				
			||||||
			subsurface_create(view, subsurface);
 | 
								subsurface_create(view, subsurface);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
		view->been_mapped = true;
 | 
							view->been_mapped = true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	view->commit.notify = handle_commit;
 | 
						view->commit.notify = handle_commit;
 | 
				
			||||||
	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