Remove compositing initialized check
Summary: The check is used to limit settings reload. But we can afford to reload settings in case the compositing gets toggled since this happens rarely. Removing the check reduces code complexity. Test Plan: Manually in X and Wayland. Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: kwin Tags: #kwin Maniphest Tasks: T11071 Differential Revision: https://phabricator.kde.org/D22220
This commit is contained in:
parent
cc801a4518
commit
ba6daecb4f
3 changed files with 1 additions and 28 deletions
|
@ -193,9 +193,7 @@ void Compositor::setup()
|
||||||
}
|
}
|
||||||
m_starting = true;
|
m_starting = true;
|
||||||
|
|
||||||
if (!options->isCompositingInitialized()) {
|
options->reloadCompositingSettings(true);
|
||||||
options->reloadCompositingSettings(true);
|
|
||||||
}
|
|
||||||
slotCompositingOptionsInitialized();
|
slotCompositingOptionsInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,7 +512,6 @@ void Compositor::slotReinitialize()
|
||||||
finish();
|
finish();
|
||||||
// resume compositing if suspended
|
// resume compositing if suspended
|
||||||
m_suspended = NoReasonSuspend;
|
m_suspended = NoReasonSuspend;
|
||||||
options->setCompositingInitialized(false);
|
|
||||||
setup();
|
setup();
|
||||||
|
|
||||||
if (effects) { // setup() may fail
|
if (effects) { // setup() may fail
|
||||||
|
|
14
options.cpp
14
options.cpp
|
@ -112,7 +112,6 @@ Options::Options(QObject *parent)
|
||||||
, m_autogroupInForeground(false)
|
, m_autogroupInForeground(false)
|
||||||
, m_compositingMode(Options::defaultCompositingMode())
|
, m_compositingMode(Options::defaultCompositingMode())
|
||||||
, m_useCompositing(Options::defaultUseCompositing())
|
, m_useCompositing(Options::defaultUseCompositing())
|
||||||
, m_compositingInitialized(Options::defaultCompositingInitialized())
|
|
||||||
, m_hiddenPreviews(Options::defaultHiddenPreviews())
|
, m_hiddenPreviews(Options::defaultHiddenPreviews())
|
||||||
, m_glSmoothScale(Options::defaultGlSmoothScale())
|
, m_glSmoothScale(Options::defaultGlSmoothScale())
|
||||||
, m_xrenderSmoothScale(Options::defaultXrenderSmoothScale())
|
, m_xrenderSmoothScale(Options::defaultXrenderSmoothScale())
|
||||||
|
@ -615,15 +614,6 @@ void Options::setUseCompositing(bool useCompositing)
|
||||||
emit useCompositingChanged();
|
emit useCompositingChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Options::setCompositingInitialized(bool compositingInitialized)
|
|
||||||
{
|
|
||||||
if (m_compositingInitialized == compositingInitialized) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_compositingInitialized = compositingInitialized;
|
|
||||||
emit compositingInitializedChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Options::setHiddenPreviews(int hiddenPreviews)
|
void Options::setHiddenPreviews(int hiddenPreviews)
|
||||||
{
|
{
|
||||||
if (m_hiddenPreviews == static_cast<HiddenPreviews>(hiddenPreviews)) {
|
if (m_hiddenPreviews == static_cast<HiddenPreviews>(hiddenPreviews)) {
|
||||||
|
@ -787,7 +777,6 @@ void Options::updateSettings()
|
||||||
// KDE4 this probably needs to be done manually in clients
|
// KDE4 this probably needs to be done manually in clients
|
||||||
|
|
||||||
// Driver-specific config detection
|
// Driver-specific config detection
|
||||||
setCompositingInitialized(false);
|
|
||||||
reloadCompositingSettings();
|
reloadCompositingSettings();
|
||||||
|
|
||||||
emit configChanged();
|
emit configChanged();
|
||||||
|
@ -956,9 +945,6 @@ void Options::reloadCompositingSettings(bool force)
|
||||||
}
|
}
|
||||||
m_settings->load();
|
m_settings->load();
|
||||||
syncFromKcfgc();
|
syncFromKcfgc();
|
||||||
// from now on we've an initial setup and don't have to reload settings on compositing activation
|
|
||||||
// see Workspace::setupCompositing(), composite.cpp
|
|
||||||
setCompositingInitialized(true);
|
|
||||||
|
|
||||||
// Compositing settings
|
// Compositing settings
|
||||||
KConfigGroup config(m_settings->config(), "Compositing");
|
KConfigGroup config(m_settings->config(), "Compositing");
|
||||||
|
|
10
options.h
10
options.h
|
@ -167,7 +167,6 @@ class KWIN_EXPORT Options : public QObject
|
||||||
Q_PROPERTY(bool autogroupInForeground READ isAutogroupInForeground WRITE setAutogroupInForeground NOTIFY autogroupInForegroundChanged)
|
Q_PROPERTY(bool autogroupInForeground READ isAutogroupInForeground WRITE setAutogroupInForeground NOTIFY autogroupInForegroundChanged)
|
||||||
Q_PROPERTY(int compositingMode READ compositingMode WRITE setCompositingMode NOTIFY compositingModeChanged)
|
Q_PROPERTY(int compositingMode READ compositingMode WRITE setCompositingMode NOTIFY compositingModeChanged)
|
||||||
Q_PROPERTY(bool useCompositing READ isUseCompositing WRITE setUseCompositing NOTIFY useCompositingChanged)
|
Q_PROPERTY(bool useCompositing READ isUseCompositing WRITE setUseCompositing NOTIFY useCompositingChanged)
|
||||||
Q_PROPERTY(bool compositingInitialized READ isCompositingInitialized WRITE setCompositingInitialized NOTIFY compositingInitializedChanged)
|
|
||||||
Q_PROPERTY(int hiddenPreviews READ hiddenPreviews WRITE setHiddenPreviews NOTIFY hiddenPreviewsChanged)
|
Q_PROPERTY(int hiddenPreviews READ hiddenPreviews WRITE setHiddenPreviews NOTIFY hiddenPreviewsChanged)
|
||||||
/**
|
/**
|
||||||
* 0 = no, 1 = yes when transformed,
|
* 0 = no, 1 = yes when transformed,
|
||||||
|
@ -558,9 +557,6 @@ public:
|
||||||
}
|
}
|
||||||
// Separate to mode so the user can toggle
|
// Separate to mode so the user can toggle
|
||||||
bool isUseCompositing() const;
|
bool isUseCompositing() const;
|
||||||
bool isCompositingInitialized() const {
|
|
||||||
return m_compositingInitialized;
|
|
||||||
}
|
|
||||||
|
|
||||||
// General preferences
|
// General preferences
|
||||||
HiddenPreviews hiddenPreviews() const {
|
HiddenPreviews hiddenPreviews() const {
|
||||||
|
@ -662,7 +658,6 @@ public:
|
||||||
void setAutogroupInForeground(bool autogroupInForeground);
|
void setAutogroupInForeground(bool autogroupInForeground);
|
||||||
void setCompositingMode(int compositingMode);
|
void setCompositingMode(int compositingMode);
|
||||||
void setUseCompositing(bool useCompositing);
|
void setUseCompositing(bool useCompositing);
|
||||||
void setCompositingInitialized(bool compositingInitialized);
|
|
||||||
void setHiddenPreviews(int hiddenPreviews);
|
void setHiddenPreviews(int hiddenPreviews);
|
||||||
void setGlSmoothScale(int glSmoothScale);
|
void setGlSmoothScale(int glSmoothScale);
|
||||||
void setXrenderSmoothScale(bool xrenderSmoothScale);
|
void setXrenderSmoothScale(bool xrenderSmoothScale);
|
||||||
|
@ -746,9 +741,6 @@ public:
|
||||||
static bool defaultUseCompositing() {
|
static bool defaultUseCompositing() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
static bool defaultCompositingInitialized() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
static HiddenPreviews defaultHiddenPreviews() {
|
static HiddenPreviews defaultHiddenPreviews() {
|
||||||
return HiddenPreviewsShown;
|
return HiddenPreviewsShown;
|
||||||
}
|
}
|
||||||
|
@ -853,7 +845,6 @@ Q_SIGNALS:
|
||||||
void autogroupInForegroundChanged();
|
void autogroupInForegroundChanged();
|
||||||
void compositingModeChanged();
|
void compositingModeChanged();
|
||||||
void useCompositingChanged();
|
void useCompositingChanged();
|
||||||
void compositingInitializedChanged();
|
|
||||||
void hiddenPreviewsChanged();
|
void hiddenPreviewsChanged();
|
||||||
void glSmoothScaleChanged();
|
void glSmoothScaleChanged();
|
||||||
void xrenderSmoothScaleChanged();
|
void xrenderSmoothScaleChanged();
|
||||||
|
@ -898,7 +889,6 @@ private:
|
||||||
|
|
||||||
CompositingType m_compositingMode;
|
CompositingType m_compositingMode;
|
||||||
bool m_useCompositing;
|
bool m_useCompositing;
|
||||||
bool m_compositingInitialized;
|
|
||||||
HiddenPreviews m_hiddenPreviews;
|
HiddenPreviews m_hiddenPreviews;
|
||||||
int m_glSmoothScale;
|
int m_glSmoothScale;
|
||||||
bool m_xrenderSmoothScale;
|
bool m_xrenderSmoothScale;
|
||||||
|
|
Loading…
Reference in a new issue