mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	menu: fix menus disappearing when opening pipemenu
Commit 7651531 introduced a regression: `menu_update_scene()` which
re-creates a menu scene was called for all the menus when a pipemenu is
created, so the menus (parent of the pipemenu) were always moved to (0,0)
and hidden, and the pipemenu was incorrectly positioned.
This commit fixes it by calling `menu_update_scene()` only for the
pipemenu when it's created.
			
			
This commit is contained in:
		
							parent
							
								
									36e099fc93
								
							
						
					
					
						commit
						10ee838c3b
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		| 
						 | 
					@ -322,6 +322,7 @@ title_create_scene(struct menuitem *menuitem, int *item_y)
 | 
				
			||||||
	*item_y += theme->menu_header_height;
 | 
						*item_y += theme->menu_header_height;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* (Re)creates the scene of the menu */
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
menu_update_scene(struct menu *menu)
 | 
					menu_update_scene(struct menu *menu)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -370,9 +371,16 @@ menu_update_scene(struct menu *menu)
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
post_processing(struct server *server)
 | 
					post_processing(struct server *server)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
						 * Create menu scene after all of its contents is determined
 | 
				
			||||||
 | 
						 * (e.g. when finished reading menu.xml or received output from
 | 
				
			||||||
 | 
						 * pipemenu program).
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	struct menu *menu;
 | 
						struct menu *menu;
 | 
				
			||||||
	wl_list_for_each(menu, &server->menus, link) {
 | 
						wl_list_for_each(menu, &server->menus, link) {
 | 
				
			||||||
		menu_update_scene(menu);
 | 
							if (!menu->scene_tree) {
 | 
				
			||||||
 | 
								menu_update_scene(menu);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue