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.
wilder/Plasma/6.2
Vlad Zahorodnii 2 years ago
parent ec86640f44
commit ad98069618
  1. 2
      src/internalwindow.cpp
  2. 4
      src/layershellv1window.cpp
  3. 3
      src/x11window.cpp
  4. 3
      src/xdgshellwindow.cpp

@ -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…
Cancel
Save