delay adding Unmanaged clients by 50ms

This provides some sort of synthetic XSYNC support
for unmanaged clients and allows them to do an initial
update after mapping and before being painted (prevent
flicker)
Also it helps with Unmanaged clients performing quick
map/unmap/map cycles what also seems to induce the black
window issue on the nvidia blob.

CCBUG: 284888
BUG: 319184
FIXED-IN: 4.11
REVIEW: 111292
icc-effect-5.14.5
Thomas Lübking 2013-06-28 14:23:22 +02:00
parent f71457b2cf
commit a3d502338d
4 changed files with 16 additions and 4 deletions

View File

@ -555,9 +555,9 @@ void EffectsHandlerImpl::slotClientAdded(Client *c)
}
void EffectsHandlerImpl::slotUnmanagedAdded(Unmanaged *u)
{ // regardless, unmanaged windows are -yet?- not synced anyway
setupUnmanagedConnections(u);
emit windowAdded(u->effectWindow());
{
// it's never initially ready but has synthetic 50ms delay
connect(u, SIGNAL(windowShown(KWin::Toplevel*)), SLOT(slotUnmanagedShown(KWin::Toplevel*)));
}
void EffectsHandlerImpl::slotClientShown(KWin::Toplevel *t)
@ -569,6 +569,14 @@ void EffectsHandlerImpl::slotClientShown(KWin::Toplevel *t)
emit windowAdded(c->effectWindow());
}
void EffectsHandlerImpl::slotUnmanagedShown(KWin::Toplevel *t)
{ // regardless, unmanaged windows are -yet?- not synced anyway
Q_ASSERT(dynamic_cast<Unmanaged*>(t));
Unmanaged *u = static_cast<Unmanaged*>(t);
setupUnmanagedConnections(u);
emit windowAdded(u->effectWindow());
}
void EffectsHandlerImpl::slotDeletedRemoved(KWin::Deleted *d)
{
emit windowDeleted(d->effectWindow());

View File

@ -217,6 +217,7 @@ protected Q_SLOTS:
void slotClientAdded(KWin::Client *c);
void slotClientShown(KWin::Toplevel*);
void slotUnmanagedAdded(KWin::Unmanaged *u);
void slotUnmanagedShown(KWin::Toplevel*);
void slotWindowClosed(KWin::Toplevel *c);
void slotClientActivated(KWin::Client *c);
void slotDeletedRemoved(KWin::Deleted *d);

View File

@ -342,6 +342,7 @@ protected Q_SLOTS:
void checkScreen();
void setupCheckScreenConnection();
void removeCheckScreenConnection();
void setReadyForPainting();
protected:
virtual ~Toplevel();
@ -353,7 +354,6 @@ protected:
void addDamageFull();
void getWmClientLeader();
void getWmClientMachine();
void setReadyForPainting();
/**
* @returns Whether there is a compositor and it is active.
**/

View File

@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "deleted.h"
#include "xcbutils.h"
#include <QTimer>
#include <QDebug>
#include <X11/extensions/shape.h>
@ -35,7 +36,9 @@ namespace KWin
Unmanaged::Unmanaged()
: Toplevel()
{
ready_for_painting = false;
connect(this, SIGNAL(geometryShapeChanged(KWin::Toplevel*,QRect)), SIGNAL(geometryChanged()));
QTimer::singleShot(50, this, SLOT(setReadyForPainting()));
}
Unmanaged::~Unmanaged()