void LipstickCompositor::surfaceAboutToBeDestroyed(QWaylandSurface *surface) { Q_ASSERT(surface); LipstickCompositorWindow *item = static_cast<LipstickCompositorWindow *>(surface->surfaceItem()); surface->setSurfaceItem(0); if (surface == m_fullscreenSurface) setFullscreenSurface(0); if (item) { int id = item->windowId(); int gc = ghostWindowCount(); m_mappedSurfaces.remove(item->windowId()); emit windowCountChanged(); emit windowRemoved(item); item->m_windowClosed = true; item->tryRemove(); if (gc != ghostWindowCount()) emit ghostWindowCountChanged(); windowRemoved(id); emit availableWinIdsChanged(); } }
void LipstickCompositor::surfaceMapped() { QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); //Ignore surface if it's not a window surface if (!surface->hasShellSurface()) return; QVariantMap properties = surface->windowProperties(); QString category = properties.value("CATEGORY").toString(); if (surface->surfaceItem()) return; // The surface was mapped for the first time int id = m_nextWindowId++; LipstickCompositorWindow *item = new LipstickCompositorWindow(id, category, surface, contentItem()); item->setSize(surface->size()); QObject::connect(item, SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed())); m_totalWindowCount++; m_mappedSurfaces.insert(id, item); item->setTouchEventsEnabled(true); emit windowCountChanged(); emit windowAdded(item); windowAdded(id); emit availableWinIdsChanged(); }
void LipstickCompositor::surfaceUnmapped(LipstickCompositorProcWindow *item) { int id = item->windowId(); int gc = ghostWindowCount(); m_mappedSurfaces.remove(item->windowId()); emit windowCountChanged(); emit windowRemoved(item); item->m_windowClosed = true; item->tryRemove(); if (gc != ghostWindowCount()) emit ghostWindowCountChanged(); windowRemoved(id); emit availableWinIdsChanged(); }
void LauncherApplication::updateWindowCount() { Q_EMIT windowCountChanged(windowCount()); }