void Compositor::onSurfaceMappedChanged() { QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); CompositorWindow *window = surfaceWindow(surface); if(window && surface) { if(surface->hasContent()) { qDebug() << __PRETTY_FUNCTION__ << " MAPPED " << window << "appId" << window->appId() << "windowType" << window->windowType(); // If it was a window created by QtWebProcess, it may be not already in our WindowModel list if (!WindowModel::isWindowAlreadyAdded(mWindowModels, window)) { qDebug() << Q_FUNC_INFO << "Adding window" << window << "to our models"; emit windowAdded(QVariant::fromValue(static_cast<QQuickItem*>(window))); WindowModel::addWindowForEachModel(mWindowModels, window); } emit windowShown(QVariant::fromValue(static_cast<QQuickItem*>(window))); } else { qDebug() << __PRETTY_FUNCTION__ << " UNMAPPED " << window << "appId" << window->appId() << "windowType" << window->windowType(); if (window == mFullscreenWindow) setFullscreenWindow(0); emit windowHidden(QVariant::fromValue(static_cast<QQuickItem*>(window))); } } }
void Compositor::onSurfaceLowered() { QtWayland::ExtendedSurface *extSurface = qobject_cast<QtWayland::ExtendedSurface*>(sender()); QWaylandSurface *surface = qobject_cast<QWaylandSurface*>(extSurface->extensionContainer()); CompositorWindow *window = surfaceWindow(surface); qWarning() << Q_FUNC_INFO << "the window " << window << "is going to be lowered"; if (window) emit windowLowered(QVariant::fromValue(static_cast<QQuickItem*>(window))); }
bool Compositor::hasProcessMultipleWindows(QWaylandClient* client) { unsigned int count = 0; QList<QWaylandSurface *> surfaces = surfacesForClient(client); for (QWaylandSurface *surface : surfaces) { if (surfaceWindow(surface)) count++; } return count > 1; }
//-------------------------------------------------------------- // show the window void mgSimpleDesktop::showWindow( mgControl* contentPane) { mgSimpleWindow* window = findWindow(contentPane); if (window == NULL) return; mgDimension contentSize; window->getContentSize(contentSize); // if first show if (contentSize.m_width == 0) window->initContentSize(); mgDimension desktopSize; getSize(desktopSize); mgRectangle bounds; window->requestedBounds(desktopSize, bounds); window->setBounds(bounds); surfaceWindow(contentPane); window->setVisible(true); }