effects: Remove Cover Switch effect

With the ongoing scene redesign, it needs to be rewritten. However,
given that it is not used widely based on support information from
various bug reports and our available man power is sparse, the most
reasonable thing is to drop the effect, unfortunately.
master
Vlad Zahorodnii 3 years ago
parent bcff948e39
commit 3722c21660

@ -73,7 +73,6 @@ void TestBuiltInEffectLoader::testHasEffect_data()
QTest::newRow("case sensitive") << QStringLiteral("BlUR") << true;
QTest::newRow("Colorpicker") << QStringLiteral("colorpicker") << true;
QTest::newRow("Contrast") << QStringLiteral("contrast") << true;
QTest::newRow("CoverSwitch") << QStringLiteral("coverswitch") << true;
QTest::newRow("Cube") << QStringLiteral("cube") << true;
QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << true;
QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << true;
@ -126,7 +125,6 @@ void TestBuiltInEffectLoader::testKnownEffects()
expectedEffects << QStringLiteral("blur")
<< QStringLiteral("colorpicker")
<< QStringLiteral("contrast")
<< QStringLiteral("coverswitch")
<< QStringLiteral("cube")
<< QStringLiteral("cubeslide")
<< QStringLiteral("desktopgrid")
@ -187,9 +185,6 @@ void TestBuiltInEffectLoader::testSupported_data()
QTest::newRow("Contrast") << QStringLiteral("contrast") << false << xc << true;
// fails for GL as it does proper tests on what's supported and doesn't just check whether it's GL
QTest::newRow("Contrast-GL") << QStringLiteral("contrast") << false << oc << true;
QTest::newRow("CoverSwitch") << QStringLiteral("coverswitch") << false << xc << true;
QTest::newRow("CoverSwitch-GL") << QStringLiteral("coverswitch") << true << oc << true;
QTest::newRow("CoverSwitch-GL-no-anim") << QStringLiteral("coverswitch") << false << oc << false;
QTest::newRow("Cube") << QStringLiteral("cube") << false << xc << true;
QTest::newRow("Cube-GL") << QStringLiteral("cube") << true << oc << true;
QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << false << xc << true;
@ -273,9 +268,6 @@ void TestBuiltInEffectLoader::testLoadEffect_data()
QTest::newRow("Contrast") << QStringLiteral("contrast") << false << xc;
// fails for GL as it does proper tests on what's supported and doesn't just check whether it's GL
QTest::newRow("Contrast-GL") << QStringLiteral("contrast") << false << oc;
QTest::newRow("CoverSwitch") << QStringLiteral("coverswitch") << false << xc;
// TODO: needs GL mocking
// QTest::newRow("CoverSwitch-GL") << QStringLiteral("coverswitch") << true << oc;
QTest::newRow("Cube") << QStringLiteral("cube") << false << xc;
// TODO: needs GL mocking
// QTest::newRow("Cube-GL") << QStringLiteral("cube") << true << oc;

@ -64,7 +64,6 @@ void TestPluginEffectLoader::testHasEffect_data()
QTest::newRow("blur") << QStringLiteral("blur") << false;
QTest::newRow("ColorPicker") << QStringLiteral("colorpicker") << false;
QTest::newRow("Contrast") << QStringLiteral("contrast") << false;
QTest::newRow("CoverSwitch") << QStringLiteral("coverswitch") << false;
QTest::newRow("Cube") << QStringLiteral("cube") << false;
QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << false;
QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << false;

@ -85,7 +85,6 @@ void TestScriptedEffectLoader::testHasEffect_data()
QTest::newRow("blur") << QStringLiteral("blur") << false;
QTest::newRow("Colorpicker") << QStringLiteral("colorpicker") << false;
QTest::newRow("Contrast") << QStringLiteral("contrast") << false;
QTest::newRow("CoverSwitch") << QStringLiteral("coverswitch") << false;
QTest::newRow("Cube") << QStringLiteral("cube") << false;
QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << false;
QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << false;

@ -0,0 +1,11 @@
#!/usr/bin/env python3
import fileinput
for line in fileinput.input():
if not line.startswith("LayoutName="):
continue
value = line[len("LayoutName="):].strip()
if value != "coverswitch":
continue
print("# DELETE LayoutName") # will use the default layout

