forked from quickshell/quickshell
		
	core/window: ensure window cannot be made visible during reload
This causes duplicate windows.
This commit is contained in:
		
							parent
							
								
									9625129844
								
							
						
					
					
						commit
						9cbd5abd96
					
				
					 2 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -51,6 +51,8 @@ void ProxyWindowBase::onReload(QObject* oldInstance) {
 | 
				
			||||||
	this->connectWindow();
 | 
						this->connectWindow();
 | 
				
			||||||
	this->completeWindow();
 | 
						this->completeWindow();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						this->reloadComplete = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	emit this->windowConnected();
 | 
						emit this->windowConnected();
 | 
				
			||||||
	this->postCompleteWindow();
 | 
						this->postCompleteWindow();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -164,7 +166,7 @@ bool ProxyWindowBase::isVisibleDirect() const {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ProxyWindowBase::setVisible(bool visible) {
 | 
					void ProxyWindowBase::setVisible(bool visible) {
 | 
				
			||||||
	this->mVisible = visible;
 | 
						this->mVisible = visible;
 | 
				
			||||||
	this->setVisibleDirect(visible);
 | 
						if (this->reloadComplete) this->setVisibleDirect(visible);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ProxyWindowBase::setVisibleDirect(bool visible) {
 | 
					void ProxyWindowBase::setVisibleDirect(bool visible) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -129,6 +129,7 @@ protected:
 | 
				
			||||||
	PendingRegion* mMask = nullptr;
 | 
						PendingRegion* mMask = nullptr;
 | 
				
			||||||
	QQuickWindow* window = nullptr;
 | 
						QQuickWindow* window = nullptr;
 | 
				
			||||||
	QQuickItem* mContentItem = nullptr;
 | 
						QQuickItem* mContentItem = nullptr;
 | 
				
			||||||
 | 
						bool reloadComplete = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
	void updateMask();
 | 
						void updateMask();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue