From kde-commits Thu Aug 04 12:51:25 2016 From: =?utf-8?q?Martin_Gr=C3=A4=C3=9Flin?= Date: Thu, 04 Aug 2016 12:51:25 +0000 To: kde-commits Subject: [kwin] /: Remove the unredirect fullscreen windows functionality Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=147031509607175 Git commit 996ee34e14ece93421fee7bf7447ecfa785871d1 by Martin Gr=C3=A4=C3= =9Flin. Committed on 04/08/2016 at 12:48. Pushed by graesslin into branch 'master'. Remove the unredirect fullscreen windows functionality Summary: Rational: unredirect fullscreen windows is a weird beast. It's intended to make fullscreen windows "faster" by not compositing that screen. But that doesn't really work as KWin jumps out of that condition pretty quickly. E.g. whenever a tooltip window is shown. KWin itself has a better functionality by supporting to block compositing completely. The complete code was full of hacks around it to try to ensure that things don't break. Overall unredirect fullscreen has always been the odd one. We had it because a compositor needs to have it, but it never got truly integrated. E.g. effects don't interact with it properly so that some things randomly work, others don't. Will it trigger the screenedge, probably yes, but will it show the highlight: properly no. By removing the functionality we finally acknowledge that this mode is not maintained and has not been maintained for years and that we do not intend to support it better in future. Over the years we tried to make it more and more hidden: it's disabled for Intel GPUs, because it used to crash KWin. It's marked as an "expert" option, etc. It's clearly something we tried to hide from the user that it exists. For Wayland the whole unredirect infrastructure doesn't make sense either. There is no such thing as "unredirecting". We might make use of passing buffers directly to the underlying stack, but that will be done automatically when we know it can be done, not by some magic is this a window of specific size. Test Plan: Compiles, cannot really test as I am an Intel user who never had that working. Reviewers: #kwin, #plasma, #vdg Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D2180 M +0 -2 abstract_egl_backend.cpp M +0 -9 client.cpp M +0 -1 client.h M +0 -151 composite.cpp M +0 -5 composite.h M +0 -1 deleted.h M +0 -1 effects.cpp M +0 -7 geometry.cpp M +0 -19 kcmkwin/kwincompositing/compositing.cpp M +0 -5 kcmkwin/kwincompositing/compositing.h M +2 -32 kcmkwin/kwincompositing/compositing.ui M +0 -15 kcmkwin/kwincompositing/main.cpp M +0 -3 kwin.kcfg M +0 -3 layers.cpp M +0 -22 options.cpp M +0 -8 options.h M +0 -2 plugins/platforms/x11/standalone/glxbackend.cpp M +0 -6 scene.cpp M +0 -7 scene.h M +0 -6 shell_client.cpp M +0 -1 shell_client.h M +0 -2 toplevel.cpp M +0 -11 toplevel.h M +0 -1 unmanaged.h M +0 -4 workspace.cpp http://commits.kde.org/kwin/996ee34e14ece93421fee7bf7447ecfa785871d1 diff --git a/abstract_egl_backend.cpp b/abstract_egl_backend.cpp index 7b4f756..e019d5c 100644 --- a/abstract_egl_backend.cpp +++ b/abstract_egl_backend.cpp @@ -112,8 +112,6 @@ void AbstractEglBackend::initKWinGL() initEGL(); GLPlatform *glPlatform =3D GLPlatform::instance(); glPlatform->detect(EglPlatformInterface); - if (GLPlatform::instance()->driver() =3D=3D Driver_Intel) - options->setUnredirectFullscreen(false); // bug #252817 options->setGlPreferBufferSwap(options->glPreferBufferSwap()); // reso= lve autosetting if (options->glPreferBufferSwap() =3D=3D Options::AutoSwapStrategy) options->setGlPreferBufferSwap('e'); // for unknown drivers - shou= ld not happen diff --git a/client.cpp b/client.cpp index aaa99be..c0f91e7 100644 --- a/client.cpp +++ b/client.cpp @@ -944,9 +944,6 @@ void Client::internalShow() m_decoInputExtent.map(); updateHiddenPreview(); } - if (Compositor::isCreated()) { - Compositor::self()->checkUnredirect(); - } emit windowShown(this); } = @@ -963,9 +960,6 @@ void Client::internalHide() addWorkspaceRepaint(visibleRect()); workspace()->clientHidden(this); emit windowHidden(this); - if (Compositor::isCreated()) { - Compositor::self()->checkUnredirect(); - } } = void Client::internalKeep() @@ -983,9 +977,6 @@ void Client::internalKeep() updateHiddenPreview(); addWorkspaceRepaint(visibleRect()); workspace()->clientHidden(this); - if (Compositor::isCreated()) { - Compositor::self()->checkUnredirect(); - } } = /** diff --git a/client.h b/client.h index 994cc47..331899d 100644 --- a/client.h +++ b/client.h @@ -391,7 +391,6 @@ private: = protected: virtual void debug(QDebug& stream) const; - virtual bool shouldUnredirect() const; void addDamage(const QRegion &damage) override; bool belongsToSameApplication(const AbstractClient *other, bool active= _hack) const override; void doSetActive() override; diff --git a/composite.cpp b/composite.cpp index 62775f6..3a40b00 100644 --- a/composite.cpp +++ b/composite.cpp @@ -89,7 +89,6 @@ Compositor::Compositor(QObject* workspace) , vBlankInterval(0) , fpsInterval(0) , m_xrrRefreshRate(0) - , forceUnredirectCheck(false) , m_finishing(false) , m_timeSinceLastVBlank(0) , m_scene(NULL) @@ -97,11 +96,8 @@ Compositor::Compositor(QObject* workspace) , m_composeAtSwapCompletion(false) { qRegisterMetaType("Compositor::SuspendReaso= n"); - connect(&unredirectTimer, SIGNAL(timeout()), SLOT(delayedCheckUnredire= ct())); connect(&compositeResetTimer, SIGNAL(timeout()), SLOT(restart())); connect(options, &Options::configChanged, this, &Compositor::slotConfi= gChanged); - connect(options, SIGNAL(unredirectFullscreenChanged()), SLOT(delayedCh= eckUnredirect())); - unredirectTimer.setSingleShot(true); compositeResetTimer.setSingleShot(true); nextPaintReference.invalidate(); // Initialize the timer = @@ -852,54 +848,6 @@ bool Compositor::isActive() return !m_finishing && hasScene(); } = -void Compositor::checkUnredirect() -{ - checkUnredirect(false); -} - -// force is needed when the list of windows changes (e.g. a window goes aw= ay) -void Compositor::checkUnredirect(bool force) -{ - if (!hasScene() || !m_scene->overlayWindow() || m_scene->overlayWindow= ()->window() =3D=3D None || !options->isUnredirectFullscreen()) - return; - if (force) - forceUnredirectCheck =3D true; - if (!unredirectTimer.isActive()) - unredirectTimer.start(0); -} - -void Compositor::delayedCheckUnredirect() -{ - if (!hasScene() || !m_scene->overlayWindow() || m_scene->overlayWindow= ()->window() =3D=3D None || !(options->isUnredirectFullscreen() || sender()= =3D=3D options)) - return; - ToplevelList list; - bool changed =3D forceUnredirectCheck; - foreach (Client * c, Workspace::self()->clientList()) - list.append(c); - foreach (Unmanaged * c, Workspace::self()->unmanagedList()) - list.append(c); - foreach (Toplevel * c, list) { - if (c->updateUnredirectedState()) { - changed =3D true; - break; - } - } - // no desktops, no Deleted ones - if (!changed) - return; - forceUnredirectCheck =3D false; - // Cut out parts from the overlay window where unredirected windows ar= e, - // so that they are actually visible. - const QSize &s =3D screens()->size(); - QRegion reg(0, 0, s.width(), s.height()); - foreach (Toplevel * c, list) { - if (c->unredirected()) - reg -=3D c->geometry(); - } - m_scene->overlayWindow()->setShape(reg); - addRepaint(reg); -} - bool Compositor::checkForOverlayWindow(WId w) const { if (!hasScene()) { @@ -971,9 +919,7 @@ bool Toplevel::setupCompositing() = damage_region =3D QRegion(0, 0, width(), height()); effect_window =3D new EffectWindowImpl(this); - unredirect =3D false; = - Compositor::self()->checkUnredirect(true); Compositor::self()->scene()->windowAdded(this); = // With unmanaged windows there is a race condition between the client= painting the window @@ -990,7 +936,6 @@ void Toplevel::finishCompositing(ReleaseReason releaseR= eason) { if (kwinApp()->operationMode() =3D=3D Application::OperationModeX11 &&= damage_handle =3D=3D XCB_NONE) return; - Compositor::self()->checkUnredirect(true); if (effect_window->window() =3D=3D this) { // otherwise it's already p= assed to Deleted, don't free data discardWindowPixmap(); delete effect_window; @@ -1200,41 +1145,6 @@ void Toplevel::addWorkspaceRepaint(const QRect& r2) Compositor::self()->addRepaint(r2); } = -bool Toplevel::updateUnredirectedState() -{ - assert(compositing()); - bool should =3D options->isUnredirectFullscreen() && shouldUnredirect(= ) && !unredirectSuspend && - !shape() && !hasAlpha() && opacity() =3D=3D 1.0 && - !static_cast(effects)->activeFullSc= reenEffect(); - if (should =3D=3D unredirect) - return false; - static QElapsedTimer lastUnredirect; - static const qint64 msecRedirectInterval =3D 100; - if (!lastUnredirect.hasExpired(msecRedirectInterval)) { - QTimer::singleShot(msecRedirectInterval, Compositor::self(), SLOT(= checkUnredirect())); - return false; - } - lastUnredirect.start(); - unredirect =3D should; - if (unredirect) { - qCDebug(KWIN_CORE) << "Unredirecting:" << this; - xcb_composite_unredirect_window(connection(), frameId(), XCB_COMPO= SITE_REDIRECT_MANUAL); - } else { - qCDebug(KWIN_CORE) << "Redirecting:" << this; - xcb_composite_redirect_window(connection(), frameId(), XCB_COMPOSI= TE_REDIRECT_MANUAL); - discardWindowPixmap(); - } - return true; -} - -void Toplevel::suspendUnredirect(bool suspend) -{ - if (unredirectSuspend =3D=3D suspend) - return; - unredirectSuspend =3D suspend; - Compositor::self()->checkUnredirect(); -} - //**************************************** // Client //**************************************** @@ -1264,65 +1174,4 @@ void Client::finishCompositing(ReleaseReason release= Reason) resetHaveResizeEffect(); } = -bool Client::shouldUnredirect() const -{ - if (isActiveFullScreen()) { - ToplevelList stacking =3D workspace()->xStackingOrder(); - for (int pos =3D stacking.count() - 1; - pos >=3D 0; - --pos) { - Toplevel* c =3D stacking.at(pos); - if (c =3D=3D this) // is not covered by any other window, ok= to unredirect - return true; - if (c->geometry().intersects(geometry())) - return false; - } - abort(); - } - return false; -} - - -//**************************************** -// Unmanaged -//**************************************** - -bool Unmanaged::shouldUnredirect() const -{ - // the pixmap is needed for the login effect, a nicer solution would b= e the login effect increasing - // refcount for the window pixmap (which would prevent unredirect), av= oiding this hack - if (resourceClass() =3D=3D "ksplashx" - || resourceClass() =3D=3D "ksplashsimple" - || resourceClass() =3D=3D "ksplashqml" - ) - return false; -// it must cover whole display or one xinerama screen, and be the topmost = there - const int desktop =3D VirtualDesktopManager::self()->current(); - if (geometry() =3D=3D workspace()->clientArea(FullArea, geometry().cen= ter(), desktop) - || geometry() =3D=3D workspace()->clientArea(ScreenArea, geome= try().center(), desktop)) { - ToplevelList stacking =3D workspace()->xStackingOrder(); - for (int pos =3D stacking.count() - 1; - pos >=3D 0; - --pos) { - Toplevel* c =3D stacking.at(pos); - if (c =3D=3D this) // is not covered by any other window, ok= to unredirect - return true; - if (c->geometry().intersects(geometry())) - return false; - } - abort(); - } - return false; -} - -//**************************************** -// Deleted -//**************************************** - -bool Deleted::shouldUnredirect() const -{ - return false; -} - - } // namespace diff --git a/composite.h b/composite.h index 50134cb..a1690e2 100644 --- a/composite.h +++ b/composite.h @@ -166,8 +166,6 @@ public Q_SLOTS: * Schedules a new repaint if no repaint is currently scheduled. **/ void scheduleRepaint(); - void checkUnredirect(); - void checkUnredirect(bool force); void updateCompositeBlocking(); void updateCompositeBlocking(KWin::Client* c); = @@ -205,7 +203,6 @@ private Q_SLOTS: void restart(); void fallbackToXRenderCompositing(); void performCompositing(); - void delayedCheckUnredirect(); void slotConfigChanged(); void releaseCompositorSelection(); void deleteUnusedSupportProperties(); @@ -234,8 +231,6 @@ private: QElapsedTimer nextPaintReference; QRegion repaints_region; = - QTimer unredirectTimer; - bool forceUnredirectCheck; QTimer compositeResetTimer; // for compressing composite resets bool m_finishing; // finish() sets this variable while shutting down bool m_starting; // start() sets this variable while starting diff --git a/deleted.h b/deleted.h index 70af56f..0aa88e7 100644 --- a/deleted.h +++ b/deleted.h @@ -94,7 +94,6 @@ public: } protected: virtual void debug(QDebug& stream) const; - virtual bool shouldUnredirect() const; private Q_SLOTS: void mainClientClosed(KWin::Toplevel *client); private: diff --git a/effects.cpp b/effects.cpp index 951b945..2fe0efd 100644 --- a/effects.cpp +++ b/effects.cpp @@ -681,7 +681,6 @@ void EffectsHandlerImpl::slotPaddingChanged(Toplevel* t= , const QRect& old) void EffectsHandlerImpl::setActiveFullScreenEffect(Effect* e) { fullscreen_effect =3D e; - m_compositor->checkUnredirect(); } = Effect* EffectsHandlerImpl::activeFullScreenEffect() const diff --git a/geometry.cpp b/geometry.cpp index 30d6bcc..73507b2 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -84,9 +84,6 @@ void Workspace::desktopResized() if (effects) { static_cast(effects)->desktopResized(geom.siz= e()); } - - //Update the shape of the overlay window to fix redrawing of unredirec= ted windows. bug#305781 - m_compositor->checkUnredirect(true); } = void Workspace::saveOldScreenSizes() @@ -2108,10 +2105,6 @@ void AbstractClient::move(int x, int y, ForceGeometr= y_t force) updateWindowRules(Rules::Position); screens()->setCurrent(this); workspace()->updateStackingOrder(); - if (Compositor::isCreated()) { - // TODO: move out of geometry.cpp, is this really needed here? - Compositor::self()->checkUnredirect(); - } // client itself is not damaged addRepaintDuringGeometryUpdates(); updateGeometryBeforeUpdateBlocking(); diff --git a/kcmkwin/kwincompositing/compositing.cpp b/kcmkwin/kwincomposit= ing/compositing.cpp index 1e02f77..76ce659 100644 --- a/kcmkwin/kwincompositing/compositing.cpp +++ b/kcmkwin/kwincompositing/compositing.cpp @@ -41,7 +41,6 @@ Compositing::Compositing(QObject *parent) , m_windowThumbnail(0) , m_glScaleFilter(0) , m_xrScaleFilter(false) - , m_unredirectFullscreen(false) , m_glSwapStrategy(0) , m_glColorCorrection(false) , m_compositingType(0) @@ -55,7 +54,6 @@ Compositing::Compositing(QObject *parent) connect(this, &Compositing::windowThumbnailChanged, this, &Compos= iting::changed); connect(this, &Compositing::glScaleFilterChanged, this, &Compos= iting::changed); connect(this, &Compositing::xrScaleFilterChanged, this, &Compos= iting::changed); - connect(this, &Compositing::unredirectFullscreenChanged, this, &Compos= iting::changed); connect(this, &Compositing::glSwapStrategyChanged, this, &Compos= iting::changed); connect(this, &Compositing::glColorCorrectionChanged, this, &Compos= iting::changed); connect(this, &Compositing::compositingTypeChanged, this, &Compos= iting::changed); @@ -74,7 +72,6 @@ void Compositing::reset() setWindowThumbnail(kwinConfig.readEntry("HiddenPreviews", 5) - 4); setGlScaleFilter(kwinConfig.readEntry("GLTextureFilter", 2)); setXrScaleFilter(kwinConfig.readEntry("XRenderSmoothScale", false)); - setUnredirectFullscreen(kwinConfig.readEntry("UnredirectFullscreen", f= alse)); setCompositingEnabled(kwinConfig.readEntry("Enabled", true)); = auto swapStrategy =3D [&kwinConfig]() { @@ -124,7 +121,6 @@ void Compositing::defaults() setWindowThumbnail(1); setGlScaleFilter(2); setXrScaleFilter(false); - setUnredirectFullscreen(false); setGlSwapStrategy(1); setGlColorCorrection(false); setCompositingType(CompositingType::OPENGL20_INDEX); @@ -188,11 +184,6 @@ bool Compositing::xrScaleFilter() const return m_xrScaleFilter; } = -bool Compositing::unredirectFullscreen() const -{ - return m_unredirectFullscreen; -} - int Compositing::glSwapStrategy() const { return m_glSwapStrategy; @@ -249,15 +240,6 @@ void Compositing::setGlSwapStrategy(int strategy) emit glSwapStrategyChanged(strategy); } = -void Compositing::setUnredirectFullscreen(bool unredirect) -{ - if (unredirect =3D=3D m_unredirectFullscreen) { - return; - } - m_unredirectFullscreen =3D unredirect; - emit unredirectFullscreenChanged(unredirect); -} - void Compositing::setWindowThumbnail(int index) { if (index =3D=3D m_windowThumbnail) { @@ -302,7 +284,6 @@ void Compositing::save() kwinConfig.writeEntry("HiddenPreviews", windowThumbnail() + 4); kwinConfig.writeEntry("GLTextureFilter", glScaleFilter()); kwinConfig.writeEntry("XRenderSmoothScale", xrScaleFilter()); - kwinConfig.writeEntry("UnredirectFullscreen", unredirectFullscreen()); kwinConfig.writeEntry("Enabled", compositingEnabled()); auto swapStrategy =3D [this] { switch (glSwapStrategy()) { diff --git a/kcmkwin/kwincompositing/compositing.h b/kcmkwin/kwincompositin= g/compositing.h index e9561ab..00dcb15 100644 --- a/kcmkwin/kwincompositing/compositing.h +++ b/kcmkwin/kwincompositing/compositing.h @@ -38,7 +38,6 @@ class Compositing : public QObject Q_PROPERTY(int windowThumbnail READ windowThumbnail WRITE setWindowThu= mbnail NOTIFY windowThumbnailChanged) Q_PROPERTY(int glScaleFilter READ glScaleFilter WRITE setGlScaleFilter= NOTIFY glScaleFilterChanged) Q_PROPERTY(bool xrScaleFilter READ xrScaleFilter WRITE setXrScaleFilte= r NOTIFY xrScaleFilterChanged) - Q_PROPERTY(bool unredirectFullscreen READ unredirectFullscreen WRITE s= etUnredirectFullscreen NOTIFY unredirectFullscreenChanged) Q_PROPERTY(int glSwapStrategy READ glSwapStrategy WRITE setGlSwapStrat= egy NOTIFY glSwapStrategyChanged) Q_PROPERTY(bool glColorCorrection READ glColorCorrection WRITE setGlCo= lorCorrection NOTIFY glColorCorrectionChanged) Q_PROPERTY(int compositingType READ compositingType WRITE setCompositi= ngType NOTIFY compositingTypeChanged) @@ -55,7 +54,6 @@ public: int windowThumbnail() const; int glScaleFilter() const; bool xrScaleFilter() const; - bool unredirectFullscreen() const; int glSwapStrategy() const; bool glColorCorrection() const; int compositingType() const; @@ -68,7 +66,6 @@ public: void setWindowThumbnail(int index); void setGlScaleFilter(int index); void setXrScaleFilter(bool filter); - void setUnredirectFullscreen(bool unredirect); void setGlSwapStrategy(int strategy); void setGlColorCorrection(bool correction); void setCompositingType(int index); @@ -87,7 +84,6 @@ Q_SIGNALS: void windowThumbnailChanged(int); void glScaleFilterChanged(int); void xrScaleFilterChanged(int); - void unredirectFullscreenChanged(bool); void glSwapStrategyChanged(int); void glColorCorrectionChanged(bool); void compositingTypeChanged(int); @@ -99,7 +95,6 @@ private: int m_windowThumbnail; int m_glScaleFilter; bool m_xrScaleFilter; - bool m_unredirectFullscreen; int m_glSwapStrategy; bool m_glColorCorrection; int m_compositingType; diff --git a/kcmkwin/kwincompositing/compositing.ui b/kcmkwin/kwincompositi= ng/compositing.ui index 8a39bf5..ef1343c 100644 --- a/kcmkwin/kwincompositing/compositing.ui +++ b/kcmkwin/kwincompositing/compositing.ui @@ -7,7 +7,7 @@ 0 0 481 - 415 + 349 @@ -81,22 +81,6 @@ Alternatively, you might want to use the XRender backend= instead. - - - - false - - - Having full screen windows bypass the compositor is not su= pported on every hardware. - - - true - - - KMessageWidget::Information - - - @@ -298,27 +282,13 @@ Alternatively, you might want to use the XRender back= end instead. - - - Expert: - - - - - - - Suspend compositor for full screen windows - - - - Experimental: - + Enable color correction diff --git a/kcmkwin/kwincompositing/main.cpp b/kcmkwin/kwincompositing/mai= n.cpp index a0d8e95..2d03829 100644 --- a/kcmkwin/kwincompositing/main.cpp +++ b/kcmkwin/kwincompositing/main.cpp @@ -86,7 +86,6 @@ KWinCompositingSettings::KWinCompositingSettings(QWidget = *parent, const QVariant m_form.scaleWarning->setIcon(QIcon::fromTheme(QStringLiteral("dialog-w= arning"))); m_form.tearingWarning->setIcon(QIcon::fromTheme(QStringLiteral("dialog= -warning"))); m_form.windowThumbnailWarning->setIcon(QIcon::fromTheme(QStringLiteral= ("dialog-warning"))); - m_form.unredirectInformation->setIcon(QIcon::fromTheme(QStringLiteral(= "dialog-information"))); = init(); } @@ -165,20 +164,6 @@ void KWinCompositingSettings::init() } ); = - // unredirect fullscreen - m_form.unredirectFullscreen->setChecked(m_compositing->unredirectFulls= creen()); - connect(m_compositing, &Compositing::unredirectFullscreenChanged, m_fo= rm.unredirectFullscreen, &QCheckBox::setChecked); - connect(m_form.unredirectFullscreen, &QCheckBox::toggled, m_compositin= g, &Compositing::setUnredirectFullscreen); - connect(m_form.unredirectFullscreen, &QCheckBox::toggled, - [this](bool enabled) { - if (enabled) { - m_form.unredirectInformation->animatedShow(); - } else { - m_form.unredirectInformation->animatedHide(); - } - } - ); - // color correction m_form.colorCorrection->setChecked(m_compositing->glColorCorrection()); connect(m_compositing, &Compositing::glColorCorrectionChanged, m_form.= colorCorrection, &QCheckBox::setChecked); diff --git a/kwin.kcfg b/kwin.kcfg index 5846721..763482c 100644 --- a/kwin.kcfg +++ b/kwin.kcfg @@ -254,9 +254,6 @@ 4 6 - - false - 3 0 diff --git a/layers.cpp b/layers.cpp index 2edfda0..a368def 100644 --- a/layers.cpp +++ b/layers.cpp @@ -722,9 +722,6 @@ ToplevelList Workspace::xStackingOrder() const x_stacking << c; } } - if (m_compositor) { - const_cast< Workspace* >(this)->m_compositor->checkUnredirect(); - } return x_stacking; } = diff --git a/options.cpp b/options.cpp index dbd957f..124593e 100644 --- a/options.cpp +++ b/options.cpp @@ -114,7 +114,6 @@ Options::Options(QObject *parent) , m_useCompositing(Options::defaultUseCompositing()) , m_compositingInitialized(Options::defaultCompositingInitialized()) , m_hiddenPreviews(Options::defaultHiddenPreviews()) - , m_unredirectFullscreen(Options::defaultUnredirectFullscreen()) , m_glSmoothScale(Options::defaultGlSmoothScale()) , m_colorCorrected(Options::defaultColorCorrected()) , m_xrenderSmoothScale(Options::defaultXrenderSmoothScale()) @@ -634,20 +633,6 @@ void Options::setHiddenPreviews(int hiddenPreviews) emit hiddenPreviewsChanged(); } = -void Options::setUnredirectFullscreen(bool unredirectFullscreen) -{ - if (GLPlatform::instance()->driver() =3D=3D Driver_Intel) - unredirectFullscreen =3D false; // bug #252817 - if (m_unredirectFullscreen =3D=3D unredirectFullscreen) { - return; - } - if (GLPlatform::instance()->driver() =3D=3D Driver_Intel) { // write b= ack the value - KConfigGroup(m_settings->config(), "Compositing").writeEntry("Unre= directFullscreen", false); - } - m_unredirectFullscreen =3D unredirectFullscreen; - emit unredirectFullscreenChanged(); -} - void Options::setGlSmoothScale(int glSmoothScale) { if (m_glSmoothScale =3D=3D glSmoothScale) { @@ -1007,7 +992,6 @@ void Options::reloadCompositingSettings(bool force) previews =3D HiddenPreviewsAlways; setHiddenPreviews(previews); = - setUnredirectFullscreen(config.readEntry("UnredirectFullscreen", Optio= ns::defaultUnredirectFullscreen())); // TOOD: add setter animationSpeed =3D qBound(0, config.readEntry("AnimationSpeed", Option= s::defaultAnimationSpeed()), 6); = @@ -1162,10 +1146,4 @@ bool Options::isUseCompositing() const return m_useCompositing || kwinApp()->platform()->requiresCompositing(= ); } = - -bool Options::isUnredirectFullscreen() const -{ - return m_unredirectFullscreen && !kwinApp()->platform()->requiresCompo= siting(); -} - } // namespace diff --git a/options.h b/options.h index 30c3899..7f4bb0e 100644 --- a/options.h +++ b/options.h @@ -169,7 +169,6 @@ class KWIN_EXPORT Options : public QObject Q_PROPERTY(bool useCompositing READ isUseCompositing WRITE setUseCompo= siting NOTIFY useCompositingChanged) Q_PROPERTY(bool compositingInitialized READ isCompositingInitialized W= RITE setCompositingInitialized NOTIFY compositingInitializedChanged) Q_PROPERTY(int hiddenPreviews READ hiddenPreviews WRITE setHiddenPrevi= ews NOTIFY hiddenPreviewsChanged) - Q_PROPERTY(bool unredirectFullscreen READ isUnredirectFullscreen WRITE= setUnredirectFullscreen NOTIFY unredirectFullscreenChanged) /** * 0 =3D no, 1 =3D yes when transformed, * 2 =3D try trilinear when transformed; else 1, @@ -551,7 +550,6 @@ public: HiddenPreviews hiddenPreviews() const { return m_hiddenPreviews; } - bool isUnredirectFullscreen() const; // OpenGL // 0 =3D no, 1 =3D yes when transformed, // 2 =3D try trilinear when transformed; else 1, @@ -648,7 +646,6 @@ public: void setUseCompositing(bool useCompositing); void setCompositingInitialized(bool compositingInitialized); void setHiddenPreviews(int hiddenPreviews); - void setUnredirectFullscreen(bool unredirectFullscreen); void setGlSmoothScale(int glSmoothScale); void setXrenderSmoothScale(bool xrenderSmoothScale); void setMaxFpsInterval(qint64 maxFpsInterval); @@ -736,9 +733,6 @@ public: static HiddenPreviews defaultHiddenPreviews() { return HiddenPreviewsShown; } - static bool defaultUnredirectFullscreen() { - return false; - } static int defaultGlSmoothScale() { return 2; } @@ -843,7 +837,6 @@ Q_SIGNALS: void useCompositingChanged(); void compositingInitializedChanged(); void hiddenPreviewsChanged(); - void unredirectFullscreenChanged(); void glSmoothScaleChanged(); void colorCorrectedChanged(); void xrenderSmoothScaleChanged(); @@ -892,7 +885,6 @@ private: bool m_useCompositing; bool m_compositingInitialized; HiddenPreviews m_hiddenPreviews; - bool m_unredirectFullscreen; int m_glSmoothScale; bool m_colorCorrected; bool m_xrenderSmoothScale; diff --git a/plugins/platforms/x11/standalone/glxbackend.cpp b/plugins/plat= forms/x11/standalone/glxbackend.cpp index 94ef225..abe6f83 100644 --- a/plugins/platforms/x11/standalone/glxbackend.cpp +++ b/plugins/platforms/x11/standalone/glxbackend.cpp @@ -173,8 +173,6 @@ void GlxBackend::init() // Initialize OpenGL GLPlatform *glPlatform =3D GLPlatform::instance(); glPlatform->detect(GlxPlatformInterface); - if (GLPlatform::instance()->driver() =3D=3D Driver_Intel) - options->setUnredirectFullscreen(false); // bug #252817 options->setGlPreferBufferSwap(options->glPreferBufferSwap()); // reso= lve autosetting if (options->glPreferBufferSwap() =3D=3D Options::AutoSwapStrategy) options->setGlPreferBufferSwap('e'); // for unknown drivers - shou= ld not happen diff --git a/scene.cpp b/scene.cpp index 9f31c89..6f4aec3 100644 --- a/scene.cpp +++ b/scene.cpp @@ -234,9 +234,6 @@ void Scene::paintGenericScreen(int orig_mask, ScreenPai= ntData) continue; } phase2.append(Phase2Data(w, infiniteRegion(), data.clip, data.mask= , data.quads)); - // transformations require window pixmap - w->suspendUnredirect(data.mask - & (PAINT_WINDOW_TRANSLUCENT | PAINT_SCREEN_TR= ANSFORMED | PAINT_WINDOW_TRANSFORMED)); } = foreach (const Phase2Data & d, phase2) { @@ -309,15 +306,12 @@ void Scene::paintSimpleScreen(int orig_mask, QRegion = region) } #endif if (!w->isPaintingEnabled()) { - w->suspendUnredirect(true); continue; } dirtyArea |=3D data.paint; // Schedule the window for painting phase2data.append(QPair< Window*, Phase2Data >(w,Phase2Data(w, dat= a.paint, data.clip, data.m= ask, data.quads))); - // no transformations, but translucency requires window pixmap - w->suspendUnredirect(data.mask & PAINT_WINDOW_TRANSLUCENT); } = // Save the part of the repaint region that's exclusively rendered to diff --git a/scene.h b/scene.h index 58280a5..c5ee865 100644 --- a/scene.h +++ b/scene.h @@ -275,7 +275,6 @@ public: void updateToplevel(Toplevel* c); // creates initial quad list for the window virtual WindowQuadList buildQuads(bool force =3D false) const; - void suspendUnredirect(bool suspend); void updateShadow(Shadow* shadow); const Shadow* shadow() const; Shadow* shadow(); @@ -535,12 +534,6 @@ void Scene::Window::updateToplevel(Toplevel* c) } = inline -void Scene::Window::suspendUnredirect(bool suspend) -{ - toplevel->suspendUnredirect(suspend); -} - -inline void Scene::Window::updateShadow(Shadow* shadow) { m_shadow =3D shadow; diff --git a/shell_client.cpp b/shell_client.cpp index 887c5a6..9e4a0a5 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -322,12 +322,6 @@ Layer ShellClient::layerForDock() const return AbstractClient::layerForDock(); } = -bool ShellClient::shouldUnredirect() const -{ - // TODO: unredirect for fullscreen - return false; -} - QRect ShellClient::transparentRect() const { // TODO: implement diff --git a/shell_client.h b/shell_client.h index 26b70c3..4f32b03 100644 --- a/shell_client.h +++ b/shell_client.h @@ -50,7 +50,6 @@ public: QPoint clientContentPos() const override; QSize clientSize() const override; QRect transparentRect() const override; - bool shouldUnredirect() const override; NET::WindowType windowType(bool direct =3D false, int supported_types = =3D 0) const override; void debug(QDebug &stream) const override; double opacity() const override; diff --git a/toplevel.cpp b/toplevel.cpp index 1407aec..579bdd7 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -50,8 +50,6 @@ Toplevel::Toplevel() , effect_window(NULL) , m_clientMachine(new ClientMachine(this)) , wmClientLeaderWin(0) - , unredirect(false) - , unredirectSuspend(false) , m_damageReplyPending(false) , m_screen(0) , m_skipCloseAnimation(false) diff --git a/toplevel.h b/toplevel.h index c80ffd3..0db6145 100644 --- a/toplevel.h +++ b/toplevel.h @@ -295,9 +295,6 @@ public: bool hasAlpha() const; virtual bool setupCompositing(); virtual void finishCompositing(ReleaseReason releaseReason =3D Release= Reason::Release); - bool updateUnredirectedState(); - bool unredirected() const; - void suspendUnredirect(bool suspend); Q_INVOKABLE void addRepaint(const QRect& r); Q_INVOKABLE void addRepaint(const QRegion& r); Q_INVOKABLE void addRepaint(int x, int y, int w, int h); @@ -500,7 +497,6 @@ protected: void disownDataPassedToDeleted(); friend QDebug& operator<<(QDebug& stream, const Toplevel*); void deleteEffectWindow(); - virtual bool shouldUnredirect() const =3D 0; void setDepth(int depth); QRect geom; xcb_visualid_t m_visual; @@ -524,8 +520,6 @@ private: QByteArray resource_class; ClientMachine *m_clientMachine; WId wmClientLeaderWin; - bool unredirect; - bool unredirectSuspend; // when unredirected, but pixmap is needed tem= porarily bool m_damageReplyPending; QRegion opaque_region; xcb_xfixes_fetch_region_cookie_t m_regionCookie; @@ -763,11 +757,6 @@ inline QByteArray Toplevel::resourceClass() const return resource_class; // it is always lowercase } = -inline bool Toplevel::unredirected() const -{ - return unredirect; -} - inline const ClientMachine *Toplevel::clientMachine() const { return m_clientMachine; diff --git a/unmanaged.h b/unmanaged.h index 31aea04..6cee6c1 100644 --- a/unmanaged.h +++ b/unmanaged.h @@ -51,7 +51,6 @@ public Q_SLOTS: void release(ReleaseReason releaseReason =3D ReleaseReason::Release); protected: virtual void debug(QDebug& stream) const; - virtual bool shouldUnredirect() const; private: virtual ~Unmanaged(); // use release() // handlers for X11 events diff --git a/workspace.cpp b/workspace.cpp index dd6dee8..a7f3961 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -495,10 +495,6 @@ Client* Workspace::createClient(xcb_window_t w, bool i= s_mapped) StackingUpdatesBlocker blocker(this); Client* c =3D new Client(); setupClientConnections(c); - connect(c, &Client::activeChanged, m_compositor, static_cast(&Compositor::checkUnredirect)); - connect(c, SIGNAL(fullScreenChanged()), m_compositor, SLOT(checkUnredi= rect())); - connect(c, SIGNAL(geometryChanged()), m_compositor, SLOT(checkUnredire= ct())); - connect(c, SIGNAL(geometryShapeChanged(KWin::Toplevel*,QRect)), m_comp= ositor, SLOT(checkUnredirect())); connect(c, SIGNAL(blockingCompositingChanged(KWin::Client*)), m_compos= itor, SLOT(updateCompositeBlocking(KWin::Client*))); connect(c, SIGNAL(clientFullScreenSet(KWin::Client*,bool,bool)), Scree= nEdges::self(), SIGNAL(checkBlocking())); if (!c->manage(w, is_mapped)) {