Comment 5 for bug 1656727

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I'm not sure exactly what is happening, but I suspect is needs something like the following in some other method. (from lp:qtmir src/platforms/mirserver/windowmanagementpolicy.cpp):

void WindowManagementPolicy::resize(const miral::Window &window, const Size size)
{
    miral::WindowSpecification modifications;
    modifications.size() = size;
    m_tools.invoke_under_lock([&window, &modifications, this]() {
        try {
            m_tools.modify_window(m_tools.info_for(window), modifications);
        } catch (const std::out_of_range&) {
            // usually shell trying to operate on a window which already closed, just ignore
            // TODO: MirSurface extends the miral::Window lifetime by holding a shared pointer to
            // the mir::scene::Surface, meaning it cannot detect when the window has been closed
            // and thus avoid calling this method.
        }
    });
}