@ -61,3 +61,9 @@ Id=remove-flip-switch-effect
File=kwinrc
Group=TabBox,TabBoxAlternative
Script=kwin-5.23-remove-flip-switch.py,python3
# Remove the Cover Switch effect
Id=remove-cover-switch-effect
File=kwinrc
Group=TabBox,TabBoxAlternative
Script=kwin-5.23-remove-cover-switch.py,python3

@ -83,7 +83,6 @@ set(kwin4_effect_builtins_sources
blur/blur.cpp
blur/blurshader.cpp
colorpicker/colorpicker.cpp
coverswitch/coverswitch.cpp
cube/cube.cpp
cube/cube_proxy.cpp
cubeslide/cubeslide.cpp
@ -124,7 +123,6 @@ qt5_add_resources(kwin4_effect_builtins_sources shaders.qrc)
kconfig_add_kcfg_files(kwin4_effect_builtins_sources
blur/blurconfig.kcfgc
coverswitch/coverswitchconfig.kcfgc
cube/cubeconfig.kcfgc
cubeslide/cubeslideconfig.kcfgc
desktopgrid/desktopgridconfig.kcfgc
@ -198,7 +196,6 @@ add_subdirectory(zoom)
# OpenGL-specific effects
add_subdirectory(blur)
include(backgroundcontrast/CMakeLists.txt)
add_subdirectory(coverswitch)
add_subdirectory(cube)
add_subdirectory(cubeslide)
add_subdirectory(glide)

@ -1,26 +0,0 @@
#######################################
# Effect
#######################################
# Config
set(kwin_coverswitch_config_SRCS coverswitch_config.cpp)
ki18n_wrap_ui(kwin_coverswitch_config_SRCS coverswitch_config.ui)
kconfig_add_kcfg_files(kwin_coverswitch_config_SRCS coverswitchconfig.kcfgc)
add_library(kwin_coverswitch_config MODULE ${kwin_coverswitch_config_SRCS})
target_link_libraries(kwin_coverswitch_config
KF5::ConfigWidgets
KF5::I18n
Qt::DBus
KWinEffectsInterface
)
kcoreaddons_desktop_to_json(kwin_coverswitch_config coverswitch_config.desktop SERVICE_TYPES kcmodule.desktop)
install(
TARGETS
kwin_coverswitch_config
DESTINATION
${KDE_INSTALL_PLUGINDIR}/kwin/effects/configs
)

File diff suppressed because it is too large Load Diff

@ -1,156 +0,0 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2008 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KWIN_COVERSWITCH_H
#define KWIN_COVERSWITCH_H
#include <QHash>
#include <QRect>
#include <QRegion>
#include <QSize>
#include <QFont>
#include <QQueue>
#include <kwineffects.h>
#include <kwinglutils.h>
namespace KWin
{
class CoverSwitchEffect
: public Effect
{
Q_OBJECT
Q_PROPERTY(int animationDuration READ configuredAnimationDuration)
Q_PROPERTY(bool animateSwitch READ isAnimateSwitch)
Q_PROPERTY(bool animateStart READ isAnimateStart)
Q_PROPERTY(bool animateStop READ isAnimateStop)
Q_PROPERTY(bool reflection READ isReflection)
Q_PROPERTY(bool windowTitle READ isWindowTitle)
Q_PROPERTY(qreal zPosition READ windowZPosition)
Q_PROPERTY(bool primaryTabBox READ isPrimaryTabBox)
Q_PROPERTY(bool secondaryTabBox READ isSecondaryTabBox)
// TODO: mirror colors
public:
CoverSwitchEffect();
~CoverSwitchEffect() override;
void reconfigure(ReconfigureFlags) override;
void prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime) override;
void paintScreen(int mask, const QRegion &region, ScreenPaintData &data) override;
void postPaintScreen() override;
void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override;
void windowInputMouseEvent(QEvent *e) override;
bool isActive() const override;
static bool supported();
// for properties
int configuredAnimationDuration() const {
return animationDuration.count();
}
bool isAnimateSwitch() const {
return animateSwitch;
}
bool isAnimateStart() const {
return animateStart;
}
bool isAnimateStop() const {
return animateStop;
}
bool isReflection() const {
return reflection;
}
bool isWindowTitle() const {
return windowTitle;
}
qreal windowZPosition() const {
return zPosition;
}
bool isPrimaryTabBox() const {
return primaryTabBox;
}
bool isSecondaryTabBox() const {
return secondaryTabBox;
}
int requestedEffectChainPosition() const override {
return 50;
}
public Q_SLOTS:
void slotWindowClosed(KWin::EffectWindow *c);
void slotTabBoxAdded(int mode);
void slotTabBoxClosed();
void slotTabBoxUpdated();
void slotTabBoxKeyEvent(QKeyEvent* event);
private:
void paintScene(EffectWindow* frontWindow, const EffectWindowList& leftWindows, const EffectWindowList& rightWindows,
bool reflectedWindows = false);
void paintWindowCover(EffectWindow* w, bool reflectedWindow, WindowPaintData& data);
void paintFrontWindow(EffectWindow* frontWindow, int width, int leftWindows, int rightWindows, bool reflectedWindow);
void paintWindows(const EffectWindowList& windows, bool left, bool reflectedWindows, EffectWindow* additionalWindow = nullptr);
void selectNextOrPreviousWindow(bool forward);
inline void selectNextWindow() { selectNextOrPreviousWindow(true); }
inline void selectPreviousWindow() { selectNextOrPreviousWindow(false); }
void abort();
/**
* Updates the caption of the caption frame.
* Taking care of rewording the desktop client.
* As well sets the icon for the caption frame.
*/
void updateCaption();
bool mActivated;
float angle;
bool animateSwitch;
bool animateStart;
bool animateStop;
bool animation;
bool start;
bool stop;
bool reflection;
float mirrorColor[2][4];
bool windowTitle;
std::chrono::milliseconds animationDuration;
bool stopRequested;
bool startRequested;
TimeLine timeLine;
std::chrono::milliseconds lastPresentTime;
QRect area;
float zPosition;
float scaleFactor;
enum Direction {
Left,
Right
};
Direction direction;
QQueue<Direction> scheduled_directions;
EffectWindow* selected_window;
int activeScreen;
QList< EffectWindow* > leftWindows;
QList< EffectWindow* > rightWindows;
EffectWindowList currentWindowList;
EffectWindowList referrencedWindows;
EffectFrame* captionFrame;
QFont captionFont;
bool primaryTabBox;
bool secondaryTabBox;
GLShader *m_reflectionShader;
QMatrix4x4 m_projectionMatrix;
QMatrix4x4 m_modelviewMatrix;
};
} // namespace
#endif

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile arg="true"/>
<group name="Effect-CoverSwitch">
<entry name="Duration" type="UInt">
<default>0</default>
</entry>
<entry name="AnimateSwitch" type="Bool">
<default>true</default>
</entry>
<entry name="AnimateStart" type="Bool">
<default>true</default>
</entry>
<entry name="AnimateStop" type="Bool">
<default>true</default>
</entry>
<entry name="Reflection" type="Bool">
<default>true</default>
</entry>
<entry name="MirrorFrontColor" type="Color">
<default code="true">QColor(0, 0, 0)</default>
</entry>
<entry name="MirrorRearColor" type="Color">
<default code="true">QColor(0, 0, 0)</default>
</entry>
<entry name="WindowTitle" type="Bool">
<default>true</default>
</entry>
<entry name="zPosition" type="UInt">
<default>900</default>
</entry>
<entry name="TabBox" type="Bool">
<default>false</default>
</entry>
<entry name="TabBoxAlternative" type="Bool">
<default>false</default>
</entry>
</group>
</kcfg>

@ -1,56 +0,0 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2008 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "coverswitch_config.h"
// KConfigSkeleton
#include "coverswitchconfig.h"
#include <config-kwin.h>
#include <kwineffects_interface.h>
#include <KAboutData>
#include <KPluginFactory>
#include <QVBoxLayout>
K_PLUGIN_FACTORY_WITH_JSON(CoverSwitchEffectConfigFactory,
"coverswitch_config.json",
registerPlugin<KWin::CoverSwitchEffectConfig>();)
namespace KWin
{
CoverSwitchEffectConfigForm::CoverSwitchEffectConfigForm(QWidget* parent) : QWidget(parent)
{
setupUi(this);
}
CoverSwitchEffectConfig::CoverSwitchEffectConfig(QWidget* parent, const QVariantList& args) :
KCModule(parent, args)
{
m_ui = new CoverSwitchEffectConfigForm(this);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->addWidget(m_ui);
CoverSwitchConfig::instance(KWIN_CONFIG);
addConfig(CoverSwitchConfig::self(), m_ui);
}
void CoverSwitchEffectConfig::save()
{
KCModule::save();
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"),
QStringLiteral("/Effects"),
QDBusConnection::sessionBus());
interface.reconfigureEffect(QStringLiteral("coverswitch"));
}
} // namespace
#include "coverswitch_config.moc"

