add GUI config for graphicssystem
REVIEW: 103431
This commit is contained in:
parent
d845b60c6c
commit
19fceb5216
3 changed files with 69 additions and 9 deletions
|
@ -38,6 +38,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <knotification.h>
|
||||
|
||||
#include <QtDBus/QtDBus>
|
||||
#include <QPainter>
|
||||
#include <QPaintEngine>
|
||||
#include <QTimer>
|
||||
#include <QLabel>
|
||||
#include <KPluginFactory>
|
||||
|
@ -99,6 +101,7 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList
|
|||
|
||||
connect(ui.rearmGlSupportButton, SIGNAL(clicked()), this, SLOT(rearmGlSupport()));
|
||||
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()));
|
||||
|
||||
|
@ -111,6 +114,8 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList
|
|||
|
||||
connect(ui.compositingType, SIGNAL(currentIndexChanged(int)), this, SLOT(changed()));
|
||||
connect(ui.compositingType, SIGNAL(currentIndexChanged(int)), this, SLOT(toogleSmoothScaleUi(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.glScaleFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changed()));
|
||||
|
@ -303,6 +308,12 @@ void KWinCompositingConfig::rearmGlSupport()
|
|||
load();
|
||||
}
|
||||
|
||||
void KWinCompositingConfig::suggestGraphicsSystem()
|
||||
{
|
||||
if (!ui.useCompositing->isChecked() || ui.compositingType->currentIndex() == XRENDER_INDEX)
|
||||
ui.graphicsSystem->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
|
||||
void KWinCompositingConfig::toogleSmoothScaleUi(int compositingType)
|
||||
{
|
||||
|
@ -339,6 +350,16 @@ void KWinCompositingConfig::loadAdvancedTab()
|
|||
KConfigGroup config(mKWinConfig, "Compositing");
|
||||
QString backend = config.readEntry("Backend", "OpenGL");
|
||||
ui.compositingType->setCurrentIndex((backend == "XRender") ? XRENDER_INDEX : 0);
|
||||
|
||||
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
|
||||
|
@ -461,6 +482,7 @@ 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";
|
||||
|
||||
if (config.readEntry("Backend", "OpenGL")
|
||||
!= ((ui.compositingType->currentIndex() == OPENGL_INDEX) ? "OpenGL" : "XRender")
|
||||
|
@ -470,10 +492,14 @@ bool KWinCompositingConfig::saveAdvancedTab()
|
|||
advancedChanged = true;
|
||||
} else if (config.readEntry("HiddenPreviews", 5) != hps[ ui.windowThumbnails->currentIndex()]
|
||||
|| (int)config.readEntry("XRenderSmoothScale", false) != ui.xrScaleFilter->currentIndex()
|
||||
|| config.readEntry("GLTextureFilter", 2) != ui.glScaleFilter->currentIndex())
|
||||
|| config.readEntry("GLTextureFilter", 2) != ui.glScaleFilter->currentIndex()) {
|
||||
advancedChanged = true;
|
||||
} else if (originalGraphicsSystem != graphicsSystem) {
|
||||
advancedChanged = true;
|
||||
}
|
||||
|
||||
config.writeEntry("Backend", (ui.compositingType->currentIndex() == OPENGL_INDEX) ? "OpenGL" : "XRender");
|
||||
config.writeEntry("GraphicsSystem", graphicsSystem);
|
||||
config.writeEntry("HiddenPreviews", hps[ ui.windowThumbnails->currentIndex()]);
|
||||
config.writeEntry("UnredirectFullscreen", ui.unredirectFullscreen->isChecked());
|
||||
|
||||
|
|
|
@ -77,6 +77,7 @@ public slots:
|
|||
|
||||
private slots:
|
||||
void rearmGlSupport();
|
||||
void suggestGraphicsSystem();
|
||||
void toogleSmoothScaleUi(int compositingType);
|
||||
void toggleEffectShortcutChanged(const QKeySequence &seq);
|
||||
|
||||
|
@ -93,6 +94,7 @@ private:
|
|||
KSharedConfigPtr mTmpConfig;
|
||||
bool m_showConfirmDialog;
|
||||
KActionCollection* m_actionCollection;
|
||||
QString originalGraphicsSystem;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>552</width>
|
||||
<height>523</height>
|
||||
<height>483</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
|
@ -517,6 +517,39 @@
|
|||
</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><!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:'Segoe'; font-size:8pt; 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;">It is <span style=" font-weight:600;">strongly recommended</span> to use the <span style=" font-weight:600;">native</span> system when using the the <span style=" font-weight:600;">XRender</span> backend.</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;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">On the other hand, many decorations perform better with the <span style=" font-weight:600;">raster</span> system on the <span style=" font-weight:600;">default and generally preferred OpenGL</span> backend (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)</p></body></html></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="3">
|
||||
|
@ -810,16 +843,16 @@ On legacy hardware disabling Shaders can improve the performance.</string>
|
|||
<extends>QWidget</extends>
|
||||
<header>kkeysequencewidget.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>KTitleWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>ktitlewidget.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>KComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>kcombobox.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>KTitleWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>ktitlewidget.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>KPluginSelector</class>
|
||||
<extends>QWidget</extends>
|
||||
|
@ -832,7 +865,6 @@ On legacy hardware disabling Shaders can improve the performance.</string>
|
|||
<tabstop>useCompositing</tabstop>
|
||||
<tabstop>effectWinManagement</tabstop>
|
||||
<tabstop>effectAnimations</tabstop>
|
||||
<tabstop>windowSwitchingCombo</tabstop>
|
||||
<tabstop>desktopSwitchingCombo</tabstop>
|
||||
<tabstop>animationSpeedCombo</tabstop>
|
||||
</tabstops>
|
||||
|
|
Loading…
Reference in a new issue