Changeset View
Changeset View
Standalone View
Standalone View
workspace.cpp
Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Line(s) | |||||
171 | #ifdef KWIN_BUILD_TABBOX | 171 | #ifdef KWIN_BUILD_TABBOX | ||
172 | // need to create the tabbox before compositing scene is setup | 172 | // need to create the tabbox before compositing scene is setup | ||
173 | TabBox::TabBox::create(this); | 173 | TabBox::TabBox::create(this); | ||
174 | #endif | 174 | #endif | ||
175 | 175 | | |||
176 | if (Compositor::self()) { | 176 | if (Compositor::self()) { | ||
177 | m_compositor = Compositor::self(); | 177 | m_compositor = Compositor::self(); | ||
178 | } else { | 178 | } else { | ||
179 | m_compositor = Compositor::create(this); | 179 | Q_ASSERT(kwinApp()->operationMode() == Application::OperationMode::OperationModeX11); | ||
180 | m_compositor = X11Compositor::create(this); | ||||
180 | } | 181 | } | ||
181 | connect(this, &Workspace::currentDesktopChanged, m_compositor, &Compositor::addRepaintFull); | 182 | connect(this, &Workspace::currentDesktopChanged, m_compositor, &Compositor::addRepaintFull); | ||
182 | connect(m_compositor, &QObject::destroyed, this, [this] { m_compositor = nullptr; }); | 183 | connect(m_compositor, &QObject::destroyed, this, [this] { m_compositor = nullptr; }); | ||
183 | 184 | | |||
184 | auto decorationBridge = Decoration::DecorationBridge::create(this); | 185 | auto decorationBridge = Decoration::DecorationBridge::create(this); | ||
185 | decorationBridge->init(); | 186 | decorationBridge->init(); | ||
186 | connect(this, &Workspace::configChanged, decorationBridge, &Decoration::DecorationBridge::reconfigure); | 187 | connect(this, &Workspace::configChanged, decorationBridge, &Decoration::DecorationBridge::reconfigure); | ||
187 | 188 | | |||
▲ Show 20 Lines • Show All 393 Lines • ▼ Show 20 Line(s) | 579 | { | |||
581 | connect(c, &AbstractClient::minimizedChanged, this, std::bind(&Workspace::clientMinimizedChanged, this, c)); | 582 | connect(c, &AbstractClient::minimizedChanged, this, std::bind(&Workspace::clientMinimizedChanged, this, c)); | ||
582 | } | 583 | } | ||
583 | 584 | | |||
584 | Client* Workspace::createClient(xcb_window_t w, bool is_mapped) | 585 | Client* Workspace::createClient(xcb_window_t w, bool is_mapped) | ||
585 | { | 586 | { | ||
586 | StackingUpdatesBlocker blocker(this); | 587 | StackingUpdatesBlocker blocker(this); | ||
587 | Client* c = new Client(); | 588 | Client* c = new Client(); | ||
588 | setupClientConnections(c); | 589 | setupClientConnections(c); | ||
589 | connect(c, SIGNAL(blockingCompositingChanged(KWin::Client*)), m_compositor, SLOT(updateCompositeBlocking(KWin::Client*))); | 590 | | ||
591 | if (kwinApp()->operationMode() == Application::OperationModeX11) { | ||||
592 | connect(c, &Client::blockingCompositingChanged, static_cast<X11Compositor*>(m_compositor), &X11Compositor::updateClientCompositeBlocking); | ||||
593 | } | ||||
romangg: Unintended change. | |||||
590 | connect(c, SIGNAL(clientFullScreenSet(KWin::Client*,bool,bool)), ScreenEdges::self(), SIGNAL(checkBlocking())); | 594 | connect(c, SIGNAL(clientFullScreenSet(KWin::Client*,bool,bool)), ScreenEdges::self(), SIGNAL(checkBlocking())); | ||
591 | if (!c->manage(w, is_mapped)) { | 595 | if (!c->manage(w, is_mapped)) { | ||
592 | Client::deleteClient(c); | 596 | Client::deleteClient(c); | ||
593 | return NULL; | 597 | return NULL; | ||
594 | } | 598 | } | ||
595 | addClient(c); | 599 | addClient(c); | ||
596 | return c; | 600 | return c; | ||
597 | } | 601 | } | ||
598 | 602 | | |||
599 | Unmanaged* Workspace::createUnmanaged(xcb_window_t w) | 603 | Unmanaged* Workspace::createUnmanaged(xcb_window_t w) | ||
600 | { | 604 | { | ||
601 | if (m_compositor && m_compositor->checkForOverlayWindow(w)) | 605 | if (m_compositor && m_compositor->checkForOverlayWindow(w)) | ||
602 | return NULL; | 606 | return NULL; | ||
603 | Unmanaged* c = new Unmanaged(); | 607 | Unmanaged* c = new Unmanaged(); | ||
604 | if (!c->track(w)) { | 608 | if (!c->track(w)) { | ||
605 | Unmanaged::deleteUnmanaged(c); | 609 | Unmanaged::deleteUnmanaged(c); | ||
606 | return NULL; | 610 | return NULL; | ||
607 | } | 611 | } | ||
608 | connect(c, SIGNAL(needsRepaint()), m_compositor, SLOT(scheduleRepaint())); | 612 | connect(c, &Unmanaged::needsRepaint, m_compositor, &Compositor::scheduleRepaint); | ||
609 | addUnmanaged(c); | 613 | addUnmanaged(c); | ||
610 | emit unmanagedAdded(c); | 614 | emit unmanagedAdded(c); | ||
611 | return c; | 615 | return c; | ||
612 | } | 616 | } | ||
613 | 617 | | |||
614 | void Workspace::addClient(Client* c) | 618 | void Workspace::addClient(Client* c) | ||
615 | { | 619 | { | ||
616 | Group* grp = findGroup(c->window()); | 620 | Group* grp = findGroup(c->window()); | ||
▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Line(s) | 728 | { | |||
732 | } | 736 | } | ||
733 | const int index = stacking_order.indexOf(orig); | 737 | const int index = stacking_order.indexOf(orig); | ||
734 | if (index != -1) { | 738 | if (index != -1) { | ||
735 | stacking_order.replace(index, c); | 739 | stacking_order.replace(index, c); | ||
736 | } else { | 740 | } else { | ||
737 | stacking_order.append(c); | 741 | stacking_order.append(c); | ||
738 | } | 742 | } | ||
739 | markXStackingOrderAsDirty(); | 743 | markXStackingOrderAsDirty(); | ||
740 | connect(c, SIGNAL(needsRepaint()), m_compositor, SLOT(scheduleRepaint())); | 744 | connect(c, &Deleted::needsRepaint, m_compositor, &Compositor::scheduleRepaint); | ||
741 | } | 745 | } | ||
742 | 746 | | |||
743 | void Workspace::removeDeleted(Deleted* c) | 747 | void Workspace::removeDeleted(Deleted* c) | ||
744 | { | 748 | { | ||
745 | assert(deleted.contains(c)); | 749 | assert(deleted.contains(c)); | ||
746 | emit deletedRemoved(c); | 750 | emit deletedRemoved(c); | ||
747 | deleted.removeAll(c); | 751 | deleted.removeAll(c); | ||
748 | unconstrained_stacking_order.removeAll(c); | 752 | unconstrained_stacking_order.removeAll(c); | ||
749 | stacking_order.removeAll(c); | 753 | stacking_order.removeAll(c); | ||
750 | markXStackingOrderAsDirty(); | 754 | markXStackingOrderAsDirty(); | ||
751 | if (c->wasClient() && m_compositor) { | 755 | if (c->wasClient() && m_compositor && kwinApp()->operationMode() == Application::OperationModeX11) { | ||
752 | m_compositor->updateCompositeBlocking(); | 756 | static_cast<X11Compositor*>(m_compositor)->updateCompositeBlocking(); | ||
753 | } | 757 | } | ||
754 | } | 758 | } | ||
755 | 759 | | |||
756 | void Workspace::updateToolWindows(bool also_hide) | 760 | void Workspace::updateToolWindows(bool also_hide) | ||
757 | { | 761 | { | ||
758 | // TODO: What if Client's transiency/group changes? should this be called too? (I'm paranoid, am I not?) | 762 | // TODO: What if Client's transiency/group changes? should this be called too? (I'm paranoid, am I not?) | ||
759 | if (!options->isHideUtilityWindowsForInactive()) { | 763 | if (!options->isHideUtilityWindowsForInactive()) { | ||
760 | for (ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it) | 764 | for (ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it) | ||
▲ Show 20 Lines • Show All 1019 Lines • Show Last 20 Lines |
Unintended change.