@ -1,76 +0,0 @@
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-Library=kwin_coverswitch_config
X-KDE-ParentComponents=coverswitch
Name=Cover Switch
Name[ar]=تبديل الأغلفة
Name[az]=Karusel
Name[bg]=Прелистване на страници
Name[bn]=আবরণ বদল
Name[bs]=Protočno prebacivanje
Name[ca]=Canvi de capa
Name[ca@valencia]=Canvi de capa
Name[cs]=Přehlídka oken
Name[da]=Cover-skifter
Name[de]=3D-Fenstergalerie
Name[el]=Εναλλαγή εξωφύλλου
Name[en_GB]=Cover Switch
Name[eo]=Kovra ŝanĝilo
Name[es]=Selección de ventana en modo carátula
Name[et]=Aknalülitaja
Name[eu]=Leiho-argazkien aldaketa
Name[fi]=Levykansivaihtaja
Name[fr]=Défilement circulaire
Name[fy]=Foarplaat wiksel
Name[ga]=Cover Switch
Name[gl]=Cambio en capas
Name[gu]=ફેરફાર ઢાંકો
Name[he]=מחליף כיסויים
Name[hi]=कवर स्विच
Name[hne]=कवर स्विच
Name[hr]=Pokrivač promjena
Name[hu]=Fedett váltódoboz
Name[ia]=Commutator de copertura
Name[id]=Beralih Sampul
Name[is]=Síðuskiptir
Name[it]=Scambiafinestre circolare
Name[ja]=カバースイッチ
Name[kk]=Cover Switch
Name[km]=ប្ដូរ​​គម្រប​
Name[kn]=ಕವರ್ ಸ್ವಿಚ್
Name[ko]=커버 전환기
Name[lt]=Viršelių perjungiklis
Name[lv]=Vāku pārslēdzējs
Name[ml]=കവര്‍ സ്വിച്ച്
Name[mr]=कव्हर स्विच
Name[nb]=Omslagsbytter
Name[nds]=Cover Switch
Name[nl]=Omslagtonen
Name[nn]=Omslagvekslar
Name[pa]=ਕਵਰ ਸਵਿੱਚ
Name[pl]=Przełączanie okładek
Name[pt]=Mudança de Capas
Name[pt_BR]=Seleção em capas
Name[ro]=Comutare copertă
Name[ru]=Карусель
Name[si]=කවර මාරුව
Name[sk]=Prepínať s gáleriou
Name[sl]=Preklapljanje - ovitki
Name[sr]=Проточно пребацивање
Name[sr@ijekavian]=Проточно пребацивање
Name[sr@ijekavianlatin]=Protočno prebacivanje
Name[sr@latin]=Protočno prebacivanje
Name[sv]=Omslagsbyte
Name[ta]=Cover Switch
Name[te]=కవర్ స్విచ్
Name[th]=สลับหน้าต่างแบบปกเทป
Name[tr]=Kapak Pencere Seçici
Name[ug]=قاپنى ئالماشتۇر
Name[uk]=Перемикач обкладинок
Name[wa]=Discandjeu d' coviete
Name[x-test]=xxCover Switchxx
Name[zh_CN]=3D 封面切换
Name[zh_TW]=覆蓋切換

@ -1,43 +0,0 @@
/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2008 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KWIN_COVERSWITCH_CONFIG_H
#define KWIN_COVERSWITCH_CONFIG_H
#include <kcmodule.h>
#include "ui_coverswitch_config.h"
namespace KWin
{
class CoverSwitchEffectConfigForm : public QWidget, public Ui::CoverSwitchEffectConfigForm
{
Q_OBJECT
public:
explicit CoverSwitchEffectConfigForm(QWidget* parent);
};
class CoverSwitchEffectConfig : public KCModule
{
Q_OBJECT
public:
explicit CoverSwitchEffectConfig(QWidget* parent = nullptr, const QVariantList& args = QVariantList());
public Q_SLOTS:
void save() override;
private:
CoverSwitchEffectConfigForm* m_ui;
};
} // namespace
#endif

@ -1,307 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>KWin::CoverSwitchEffectConfigForm</class>
<widget class="QWidget" name="KWin::CoverSwitchEffectConfigForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>453</width>
<height>270</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QCheckBox" name="kcfg_WindowTitle">
<property name="text">
<string>Display window &amp;titles</string>
</property>
<property name="shortcut">
<string/>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Zoom</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="kcfg_zPosition">
<property name="toolTip">
<string>Define how far away the windows should appear</string>
</property>
<property name="maximum">
<number>3000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="pageStep">
<number>500</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>200</number>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>Near</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>Far</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Animation</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="kcfg_AnimateSwitch">
<property name="text">
<string>Animate switch</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_AnimateStart">
<property name="text">
<string>Animation on tab box open</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_AnimateStop">
<property name="text">
<string>Animation on tab box close</string>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Animation duration:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>kcfg_Duration</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="kcfg_Duration">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="specialValueText">
<string comment="Duration of rotation">Default</string>
</property>
<property name="suffix">
<string> milliseconds</string>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Reflections</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="kcfg_Reflection">
<property name="text">
<string>Reflections</string>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout_3">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Rear color</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KColorButton" name="kcfg_MirrorRearColor"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Front color</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KColorButton" name="kcfg_MirrorFrontColor"/>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KColorButton</class>
<extends>QPushButton</extends>
<header>kcolorbutton.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>kcfg_Reflection</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_MirrorFrontColor</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>60</x>
<y>49</y>
</hint>
<hint type="destinationlabel">
<x>282</x>
<y>110</y>
</hint>
</hints>
</connection>
<connection>
<sender>kcfg_Reflection</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_MirrorRearColor</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>102</x>
<y>51</y>
</hint>
<hint type="destinationlabel">
<x>284</x>
<y>72</y>
</hint>
</hints>
</connection>
<connection>
<sender>kcfg_Reflection</sender>
<signal>toggled(bool)</signal>
<receiver>label_2</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>136</x>
<y>47</y>
</hint>
<hint type="destinationlabel">
<x>202</x>
<y>78</y>
</hint>
</hints>
</connection>
<connection>
<sender>kcfg_Reflection</sender>
<signal>toggled(bool)</signal>
<receiver>label</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>175</x>
<y>49</y>
</hint>
<hint type="destinationlabel">
<x>209</x>
<y>102</y>
</hint>
</hints>
</connection>
</connections>
</ui>

@ -1,5 +0,0 @@
File=coverswitch.kcfg
ClassName=CoverSwitchConfig
NameSpace=KWin
Singleton=true
Mutators=true

@ -1,9 +0,0 @@
uniform vec4 u_frontColor;
uniform vec4 u_backColor;
varying vec2 texcoord0;
void main()
{
gl_FragColor = u_frontColor*(1.0-texcoord0.s) + u_backColor*texcoord0.s;
}

@ -1,12 +0,0 @@
#version 140
uniform vec4 u_frontColor;
uniform vec4 u_backColor;
in vec2 texcoord0;
out vec4 fragColor;
void main()
{
fragColor = u_frontColor*(1.0-texcoord0.s) + u_backColor*texcoord0.s;
}

@ -33,7 +33,6 @@
#include "windowgeometry/windowgeometry.h"
#include "zoom/zoom.h"
// OpenGL-specific effects for desktop
#include "coverswitch/coverswitch.h"
#include "cube/cube.h"
#include "cubeslide/cubeslide.h"
#include "glide/glide.h"
@ -134,22 +133,6 @@ EFFECT_FALLBACK
#endif
EFFECT_FALLBACK
QString()
}, {
QStringLiteral("coverswitch"),
i18ndc("kwin_effects", "Name of a KWin Effect", "Cover Switch"),
i18ndc("kwin_effects", "Comment describing the KWin Effect", "Display a Cover Flow effect for the alt+tab window switcher"),
QStringLiteral("Window Management"),
QString(),
QUrl(QStringLiteral("https://files.kde.org/plasma/kwin/effect-videos/cover_switch.mp4")),
false,
true,
#ifdef EFFECT_BUILTINS
&createHelper<CoverSwitchEffect>,
&CoverSwitchEffect::supported,
nullptr,
#endif
EFFECT_FALLBACK
QStringLiteral("kwin_coverswitch_config")
}, {
QStringLiteral("cube"),
i18ndc("kwin_effects", "Name of a KWin Effect", "Desktop Cube"),

@ -26,7 +26,6 @@ enum class BuiltInEffect
Blur,
ColorPicker,
Contrast,
CoverSwitch,
Cube,
CubeSlide,
DesktopGrid,

@ -1,6 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/effect-shaders-1.10">
<file alias="coverswitch-reflection.glsl">coverswitch/shaders/1.10/coverswitch-reflection.glsl</file>
<file alias="cube-cap.glsl">cube/data/1.10/cube-cap.glsl</file>
<file alias="cube-reflection.glsl">cube/data/1.10/cube-reflection.glsl</file>
<file alias="cylinder.vert">cube/data/1.10/cylinder.vert</file>
@ -10,7 +9,6 @@
<file alias="blinking-startup-fragment.glsl">startupfeedback/data/1.10/blinking-startup-fragment.glsl</file>
</qresource>
<qresource prefix="/effect-shaders-1.40">
<file alias="coverswitch-reflection.glsl">coverswitch/shaders/1.40/coverswitch-reflection.glsl</file>
<file alias="cube-cap.glsl">cube/data/1.40/cube-cap.glsl</file>
<file alias="cube-reflection.glsl">cube/data/1.40/cube-reflection.glsl</file>
<file alias="cylinder.vert">cube/data/1.40/cylinder.vert</file>

@ -5,9 +5,6 @@
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name="kwinrc" />
<group name="Plugins">
<entry key="coverswitchEnabled" type="Bool">
<default code="true">BuiltInEffects::enabledByDefault(BuiltInEffect::CoverSwitch)</default>
</entry>
<entry key="highlightwindowEnabled" type="Bool">
<default code="true">BuiltInEffects::enabledByDefault(BuiltInEffect::HighlightWindow)</default>
</entry>

@ -22,12 +22,10 @@ KWinTabboxData::KWinTabboxData(QObject *parent, const QVariantList &args)
: KCModuleData(parent, args)
, m_tabBoxConfig(new TabBoxSettings(QStringLiteral("TabBox"), this))
, m_tabBoxAlternativeConfig(new TabBoxSettings(QStringLiteral("TabBoxAlternative"), this))
, m_coverSwitchConfig(new SwitchEffectSettings(QStringLiteral("Effect-CoverSwitch"), this))
, m_pluginsConfig(new PluginsSettings(this))
{
registerSkeleton(m_tabBoxConfig);
registerSkeleton(m_tabBoxAlternativeConfig);
registerSkeleton(m_coverSwitchConfig);
}
TabBoxSettings *KWinTabboxData::tabBoxConfig() const
@ -40,11 +38,6 @@ TabBoxSettings *KWinTabboxData::tabBoxAlternativeConfig() const
return m_tabBoxAlternativeConfig;
}
SwitchEffectSettings *KWinTabboxData::coverSwitchConfig() const
{
return m_coverSwitchConfig;
}
PluginsSettings *KWinTabboxData::pluginsConfig() const
{
return m_pluginsConfig;

@ -31,13 +31,11 @@ public:
TabBoxSettings *tabBoxConfig() const;
TabBoxSettings *tabBoxAlternativeConfig() const;
SwitchEffectSettings *coverSwitchConfig() const;
PluginsSettings *pluginsConfig() const;
private:
TabBoxSettings *m_tabBoxConfig;
TabBoxSettings *m_tabBoxAlternativeConfig;
SwitchEffectSettings *m_coverSwitchConfig;
PluginsSettings *m_pluginsConfig;
};

@ -136,9 +136,6 @@ static QList<KPackage::Package> availableLnFPackages()
void KWinTabBoxConfig::initLayoutLists()
{
// search the effect names
m_coverSwitch = BuiltInEffects::effectData(BuiltInEffect::CoverSwitch).name;
QList<KPluginMetaData> offers = KPackage::PackageLoader::self()->listPackages("KWin/WindowSwitcher");
QStringList layoutNames, layoutPlugins, layoutPaths;
@ -177,11 +174,6 @@ void KWinTabBoxConfig::initLayoutLists()
for (int i=0; i<2; ++i) {
QStandardItemModel *model = new QStandardItemModel;
QStandardItem *coverItem = new QStandardItem(BuiltInEffects::effectData(BuiltInEffect::CoverSwitch).displayName);
coverItem->setData(m_coverSwitch, Qt::UserRole);
coverItem->setData(false, KWinTabBoxConfigForm::AddonEffect);
model->appendRow(coverItem);
for (int j = 0; j < layoutNames.count(); ++j) {
QStandardItem *item = new QStandardItem(layoutNames[j]);
item->setData(layoutPlugins[j], Qt::UserRole);
@ -297,19 +289,8 @@ void KWinTabBoxConfig::load()
updateUiFromConfig(m_primaryTabBoxUi, m_data->tabBoxConfig());
updateUiFromConfig(m_alternativeTabBoxUi , m_data->tabBoxAlternativeConfig());
m_data->coverSwitchConfig()->load();
m_data->pluginsConfig()->load();
if (m_data->pluginsConfig()->coverswitchEnabled()) {
if (m_data->coverSwitchConfig()->tabBox()) {
m_primaryTabBoxUi->setLayoutName(m_coverSwitch);
}
if (m_data->coverSwitchConfig()->tabBoxAlternative()) {
m_alternativeTabBoxUi->setLayoutName(m_coverSwitch);
}
}
m_primaryTabBoxUi->loadShortcuts();
m_alternativeTabBoxUi->loadShortcuts();
@ -320,20 +301,11 @@ void KWinTabBoxConfig::save()
{
// effects
const bool highlightWindows = m_primaryTabBoxUi->highlightWindows() || m_alternativeTabBoxUi->highlightWindows();
const bool coverSwitch = m_primaryTabBoxUi->showTabBox()
&& m_primaryTabBoxUi->effectComboCurrentData().toString() == m_coverSwitch;
const bool coverSwitchAlternative = m_alternativeTabBoxUi->showTabBox()
&& m_alternativeTabBoxUi->effectComboCurrentData().toString() == m_coverSwitch;
// activate effects if they are used otherwise deactivate them.
m_data->pluginsConfig()->setCoverswitchEnabled(coverSwitch || coverSwitchAlternative);
m_data->pluginsConfig()->setHighlightwindowEnabled(highlightWindows);
m_data->pluginsConfig()->save();
m_data->coverSwitchConfig()->setTabBox(coverSwitch);
m_data->coverSwitchConfig()->setTabBoxAlternative(coverSwitchAlternative);
m_data->coverSwitchConfig()->save();
updateConfigFromUi(m_primaryTabBoxUi, m_data->tabBoxConfig());
updateConfigFromUi(m_alternativeTabBoxUi, m_data->tabBoxAlternativeConfig());
@ -346,17 +318,10 @@ void KWinTabBoxConfig::save()
// Reload KWin.
QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
// and reconfigure the effects
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"),
QStringLiteral("/Effects"),
QDBusConnection::sessionBus());
interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::CoverSwitch));
}
void KWinTabBoxConfig::defaults()
{
m_data->coverSwitchConfig()->setDefaults();
updateUiFromDefaultConfig(m_primaryTabBoxUi, m_data->tabBoxConfig());
updateUiFromDefaultConfig(m_alternativeTabBoxUi, m_data->tabBoxAlternativeConfig());

@ -62,9 +62,6 @@ private:
KSharedConfigPtr m_config;
TabBox::KWinTabboxData *m_data;
// Builtin effects' names
QString m_coverSwitch;
};
} // namespace

Loading…
Cancel
Save