core/window: run polish in onExposed instead of polishItems
Fixes hyprland visible regions created before window expose.
This commit is contained in:
		
							parent
							
								
									cee1f5837e
								
							
						
					
					
						commit
						478aa2bda1
					
				
					 2 changed files with 6 additions and 5 deletions
				
			
		| 
						 | 
					@ -85,7 +85,7 @@ void ProxyWindowBase::onReload(QObject* oldInstance) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (wasVisible && this->isVisibleDirect()) {
 | 
						if (wasVisible && this->isVisibleDirect()) {
 | 
				
			||||||
		emit this->backerVisibilityChanged();
 | 
							emit this->backerVisibilityChanged();
 | 
				
			||||||
		this->runLints();
 | 
							this->onExposed();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -195,7 +195,7 @@ void ProxyWindowBase::connectWindow() {
 | 
				
			||||||
	QObject::connect(this->window, &QWindow::heightChanged, this, &ProxyWindowBase::heightChanged);
 | 
						QObject::connect(this->window, &QWindow::heightChanged, this, &ProxyWindowBase::heightChanged);
 | 
				
			||||||
	QObject::connect(this->window, &QWindow::screenChanged, this, &ProxyWindowBase::screenChanged);
 | 
						QObject::connect(this->window, &QWindow::screenChanged, this, &ProxyWindowBase::screenChanged);
 | 
				
			||||||
	QObject::connect(this->window, &QQuickWindow::colorChanged, this, &ProxyWindowBase::colorChanged);
 | 
						QObject::connect(this->window, &QQuickWindow::colorChanged, this, &ProxyWindowBase::colorChanged);
 | 
				
			||||||
	QObject::connect(this->window, &ProxiedWindow::exposed, this, &ProxyWindowBase::runLints);
 | 
						QObject::connect(this->window, &ProxiedWindow::exposed, this, &ProxyWindowBase::onExposed);
 | 
				
			||||||
	QObject::connect(this->window, &ProxiedWindow::devicePixelRatioChanged, this, &ProxyWindowBase::devicePixelRatioChanged);
 | 
						QObject::connect(this->window, &ProxiedWindow::devicePixelRatioChanged, this, &ProxyWindowBase::devicePixelRatioChanged);
 | 
				
			||||||
	// clang-format on
 | 
						// clang-format on
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -283,10 +283,11 @@ void ProxyWindowBase::polishItems() {
 | 
				
			||||||
	// This hack manually polishes the item tree right before showing the window so it will
 | 
						// This hack manually polishes the item tree right before showing the window so it will
 | 
				
			||||||
	// always be created with the correct size.
 | 
						// always be created with the correct size.
 | 
				
			||||||
	QQuickWindowPrivate::get(this->window)->polishItems();
 | 
						QQuickWindowPrivate::get(this->window)->polishItems();
 | 
				
			||||||
	this->onPolished();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ProxyWindowBase::runLints() {
 | 
					void ProxyWindowBase::onExposed() {
 | 
				
			||||||
 | 
						this->onPolished();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!this->ranLints) {
 | 
						if (!this->ranLints) {
 | 
				
			||||||
		qs::debug::lintItemTree(this->mContentItem);
 | 
							qs::debug::lintItemTree(this->mContentItem);
 | 
				
			||||||
		this->ranLints = true;
 | 
							this->ranLints = true;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -166,7 +166,7 @@ protected slots:
 | 
				
			||||||
	void onMaskDestroyed();
 | 
						void onMaskDestroyed();
 | 
				
			||||||
	void onScreenDestroyed();
 | 
						void onScreenDestroyed();
 | 
				
			||||||
	virtual void onPolished();
 | 
						virtual void onPolished();
 | 
				
			||||||
	void runLints();
 | 
						void onExposed();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
	bool mVisible = true;
 | 
						bool mVisible = true;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue