forked from quickshell/quickshell
		
	wayland/popupanchor: fix anchor state breaking show after reposition
If the popup was hidden and reposition was called to update qt's initial positioning properties it would be cancelled by the dirty marker being unset. This includes if the popup is shown or not into its dirty state.
This commit is contained in:
		
							parent
							
								
									4b2e569e94
								
							
						
					
					
						commit
						18563b1273
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -15,11 +15,15 @@ using XdgPositioner = QtWayland::xdg_positioner;
 | 
			
		|||
using qs::wayland::xdg_shell::XdgWmBase;
 | 
			
		||||
 | 
			
		||||
void WaylandPopupPositioner::reposition(PopupAnchor* anchor, QWindow* window, bool onlyIfDirty) {
 | 
			
		||||
	if (onlyIfDirty && !anchor->isDirty()) return;
 | 
			
		||||
 | 
			
		||||
	auto* waylandWindow = dynamic_cast<QWaylandWindow*>(window->handle());
 | 
			
		||||
	auto* popupRole = waylandWindow ? waylandWindow->surfaceRole<::xdg_popup>() : nullptr;
 | 
			
		||||
 | 
			
		||||
	// If a popup becomes invisble after creation ensure the _q properties will
 | 
			
		||||
	// be set and not ignored because the rest is the same.
 | 
			
		||||
	anchor->updatePlacement({popupRole != nullptr, 0}, {});
 | 
			
		||||
 | 
			
		||||
	if (onlyIfDirty && !anchor->isDirty()) return;
 | 
			
		||||
	anchor->markClean();
 | 
			
		||||
 | 
			
		||||
	if (popupRole) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue