OSDN Git Service

generic: deprecation warnings fixes
authorIvailo Monev <xakepa10@gmail.com>
Sun, 11 Jul 2021 21:01:09 +0000 (00:01 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 11 Jul 2021 21:29:29 +0000 (00:29 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
krunner/main.cpp
kwin/composite.cpp
kwin/composite.h
kwin/kcmkwin/kwincompositing/main.cpp
kwin/kcmkwin/kwincompositing/main.h
kwin/kcmkwin/kwincompositing/main.ui
kwin/main.cpp

index 51cb1dd..55ff3df 100644 (file)
@@ -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") );
index 41c8c0d..81f40f7 100644 (file)
@@ -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();
index 7f5e8f1..3120c6b 100644 (file)
@@ -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;
index c98da1c..a884376 100644 (file)
@@ -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());
 
index 92369b5..0403034 100644 (file)
@@ -22,10 +22,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define __MAIN_H__
 
 #include <kcmodule.h>
-
 #include <ksharedconfig.h>
 #include <ktemporaryfile.h>
 
+#include <QLabel>
+
 #include "kwin_interface.h"
 
 #include "ui_main.h"
@@ -33,7 +34,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 class KPluginSelector;
 class KActionCollection;
-#include <QLabel>
 
 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;
index 3692e76..0eba9c1 100644 (file)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>583</width>
-    <height>389</height>
+    <height>367</height>
    </rect>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_4">
@@ -652,39 +652,6 @@ p, li { white-space: pre-wrap; }
            </item>
           </widget>
          </item>
-         <item row="1" column="0">
-          <widget class="QLabel" name="label_3">
-           <property name="text">
-            <string>Qt graphics system:</string>
-           </property>
-           <property name="alignment">
-            <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="QComboBox" name="graphicsSystem">
-           <property name="toolTip">
-            <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Segoe'; font-size:8pt;&quot;&gt;It is &lt;/span&gt;&lt;span style=&quot; font-family:'Segoe'; font-size:8pt; font-weight:600;&quot;&gt;strongly recommended&lt;/span&gt;&lt;span style=&quot; font-family:'Segoe'; font-size:8pt;&quot;&gt; to use the &lt;/span&gt;&lt;span style=&quot; font-family:'Segoe'; font-size:8pt; font-weight:600;&quot;&gt;native&lt;/span&gt;&lt;span style=&quot; font-family:'Segoe'; font-size:8pt;&quot;&gt; system when using the &lt;/span&gt;&lt;span style=&quot; font-family:'Segoe'; font-size:8pt; font-weight:600;&quot;&gt;XRender&lt;/span&gt;&lt;span style=&quot; font-family:'Segoe'; font-size:8pt;&quot;&gt; backend.&lt;/span&gt;&lt;/p&gt;
-&lt;p style=&quot;-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;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Segoe'; font-size:8pt;&quot;&gt;On the other hand, many decorations perform better with the &lt;/span&gt;&lt;span style=&quot; font-family:'Segoe'; font-size:8pt; font-weight:600;&quot;&gt;raster&lt;/span&gt;&lt;span style=&quot; font-family:'Segoe'; font-size:8pt;&quot;&gt; system (though some don't - also the impact here can be anything between &amp;quot;slight&amp;quot; and &amp;quot;incredible&amp;quot; depending on the GPU and driver)&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-           </property>
-           <item>
-            <property name="text">
-             <string>Native</string>
-            </property>
-           </item>
-           <item>
-            <property name="text">
-             <string>Raster</string>
-            </property>
-           </item>
-          </widget>
-         </item>
         </layout>
        </item>
        <item row="1" column="1">
@@ -744,7 +711,6 @@ p, li { white-space: pre-wrap; }
   <tabstop>animationSpeedCombo</tabstop>
   <tabstop>effectSelector</tabstop>
   <tabstop>compositingType</tabstop>
-  <tabstop>graphicsSystem</tabstop>
   <tabstop>windowThumbnails</tabstop>
   <tabstop>xrScaleFilter</tabstop>
   <tabstop>unredirectFullscreen</tabstop>
index ba05afb..b4ed561 100644 (file)
@@ -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",