validate screens w/o direct update

largely reverts b164e9912c9b5f9c9ae619bbd79355d317174115
which prevented the crash but due to early screen updating
causes issues with scene/overlay update on at least intel chips

BUG: 322970
FIXED-IN: 4.11
CCBUG: 322156
REVIEW: https://git.reviewboard.kde.org/r/111811/
icc-effect-5.14.5
Thomas Lübking 2013-07-31 12:55:00 +02:00
parent 127cf45626
commit ee45592d85
2 changed files with 8 additions and 36 deletions

View File

@ -37,7 +37,7 @@ Screens::Screens(QObject *parent)
, m_count(0)
, m_current(0)
, m_currentFollowsMouse(false)
, m_changedTimer(new ScreenCountTimer(this))
, m_changedTimer(new QTimer(this))
{
m_changedTimer->setSingleShot(true);
m_changedTimer->setInterval(100);
@ -117,19 +117,6 @@ int Screens::current() const
return m_current;
}
ScreenCountTimer::ScreenCountTimer(QObject * parent) : QTimer(parent)
{
}
void ScreenCountTimer::finish()
{
if (isActive()) {
stop();
Screens::self()->updateCount();
QMetaObject::invokeMethod(Screens::self(), "changed", Qt::QueuedConnection);
}
}
DesktopWidgetScreens::DesktopWidgetScreens(QObject *parent)
: Screens(parent)
, m_desktop(QApplication::desktop())
@ -145,13 +132,15 @@ DesktopWidgetScreens::~DesktopWidgetScreens()
QRect DesktopWidgetScreens::geometry(int screen) const
{
finishChangedTimer();
if (Screens::self()->isChanging())
const_cast<DesktopWidgetScreens*>(this)->updateCount();
return m_desktop->screenGeometry(screen);
}
int DesktopWidgetScreens::number(const QPoint &pos) const
{
finishChangedTimer();
if (Screens::self()->isChanging())
const_cast<DesktopWidgetScreens*>(this)->updateCount();
return m_desktop->screenNumber(pos);
}

View File

@ -35,15 +35,6 @@ namespace KWin
{
class Client;
class ScreenCountTimer : public QTimer {
public:
ScreenCountTimer(QObject * parent = 0);
/**
* if isActive, stop AND emit timeout()
*/
void finish();
};
class Screens : public QObject
{
Q_OBJECT
@ -75,6 +66,8 @@ public:
virtual QRect geometry(int screen) const = 0;
virtual int number(const QPoint &pos) const = 0;
inline bool isChanging() { return m_changedTimer->isActive(); }
public Q_SLOTS:
void reconfigure();
@ -85,11 +78,7 @@ Q_SIGNALS:
**/
void changed();
protected:
void finishChangedTimer() const;
protected Q_SLOTS:
friend class ScreenCountTimer;
void setCount(int count);
void startChangedTimer();
virtual void updateCount() = 0;
@ -98,7 +87,7 @@ private:
int m_count;
int m_current;
bool m_currentFollowsMouse;
ScreenCountTimer *m_changedTimer;
QTimer *m_changedTimer;
KSharedConfig::Ptr m_config;
KWIN_SINGLETON(Screens)
@ -131,12 +120,6 @@ int Screens::count() const
return m_count;
}
inline
void Screens::finishChangedTimer() const
{
const_cast<ScreenCountTimer*>(m_changedTimer)->finish();
}
inline
bool Screens::isCurrentFollowsMouse() const
{