mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
generic: deprecation warnings fixes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
832d9c3ee0
commit
b4cbd8cb00
7 changed files with 9 additions and 107 deletions
|
@ -39,12 +39,6 @@ static const char description[] = I18N_NOOP( "KDE run command interface" );
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
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" ),
|
KAboutData aboutData( "krunner", 0, ki18n( "Run Command Interface" ),
|
||||||
KDE_VERSION_STRING, ki18n(description), KAboutData::License_GPL,
|
KDE_VERSION_STRING, ki18n(description), KAboutData::License_GPL,
|
||||||
ki18n("(c) 2006, Aaron Seigo") );
|
ki18n("(c) 2006, Aaron Seigo") );
|
||||||
|
|
|
@ -347,20 +347,15 @@ void Compositor::slotConfigChanged()
|
||||||
if (effects) // setupCompositing() may fail
|
if (effects) // setupCompositing() may fail
|
||||||
effects->reconfigure();
|
effects->reconfigure();
|
||||||
addRepaintFull();
|
addRepaintFull();
|
||||||
} else
|
} else {
|
||||||
finish();
|
finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Compositor::slotReinitialize()
|
void Compositor::slotReinitialize()
|
||||||
{
|
{
|
||||||
// Reparse config. Config options will be reloaded by setup()
|
// Reparse config. Config options will be reloaded by setup()
|
||||||
KGlobal::config()->reparseConfiguration();
|
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
|
// Restart compositing
|
||||||
finish();
|
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
|
bool Compositor::isCompositingPossible() const
|
||||||
{
|
{
|
||||||
return CompositingPrefs::compositingPossible();
|
return CompositingPrefs::compositingPossible();
|
||||||
|
|
|
@ -262,13 +262,6 @@ private:
|
||||||
void setCompositeTimer();
|
void setCompositeTimer();
|
||||||
bool windowRepaintsPending() const;
|
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
|
* Whether the Compositor is currently suspended, 8 bits encoding the reason
|
||||||
**/
|
**/
|
||||||
|
|
|
@ -134,7 +134,6 @@ KWinCompositingConfig::KWinCompositingConfig(QWidget *parent, const QVariantList
|
||||||
connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int)));
|
connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int)));
|
||||||
|
|
||||||
connect(ui.useCompositing, SIGNAL(toggled(bool)), this, SLOT(changed()));
|
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.effectWinManagement, SIGNAL(toggled(bool)), this, SLOT(changed()));
|
||||||
connect(ui.effectAnimations, 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(changed()));
|
||||||
connect(ui.compositingType, SIGNAL(currentIndexChanged(int)), this, SLOT(alignGuiToCompositingType(int)));
|
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.windowThumbnails, SIGNAL(activated(int)), this, SLOT(changed()));
|
||||||
connect(ui.unredirectFullscreen , SIGNAL(toggled(bool)), this, SLOT(changed()));
|
connect(ui.unredirectFullscreen , SIGNAL(toggled(bool)), this, SLOT(changed()));
|
||||||
connect(ui.xrScaleFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changed()));
|
connect(ui.xrScaleFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(changed()));
|
||||||
|
@ -314,14 +311,9 @@ void KWinCompositingConfig::loadGeneralTab()
|
||||||
ui.desktopSwitchingCombo->setCurrentIndex(1);
|
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)
|
void KWinCompositingConfig::alignGuiToCompositingType(int compositingType)
|
||||||
{
|
{
|
||||||
|
ui.scaleMethodLabel->setVisible(compositingType == XRENDER_INDEX);
|
||||||
ui.xrScaleFilter->setVisible(compositingType == XRENDER_INDEX);
|
ui.xrScaleFilter->setVisible(compositingType == XRENDER_INDEX);
|
||||||
if (compositingType == XRENDER_INDEX)
|
if (compositingType == XRENDER_INDEX)
|
||||||
ui.scaleMethodLabel->setBuddy(ui.xrScaleFilter);
|
ui.scaleMethodLabel->setBuddy(ui.xrScaleFilter);
|
||||||
|
@ -357,15 +349,6 @@ void KWinCompositingConfig::loadAdvancedTab()
|
||||||
ui.compositingType->setCurrentIndex(XRENDER_INDEX);
|
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
|
// 4 - off, 5 - shown, 6 - always, other are old values
|
||||||
int hps = config.readEntry("HiddenPreviews", 5);
|
int hps = config.readEntry("HiddenPreviews", 5);
|
||||||
if (hps == 6) // always
|
if (hps == 6) // always
|
||||||
|
@ -466,7 +449,6 @@ bool KWinCompositingConfig::saveAdvancedTab()
|
||||||
static const int hps[] = { 6 /*always*/, 5 /*shown*/, 4 /*never*/ };
|
static const int hps[] = { 6 /*always*/, 5 /*shown*/, 4 /*never*/ };
|
||||||
|
|
||||||
KConfigGroup config(mKWinConfig, "Compositing");
|
KConfigGroup config(mKWinConfig, "Compositing");
|
||||||
QString graphicsSystem = (ui.graphicsSystem->currentIndex() == 0) ? "native" : "raster";
|
|
||||||
|
|
||||||
QString backend;
|
QString backend;
|
||||||
|
|
||||||
|
@ -477,15 +459,13 @@ bool KWinCompositingConfig::saveAdvancedTab()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.readEntry("HiddenPreviews", 5) != hps[ ui.windowThumbnails->currentIndex()]
|
if (config.readEntry("HiddenPreviews", 5) != hps[ ui.windowThumbnails->currentIndex()]
|
||||||
|| (int)config.readEntry("XRenderSmoothScale", false) != ui.xrScaleFilter->currentIndex()) {
|
|| (int)config.readEntry("XRenderSmoothScale", false) != ui.xrScaleFilter->currentIndex()
|
||||||
advancedChanged = true;
|
|| config.readEntry("Backend") != ui.compositingType->currentText()) {
|
||||||
} else if (originalGraphicsSystem != graphicsSystem) {
|
|
||||||
advancedChanged = true;
|
advancedChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
config.writeEntry("Backend", backend);
|
config.writeEntry("Backend", backend);
|
||||||
|
|
||||||
config.writeEntry("GraphicsSystem", graphicsSystem);
|
|
||||||
config.writeEntry("HiddenPreviews", hps[ ui.windowThumbnails->currentIndex()]);
|
config.writeEntry("HiddenPreviews", hps[ ui.windowThumbnails->currentIndex()]);
|
||||||
config.writeEntry("UnredirectFullscreen", ui.unredirectFullscreen->isChecked());
|
config.writeEntry("UnredirectFullscreen", ui.unredirectFullscreen->isChecked());
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#define __MAIN_H__
|
#define __MAIN_H__
|
||||||
|
|
||||||
#include <kcmodule.h>
|
#include <kcmodule.h>
|
||||||
|
|
||||||
#include <ksharedconfig.h>
|
#include <ksharedconfig.h>
|
||||||
#include <ktemporaryfile.h>
|
#include <ktemporaryfile.h>
|
||||||
|
|
||||||
|
#include <QLabel>
|
||||||
|
|
||||||
#include "kwin_interface.h"
|
#include "kwin_interface.h"
|
||||||
|
|
||||||
#include "ui_main.h"
|
#include "ui_main.h"
|
||||||
|
@ -33,7 +34,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
class KPluginSelector;
|
class KPluginSelector;
|
||||||
class KActionCollection;
|
class KActionCollection;
|
||||||
#include <QLabel>
|
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,6 @@ public slots:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void confirmReInit() { showConfirmDialog(true); }
|
void confirmReInit() { showConfirmDialog(true); }
|
||||||
void suggestGraphicsSystem();
|
|
||||||
void alignGuiToCompositingType(int compositingType);
|
void alignGuiToCompositingType(int compositingType);
|
||||||
void toggleEffectShortcutChanged(const QKeySequence &seq);
|
void toggleEffectShortcutChanged(const QKeySequence &seq);
|
||||||
void updateStatusUI(bool compositingIsPossible);
|
void updateStatusUI(bool compositingIsPossible);
|
||||||
|
@ -96,7 +95,6 @@ private:
|
||||||
KSharedConfigPtr mTmpConfig;
|
KSharedConfigPtr mTmpConfig;
|
||||||
bool m_showConfirmDialog;
|
bool m_showConfirmDialog;
|
||||||
KActionCollection* m_actionCollection;
|
KActionCollection* m_actionCollection;
|
||||||
QString originalGraphicsSystem;
|
|
||||||
QAction *m_showDetailedErrors;
|
QAction *m_showDetailedErrors;
|
||||||
QAction *m_dontShowAgain;
|
QAction *m_dontShowAgain;
|
||||||
QString m_externErrorDetails;
|
QString m_externErrorDetails;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>583</width>
|
<width>583</width>
|
||||||
<height>389</height>
|
<height>367</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
@ -652,39 +652,6 @@ p, li { white-space: pre-wrap; }
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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:'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></string>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Native</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Raster</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
|
@ -744,7 +711,6 @@ p, li { white-space: pre-wrap; }
|
||||||
<tabstop>animationSpeedCombo</tabstop>
|
<tabstop>animationSpeedCombo</tabstop>
|
||||||
<tabstop>effectSelector</tabstop>
|
<tabstop>effectSelector</tabstop>
|
||||||
<tabstop>compositingType</tabstop>
|
<tabstop>compositingType</tabstop>
|
||||||
<tabstop>graphicsSystem</tabstop>
|
|
||||||
<tabstop>windowThumbnails</tabstop>
|
<tabstop>windowThumbnails</tabstop>
|
||||||
<tabstop>xrScaleFilter</tabstop>
|
<tabstop>xrScaleFilter</tabstop>
|
||||||
<tabstop>unredirectFullscreen</tabstop>
|
<tabstop>unredirectFullscreen</tabstop>
|
||||||
|
|
|
@ -475,22 +475,6 @@ int main(int argc, char * argv[])
|
||||||
mallopt(M_TRIM_THRESHOLD, 5*pagesize);
|
mallopt(M_TRIM_THRESHOLD, 5*pagesize);
|
||||||
#endif // M_TRIM_THRESHOLD
|
#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);
|
Display* dpy = XOpenDisplay(NULL);
|
||||||
if (!dpy) {
|
if (!dpy) {
|
||||||
fprintf(stderr, "%s: FATAL ERROR while trying to open display %s\n",
|
fprintf(stderr, "%s: FATAL ERROR while trying to open display %s\n",
|
||||||
|
|
Loading…
Add table
Reference in a new issue