2008-08-12 15:22:06 +00:00
|
|
|
/********************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2007 Lubos Lunak <l.lunak@kde.org>
|
2008-12-13 10:11:26 +00:00
|
|
|
Copyright (C) 2008 Lucas Murray <lmurray@undefinedfire.com>
|
2008-08-12 15:22:06 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
|
|
|
|
|
|
|
#ifndef KWIN_SLIDE_H
|
|
|
|
#define KWIN_SLIDE_H
|
|
|
|
|
|
|
|
#include <kwineffects.h>
|
|
|
|
#include <QObject>
|
2013-02-26 08:00:51 +00:00
|
|
|
#include <QTimeLine>
|
2008-08-12 15:22:06 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
class SlideEffect
|
2011-02-25 19:25:21 +00:00
|
|
|
: public Effect
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2008-08-12 15:22:06 +00:00
|
|
|
Q_OBJECT
|
2011-01-30 14:34:42 +00:00
|
|
|
public:
|
|
|
|
SlideEffect();
|
|
|
|
virtual void reconfigure(ReconfigureFlags);
|
|
|
|
virtual void prePaintScreen(ScreenPrePaintData& data, int time);
|
|
|
|
virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
|
|
|
|
virtual void postPaintScreen();
|
|
|
|
virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
|
|
|
|
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
2011-08-27 09:21:31 +00:00
|
|
|
virtual bool isActive() const;
|
2011-02-25 19:41:10 +00:00
|
|
|
|
2014-03-24 10:50:09 +00:00
|
|
|
int requestedEffectChainPosition() const override {
|
|
|
|
return 50;
|
|
|
|
}
|
|
|
|
|
2017-11-23 09:34:06 +00:00
|
|
|
static bool supported();
|
|
|
|
|
2011-02-25 19:41:10 +00:00
|
|
|
private Q_SLOTS:
|
2018-01-01 15:07:41 +00:00
|
|
|
void slotDesktopChanged(int old, int current, KWin::EffectWindow* with);
|
2011-02-25 19:41:10 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
private:
|
Force-enable blur for Plasma's windows during desktop slide
Without setting the property, Plasma's panel and dialogs lose the
backgroundcontrast effect during slides, which makes them flicker.
As the panel is shown on screen all the time, this is quite a visible
bug. To fix this, when the slide effect is started, we check for window
types and properties of each window, and force the blur flag on if it's
unset.
If the background contrast flag is set to false, we leave the window
alone assuming that there's a reason to force it off. Windows that
are newly added during the slide get the same treatment, so something
popping up while sliding (such as the desktop switch OSD) also gets
the background effect applied.When the effect stops or is interupted, we
unset what we've set, and clean up our internal bookkeeping.
Thanks Martin and Thomas for the thorough review!
REVIEW:115857
2014-02-19 13:02:09 +00:00
|
|
|
void windowAdded(EffectWindow* w);
|
2018-01-01 15:07:41 +00:00
|
|
|
void windowDeleted(EffectWindow* w);
|
Force-enable blur for Plasma's windows during desktop slide
Without setting the property, Plasma's panel and dialogs lose the
backgroundcontrast effect during slides, which makes them flicker.
As the panel is shown on screen all the time, this is quite a visible
bug. To fix this, when the slide effect is started, we check for window
types and properties of each window, and force the blur flag on if it's
unset.
If the background contrast flag is set to false, we leave the window
alone assuming that there's a reason to force it off. Windows that
are newly added during the slide get the same treatment, so something
popping up while sliding (such as the desktop switch OSD) also gets
the background effect applied.When the effect stops or is interupted, we
unset what we've set, and clean up our internal bookkeeping.
Thanks Martin and Thomas for the thorough review!
REVIEW:115857
2014-02-19 13:02:09 +00:00
|
|
|
bool shouldForceBackgroundContrast(const EffectWindow* w) const;
|
|
|
|
QList< EffectWindow* > m_backgroundContrastForcedBefore;
|
2011-01-30 14:34:42 +00:00
|
|
|
QRect desktopRect(int desktop) const;
|
2011-03-14 21:50:05 +00:00
|
|
|
QTimeLine mTimeLine;
|
2011-01-30 14:34:42 +00:00
|
|
|
int painting_desktop;
|
|
|
|
bool slide;
|
|
|
|
QPoint slide_start_pos;
|
|
|
|
bool slide_painting_sticky;
|
2011-12-10 21:16:41 +00:00
|
|
|
bool slide_painting_keep_above;
|
2011-01-30 14:34:42 +00:00
|
|
|
QPoint slide_painting_diff;
|
2018-01-01 15:07:41 +00:00
|
|
|
EffectWindow* m_movingWindow = nullptr;
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
};
|
2008-08-12 15:22:06 +00:00
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|