Fix broken task switching when transparency enabled

This resolves Bug 2220
pull/1/head
Timothy Pearson 10 years ago
parent 8095005fe2
commit 80aec91d21

@ -22,7 +22,7 @@
#include <tdeapplication.h>
#include <kimageeffect.h>
#include <kpixmapio.h>
#include <twinmodule.h>
#include <netwm.h>
#include <twin.h>
#include <kdebug.h>
#include <netwm.h>
@ -38,11 +38,37 @@ static TQString wallpaperForDesktop(int desktop)
return DCOPRef("kdesktop", "KBackgroundIface").call("currentWallpaper", desktop);
}
DesktopWallpaperWatcher::DesktopWallpaperWatcher() : TQWidget(), m_old_current_desktop(-1)
{
kapp->installX11EventFilter( this );
(void ) kapp->desktop(); //trigger desktop widget creation to select root window events
}
DesktopWallpaperWatcher::~DesktopWallpaperWatcher()
{
}
bool DesktopWallpaperWatcher::x11Event( XEvent * ev )
{
if ( ev->xany.window == tqt_xrootwin() ) {
NETRootInfo rinfo( tqt_xdisplay(), NET::CurrentDesktop );
rinfo.activate();
if ( rinfo.currentDesktop() != m_old_current_desktop ) {
emit currentDesktopChanged( rinfo.currentDesktop() );
}
m_old_current_desktop = rinfo.currentDesktop();
}
return false;
}
class KMyRootPixmapData
{
public:
#ifdef Q_WS_X11
KWinModule *twin;
DesktopWallpaperWatcher *twin;
#endif
};
@ -74,7 +100,7 @@ void KMyRootPixmap::init()
// connect(m_pTimer, TQT_SIGNAL(timeout()), TQT_SLOT(repaint()));
#ifdef Q_WS_X11
d->twin = new KWinModule( this );
d->twin = new DesktopWallpaperWatcher();
connect(d->twin, TQT_SIGNAL(currentDesktopChanged(int)), TQT_SLOT(desktopChanged(int)));
#endif
@ -228,5 +254,5 @@ void KMyRootPixmap::updateBackground( TDESharedPixmap *spm )
}
}
// #include "krootpixmap.moc"
#include "myrootpixmap.moc"
#endif

@ -25,10 +25,26 @@ class TQTimer;
class TDESharedPixmap;
class KMyRootPixmapData;
class DesktopWallpaperWatcher : public TQWidget
{
Q_OBJECT
public:
DesktopWallpaperWatcher();
~DesktopWallpaperWatcher();
bool x11Event( XEvent * ev );
signals:
void currentDesktopChanged( int desktop);
private:
int m_old_current_desktop;
};
class KMyRootPixmap: public TQObject
{
Q_OBJECT
public:
KMyRootPixmap( TQWidget *target=NULL, const char *name=0 );
@ -91,7 +107,7 @@ private:
// TQWidget *m_pWidget;
// TQTimer *m_pTimer;
TDESharedPixmap *m_pPixmap;
KMyRootPixmapData *d;
KMyRootPixmapData *d;
void init();
};

Loading…
Cancel
Save