mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	xdg: Save natural_geometry.x/y with initially maximized view
Fixes an issue where, if Thunar was started maximized, it would un-maximize to the top-left corner rather than the center.
This commit is contained in:
		
							parent
							
								
									74bc16910a
								
							
						
					
					
						commit
						c639cdba06
					
				
					 1 changed files with 20 additions and 2 deletions
				
			
		
							
								
								
									
										22
									
								
								src/xdg.c
									
										
									
									
									
								
							
							
						
						
									
										22
									
								
								src/xdg.c
									
										
									
									
									
								
							| 
						 | 
					@ -332,6 +332,19 @@ xdg_toplevel_view_map(struct view *view)
 | 
				
			||||||
				xdg_surface->current.geometry.height;
 | 
									xdg_surface->current.geometry.height;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/*
 | 
				
			||||||
 | 
							 * Set initial "pending" position for floating views.
 | 
				
			||||||
 | 
							 * Do this before view_set_fullscreen/view_maximize() so
 | 
				
			||||||
 | 
							 * that the position is saved with the natural geometry.
 | 
				
			||||||
 | 
							 *
 | 
				
			||||||
 | 
							 * FIXME: the natural geometry is not saved if either
 | 
				
			||||||
 | 
							 * handle_request_fullscreen/handle_request_maximize()
 | 
				
			||||||
 | 
							 * is called before map (try "foot --maximized").
 | 
				
			||||||
 | 
							 */
 | 
				
			||||||
 | 
							if (view_is_floating(view)) {
 | 
				
			||||||
 | 
								position_xdg_toplevel_view(view);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (!view->fullscreen && requested->fullscreen) {
 | 
							if (!view->fullscreen && requested->fullscreen) {
 | 
				
			||||||
			struct output *output = output_from_wlr_output(
 | 
								struct output *output = output_from_wlr_output(
 | 
				
			||||||
				view->server, requested->fullscreen_output);
 | 
									view->server, requested->fullscreen_output);
 | 
				
			||||||
| 
						 | 
					@ -339,10 +352,15 @@ xdg_toplevel_view_map(struct view *view)
 | 
				
			||||||
		} else if (!view->maximized && requested->maximized) {
 | 
							} else if (!view->maximized && requested->maximized) {
 | 
				
			||||||
			view_maximize(view, true,
 | 
								view_maximize(view, true,
 | 
				
			||||||
				/*store_natural_geometry*/ true);
 | 
									/*store_natural_geometry*/ true);
 | 
				
			||||||
		} else if (view_is_floating(view)) {
 | 
					 | 
				
			||||||
			position_xdg_toplevel_view(view);
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/*
 | 
				
			||||||
 | 
							 * Set initial "current" position directly before
 | 
				
			||||||
 | 
							 * calling view_moved() to reduce flicker
 | 
				
			||||||
 | 
							 */
 | 
				
			||||||
 | 
							view->current.x = view->pending.x;
 | 
				
			||||||
 | 
							view->current.y = view->pending.y;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		view_moved(view);
 | 
							view_moved(view);
 | 
				
			||||||
		view->been_mapped = true;
 | 
							view->been_mapped = true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue