Let's use the reset method for compositing change instead of the KSelectionWatcher hack
svn path=/trunk/KDE/kdebase/workspace/; revision=1043060icc-effect-5.14.5
parent
c5acbbb26e
commit
5582f69f92
|
@ -27,11 +27,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <KDE/Plasma/PaintUtils>
|
||||
#include <KIconEffect>
|
||||
#include <KIconLoader>
|
||||
#include <KSelectionWatcher>
|
||||
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
#include <QX11Info>
|
||||
|
||||
namespace Aurorae
|
||||
{
|
||||
|
@ -464,20 +461,6 @@ void AuroraeButton::paintButton(QPainter &painter, Plasma::FrameSvg *frame, Butt
|
|||
AuroraeClient::AuroraeClient(KDecorationBridge *bridge, KDecorationFactory *factory)
|
||||
: KCommonDecorationUnstable(bridge, factory)
|
||||
{
|
||||
Display *dpy = QX11Info::display();
|
||||
int screen = DefaultScreen(dpy);
|
||||
char net_wm_cm_name[100];
|
||||
sprintf(net_wm_cm_name, "_NET_WM_CM_S%d", screen);
|
||||
m_compositingWatch = new KSelectionWatcher(net_wm_cm_name, -1, this);
|
||||
// HACK: we have to delay the update to the mask and repaint of window a little bit
|
||||
// otherwise we would be faster than KWin core resulting in not painted shadows
|
||||
// the selection watcher and the timer should be removed when KWin provides the info
|
||||
m_compositingTimer = new QTimer(this);
|
||||
m_compositingTimer->setSingleShot(true);
|
||||
m_compositingTimer->setInterval(100);
|
||||
connect(m_compositingWatch, SIGNAL(newOwner(Window)), m_compositingTimer, SLOT(start()));
|
||||
connect(m_compositingWatch, SIGNAL(lostOwner()), m_compositingTimer, SLOT(start()));
|
||||
connect(m_compositingTimer, SIGNAL(timeout()), this, SLOT(compositingChanged()));
|
||||
}
|
||||
|
||||
AuroraeClient::~AuroraeClient()
|
||||
|
@ -491,6 +474,9 @@ void AuroraeClient::init()
|
|||
|
||||
void AuroraeClient::reset(unsigned long changed)
|
||||
{
|
||||
if (changed & SettingCompositing) {
|
||||
updateWindowShape();
|
||||
}
|
||||
widget()->update();
|
||||
|
||||
KCommonDecoration::reset(changed);
|
||||
|
@ -805,12 +791,6 @@ void AuroraeClient::updateWindowShape()
|
|||
setMask(mask);
|
||||
}
|
||||
|
||||
void AuroraeClient::compositingChanged()
|
||||
{
|
||||
updateWindowShape();
|
||||
widget()->update();
|
||||
}
|
||||
|
||||
} // namespace Aurorae
|
||||
|
||||
extern "C"
|
||||
|
|
|
@ -127,12 +127,6 @@ protected:
|
|||
void reset(unsigned long changed);
|
||||
void paintEvent(QPaintEvent *event);
|
||||
|
||||
private Q_SLOTS:
|
||||
void compositingChanged();
|
||||
|
||||
private:
|
||||
KSelectionWatcher *m_compositingWatch;
|
||||
QTimer *m_compositingTimer;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue