Make Window::closeWindow() noop if the window is already closed
The surface handle can be dropped by that time. Also, there is no point to ask the client to close the window again if it's already closed.
This commit is contained in:
parent
ec86640f44
commit
ad98069618
4 changed files with 10 additions and 2 deletions
|
@ -172,7 +172,7 @@ QString InternalWindow::windowRole() const
|
|||
|
||||
void InternalWindow::closeWindow()
|
||||
{
|
||||
if (m_handle) {
|
||||
if (!isDeleted()) {
|
||||
m_handle->hide();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -211,7 +211,9 @@ void LayerShellV1Window::destroyWindow()
|
|||
|
||||
void LayerShellV1Window::closeWindow()
|
||||
{
|
||||
m_shellSurface->sendClosed();
|
||||
if (!isDeleted()) {
|
||||
m_shellSurface->sendClosed();
|
||||
}
|
||||
}
|
||||
|
||||
Layer LayerShellV1Window::belongsToLayer() const
|
||||
|
|
|
@ -2031,6 +2031,9 @@ bool X11Window::isCloseable() const
|
|||
*/
|
||||
void X11Window::closeWindow()
|
||||
{
|
||||
if (isDeleted()) {
|
||||
return;
|
||||
}
|
||||
if (!isCloseable()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -668,6 +668,9 @@ void XdgToplevelWindow::applyWindowRules()
|
|||
|
||||
void XdgToplevelWindow::closeWindow()
|
||||
{
|
||||
if (isDeleted()) {
|
||||
return;
|
||||
}
|
||||
if (isCloseable()) {
|
||||
sendPing(PingReason::CloseWindow);
|
||||
m_shellSurface->sendClose();
|
||||
|
|
Loading…
Reference in a new issue