Introduce Window::closeOnDismissed() flag
This can be used to control the sending of QEvent::Close event.
This commit is contained in:
		
							parent
							
								
									497d50c4df
								
							
						
					
					
						commit
						5e88f449b0
					
				
					 4 changed files with 46 additions and 24 deletions
				
			
		| 
						 | 
				
			
			@ -35,6 +35,7 @@ public:
 | 
			
		|||
    Window::Layer layer = Window::LayerTop;
 | 
			
		||||
    QMargins margins;
 | 
			
		||||
    Window::ScreenConfiguration screenConfiguration = Window::ScreenFromQWindow;
 | 
			
		||||
    bool closeOnDismissed = true;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static QMap<QWindow *, Window *> s_map;
 | 
			
		||||
| 
						 | 
				
			
			@ -120,6 +121,16 @@ void Window::setScreenConfiguration(Window::ScreenConfiguration screenConfigurat
 | 
			
		|||
    d->screenConfiguration = screenConfiguration;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool Window::closeOnDismissed() const
 | 
			
		||||
{
 | 
			
		||||
    return d->closeOnDismissed;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Window::setCloseOnDismissed(bool close)
 | 
			
		||||
{
 | 
			
		||||
    d->closeOnDismissed = close;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0)
 | 
			
		||||
void Window::attachPopup(QWindow *window, xdg_popup *popup)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -97,6 +97,15 @@ public:
 | 
			
		|||
    void setScope(const QString &scope);
 | 
			
		||||
    QString scope() const;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Whether the QWindow should be closed when the layer surface is dismissed by the compositor.
 | 
			
		||||
     * For example, if the associated screen has been removed.
 | 
			
		||||
     *
 | 
			
		||||
     * This can be used to map the window on another screen.
 | 
			
		||||
     */
 | 
			
		||||
    void setCloseOnDismissed(bool close);
 | 
			
		||||
    bool closeOnDismissed() const;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Gets the LayerShell Window for a given Qt Window
 | 
			
		||||
     * Ownership is not transferred
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue