From b4cbd8cb00be18b00c326485f29a2c530371d3ed Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 12 Jul 2021 00:01:09 +0300 Subject: [PATCH] generic: deprecation warnings fixes Signed-off-by: Ivailo Monev --- krunner/main.cpp | 6 ------ kwin/composite.cpp | 17 ++--------------- kwin/composite.h | 7 ------- kwin/kcmkwin/kwincompositing/main.cpp | 28 ++++----------------------- kwin/kcmkwin/kwincompositing/main.h | 6 ++---- kwin/kcmkwin/kwincompositing/main.ui | 36 +---------------------------------- kwin/main.cpp | 16 ---------------- 7 files changed, 9 insertions(+), 107 deletions(-) diff --git a/krunner/main.cpp b/krunner/main.cpp index 51cb1dd9..55ff3df0 100644 --- a/krunner/main.cpp +++ b/krunner/main.cpp @@ -39,12 +39,6 @@ static const char description[] = I18N_NOOP( "KDE run command interface" ); int main(int argc, char* argv[]) { -#ifdef Q_WS_X11 - // krunner only works properly with Qt's native X11 backend; override any compile-time - // or command line settings to raster or OpenGL. - QApplication::setGraphicsSystem(QLatin1String( "native" )); -#endif - KAboutData aboutData( "krunner", 0, ki18n( "Run Command Interface" ), KDE_VERSION_STRING, ki18n(description), KAboutData::License_GPL, ki18n("(c) 2006, Aaron Seigo") ); diff --git a/kwin/composite.cpp b/kwin/composite.cpp index 41c8c0d9..81f40f70 100644 --- a/kwin/composite.cpp +++ b/kwin/composite.cpp @@ -347,20 +347,15 @@ void Compositor::slotConfigChanged() if (effects) // setupCompositing() may fail effects->reconfigure(); addRepaintFull(); - } else + } else { finish(); + } } void Compositor::slotReinitialize() { // Reparse config. Config options will be reloaded by setup() KGlobal::config()->reparseConfiguration(); - const QString graphicsSystem = KConfigGroup(KGlobal::config(), "Compositing").readEntry("GraphicsSystem", ""); - if ((Extensions::nonNativePixmaps() && graphicsSystem == "native") || - (!Extensions::nonNativePixmaps() && (graphicsSystem == "raster" || graphicsSystem == "opengl")) ) { - restartKWin("explicitly reconfigured graphicsSystem change"); - return; - } // Restart compositing finish(); @@ -740,14 +735,6 @@ void Compositor::setOverlayWindowVisibility(bool visible) } } -void Compositor::restartKWin(const QString &reason) -{ - kDebug(1212) << "restarting kwin for:" << reason; - char cmd[1024]; // copied from crashhandler - maybe not the best way to do? - sprintf(cmd, "%s --replace &", QFile::encodeName(QCoreApplication::applicationFilePath()).constData()); - system(cmd); -} - bool Compositor::isCompositingPossible() const { return CompositingPrefs::compositingPossible(); diff --git a/kwin/composite.h b/kwin/composite.h index 7f5e8f17..3120c6b0 100644 --- a/kwin/composite.h +++ b/kwin/composite.h @@ -263,13 +263,6 @@ private: bool windowRepaintsPending() const; /** - * Restarts the Window Manager in case that the Qt's GraphicsSystem need to be changed - * for the chosen Compositing backend. - * @param reason The reason why the Window Manager is being restarted, this is logged - **/ - void restartKWin(const QString &reason); - - /** * Whether the Compositor is currently suspended, 8 bits encoding the reason **/ SuspendReasons m_suspended; diff --git a/kwin/kcmkwin/kwincompositing/main.cpp b/kwin/kcmkwin/kwincompositing/main.cpp index c98da1c2..a884376c 100644 --- a/kwin/kcmkwin/kwincompositing/main.cpp +++ b/kwin/kcmkwin/kwincompositing/main.cpp @@ -134,7 +134,6 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); connect(ui.useCompositing, SIGNAL(toggled(bool)), this, SLOT(changed())); - connect(ui.useCompositing, SIGNAL(clicked(bool)), this, SLOT(suggestGraphicsSystem())); connect(ui.effectWinManagement, SIGNAL(toggled(bool)), this, SLOT(changed())); connect(ui.effectAnimations, SIGNAL(toggled(bool)), this, SLOT(changed())); @@ -147,8 +146,6 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList connect(ui.compositingType, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); connect(ui.compositingType, SIGNAL(currentIndexChanged(int)), this, SLOT(alignGuiToCompositingType(int))); - connect(ui.compositingType, SIGNAL(activated(int)), this, SLOT(suggestGraphicsSystem())); - connect(ui.graphicsSystem, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); connect(ui.windowThumbnails, SIGNAL(activated(int)), this, SLOT(changed())); connect(ui.unredirectFullscreen , SIGNAL(toggled(bool)), this, SLOT(changed())); connect(ui.xrScaleFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); @@ -314,14 +311,9 @@ void KWinCompositingConfig::loadGeneralTab() ui.desktopSwitchingCombo->setCurrentIndex(1); } -void KWinCompositingConfig::suggestGraphicsSystem() -{ - if (!ui.useCompositing->isChecked() || ui.compositingType->currentIndex() == XRENDER_INDEX) - ui.graphicsSystem->setCurrentIndex(0); -} - void KWinCompositingConfig::alignGuiToCompositingType(int compositingType) { + ui.scaleMethodLabel->setVisible(compositingType == XRENDER_INDEX); ui.xrScaleFilter->setVisible(compositingType == XRENDER_INDEX); if (compositingType == XRENDER_INDEX) ui.scaleMethodLabel->setBuddy(ui.xrScaleFilter); @@ -357,15 +349,6 @@ void KWinCompositingConfig::loadAdvancedTab() ui.compositingType->setCurrentIndex(XRENDER_INDEX); } - originalGraphicsSystem = config.readEntry("GraphicsSystem", QString()); - if (originalGraphicsSystem.isEmpty()) { // detect system default - QPixmap pix(1,1); - QPainter p(&pix); - originalGraphicsSystem = (p.paintEngine()->type() == QPaintEngine::X11) ? "native" : "raster"; - p.end(); - } - ui.graphicsSystem->setCurrentIndex((originalGraphicsSystem == "native") ? 0 : 1); - // 4 - off, 5 - shown, 6 - always, other are old values int hps = config.readEntry("HiddenPreviews", 5); if (hps == 6) // always @@ -466,7 +449,6 @@ bool KWinCompositingConfig::saveAdvancedTab() static const int hps[] = { 6 /*always*/, 5 /*shown*/, 4 /*never*/ }; KConfigGroup config(mKWinConfig, "Compositing"); - QString graphicsSystem = (ui.graphicsSystem->currentIndex() == 0) ? "native" : "raster"; QString backend; @@ -477,15 +459,13 @@ bool KWinCompositingConfig::saveAdvancedTab() } if (config.readEntry("HiddenPreviews", 5) != hps[ ui.windowThumbnails->currentIndex()] - || (int)config.readEntry("XRenderSmoothScale", false) != ui.xrScaleFilter->currentIndex()) { - advancedChanged = true; - } else if (originalGraphicsSystem != graphicsSystem) { + || (int)config.readEntry("XRenderSmoothScale", false) != ui.xrScaleFilter->currentIndex() + || config.readEntry("Backend") != ui.compositingType->currentText()) { advancedChanged = true; } - config.writeEntry("Backend", backend); + config.writeEntry("Backend", backend); - config.writeEntry("GraphicsSystem", graphicsSystem); config.writeEntry("HiddenPreviews", hps[ ui.windowThumbnails->currentIndex()]); config.writeEntry("UnredirectFullscreen", ui.unredirectFullscreen->isChecked()); diff --git a/kwin/kcmkwin/kwincompositing/main.h b/kwin/kcmkwin/kwincompositing/main.h index 92369b50..0403034d 100644 --- a/kwin/kcmkwin/kwincompositing/main.h +++ b/kwin/kcmkwin/kwincompositing/main.h @@ -22,10 +22,11 @@ along with this program. If not, see . #define __MAIN_H__ #include - #include #include +#include + #include "kwin_interface.h" #include "ui_main.h" @@ -33,7 +34,6 @@ along with this program. If not, see . class KPluginSelector; class KActionCollection; -#include namespace KWin { @@ -78,7 +78,6 @@ public slots: private slots: void confirmReInit() { showConfirmDialog(true); } - void suggestGraphicsSystem(); void alignGuiToCompositingType(int compositingType); void toggleEffectShortcutChanged(const QKeySequence &seq); void updateStatusUI(bool compositingIsPossible); @@ -96,7 +95,6 @@ private: KSharedConfigPtr mTmpConfig; bool m_showConfirmDialog; KActionCollection* m_actionCollection; - QString originalGraphicsSystem; QAction *m_showDetailedErrors; QAction *m_dontShowAgain; QString m_externErrorDetails; diff --git a/kwin/kcmkwin/kwincompositing/main.ui b/kwin/kcmkwin/kwincompositing/main.ui index 3692e764..0eba9c15 100644 --- a/kwin/kcmkwin/kwincompositing/main.ui +++ b/kwin/kcmkwin/kwincompositing/main.ui @@ -7,7 +7,7 @@ 0 0 583 - 389 + 367 @@ -652,39 +652,6 @@ p, li { white-space: pre-wrap; } - - - - Qt graphics system: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Segoe'; font-size:8pt;">It is </span><span style=" font-family:'Segoe'; font-size:8pt; font-weight:600;">strongly recommended</span><span style=" font-family:'Segoe'; font-size:8pt;"> to use the </span><span style=" font-family:'Segoe'; font-size:8pt; font-weight:600;">native</span><span style=" font-family:'Segoe'; font-size:8pt;"> system when using the </span><span style=" font-family:'Segoe'; font-size:8pt; font-weight:600;">XRender</span><span style=" font-family:'Segoe'; font-size:8pt;"> backend.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Segoe'; font-size:8pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Segoe'; font-size:8pt;">On the other hand, many decorations perform better with the </span><span style=" font-family:'Segoe'; font-size:8pt; font-weight:600;">raster</span><span style=" font-family:'Segoe'; font-size:8pt;"> system (though some don't - also the impact here can be anything between &quot;slight&quot; and &quot;incredible&quot; depending on the GPU and driver)</span></p></body></html> - - - - Native - - - - - Raster - - - - @@ -744,7 +711,6 @@ p, li { white-space: pre-wrap; } animationSpeedCombo effectSelector compositingType - graphicsSystem windowThumbnails xrScaleFilter unredirectFullscreen diff --git a/kwin/main.cpp b/kwin/main.cpp index ba05afb0..b4ed561a 100644 --- a/kwin/main.cpp +++ b/kwin/main.cpp @@ -475,22 +475,6 @@ int main(int argc, char * argv[]) mallopt(M_TRIM_THRESHOLD, 5*pagesize); #endif // M_TRIM_THRESHOLD - // the raster graphicssystem has a quite terrible performance on the XRender backend or when not - // compositing at all while some to many decorations suffer from bad performance of the native - // graphicssystem (lack of implementation, QGradient internally uses the raster system and - // XPutImage's the result because some graphics drivers have insufficient or bad performing - // implementations of XRenderCreate*Gradient) - // - // Therefore we allow configurationa and do some automagic selection to discourage - // ""known to be stupid" ideas ;-P - // The invalid system parameter "" will use the systems default graphicssystem - // "!= XRender" is intended since eg. pot. SW backends likely would profit from raster as well - KConfigGroup config(KSharedConfig::openConfig("kwinrc"), "Compositing"); - QString preferredSystem("native"); - if (config.readEntry("Enabled", true) && config.readEntry("Backend", "XRender") != "XRender") - preferredSystem = ""; - QApplication::setGraphicsSystem(config.readEntry("GraphicsSystem", preferredSystem)); - Display* dpy = XOpenDisplay(NULL); if (!dpy) { fprintf(stderr, "%s: FATAL ERROR while trying to open display %s\n", -- 2.11.0