Less warnings please.

svn path=/trunk/KDE/kdebase/workspace/; revision=1031490
icc-effect-5.14.5
Lucas Murray 2009-10-05 09:47:13 +00:00
parent 839550b975
commit 20f1a79d04
14 changed files with 33 additions and 14 deletions

View File

@ -757,6 +757,10 @@ Pixmap Toplevel::createWindowPixmap()
} }
#ifdef HAVE_XDAMAGE #ifdef HAVE_XDAMAGE
// We must specify that the two events are a union so the compiler doesn't
// complain about strict aliasing rules.
typedef union { XEvent e; XDamageNotifyEvent de; } EventUnion;
void Toplevel::damageNotifyEvent( XDamageNotifyEvent* e ) void Toplevel::damageNotifyEvent( XDamageNotifyEvent* e )
{ {
QRegion damage( e->area.x, e->area.y, e->area.width, e->area.height ); QRegion damage( e->area.x, e->area.y, e->area.width, e->area.height );
@ -764,11 +768,11 @@ void Toplevel::damageNotifyEvent( XDamageNotifyEvent* e )
int cnt = 1; int cnt = 1;
while( XPending( display())) while( XPending( display()))
{ {
XEvent e2; EventUnion e2;
if( XPeekEvent( display(), &e2 ) && e2.type == Extensions::damageNotifyEvent() if( XPeekEvent( display(), &e2.e ) && e2.e.type == Extensions::damageNotifyEvent()
&& e2.xany.window == frameId()) && e2.e.xany.window == frameId())
{ {
XNextEvent( display(), &e2 ); XNextEvent( display(), &e2.e );
if( cnt > 200 ) if( cnt > 200 )
{ {
// If there are way too many damage events in the queue, just discard them // If there are way too many damage events in the queue, just discard them
@ -778,8 +782,7 @@ void Toplevel::damageNotifyEvent( XDamageNotifyEvent* e )
damage = rect(); damage = rect();
continue; continue;
} }
XDamageNotifyEvent* e = reinterpret_cast< XDamageNotifyEvent* >( &e2 ); QRect r( e2.de.area.x, e2.de.area.y, e2.de.area.width, e2.de.area.height );
QRect r( e->area.x, e->area.y, e->area.width, e->area.height );
++cnt; ++cnt;
// If there are too many damaged rectangles, increase them // If there are too many damaged rectangles, increase them
// to be multiples of 100x100 px grid, since QRegion get quite // to be multiples of 100x100 px grid, since QRegion get quite

View File

@ -176,11 +176,13 @@ int Workspace::desktopToLeft( int id, bool wrap ) const
int Workspace::addDesktop( QPoint coords ) int Workspace::addDesktop( QPoint coords )
{ // TODO { // TODO
Q_UNUSED( coords );
return 0; return 0;
} }
void Workspace::deleteDesktop( int id ) void Workspace::deleteDesktop( int id )
{ // TODO { // TODO
Q_UNUSED( id );
} }
} // namespace } // namespace

View File

@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QFile> #include <QFile>
#include "kdebug.h" #include "kdebug.h"
#include "klibloader.h" #include "klibrary.h"
#include "kdesktopfile.h" #include "kdesktopfile.h"
#include "kconfiggroup.h" #include "kconfiggroup.h"
#include "kstandarddirs.h" #include "kstandarddirs.h"
@ -840,7 +840,7 @@ unsigned long EffectsHandlerImpl::xrenderBufferPicture()
KLibrary* EffectsHandlerImpl::findEffectLibrary( KService* service ) KLibrary* EffectsHandlerImpl::findEffectLibrary( KService* service )
{ {
QString libname = service->library(); QString libname = service->library();
KLibrary* library = KLibLoader::self()->library(libname); KLibrary* library = new KLibrary(libname);
if( !library ) if( !library )
{ {
kError( 1212 ) << "couldn't open library for effect '" << kError( 1212 ) << "couldn't open library for effect '" <<

View File

@ -232,6 +232,7 @@ void BoxSwitchEffect::paintWindow( EffectWindow* w, int mask, QRegion region, Wi
void BoxSwitchEffect::windowInputMouseEvent( Window w, QEvent* e ) void BoxSwitchEffect::windowInputMouseEvent( Window w, QEvent* e )
{ {
assert( w == mInput ); assert( w == mInput );
Q_UNUSED( w );
if( e->type() != QEvent::MouseButtonPress ) if( e->type() != QEvent::MouseButtonPress )
return; return;
QPoint pos = static_cast< QMouseEvent* >( e )->pos(); QPoint pos = static_cast< QMouseEvent* >( e )->pos();
@ -272,6 +273,7 @@ void BoxSwitchEffect::windowInputMouseEvent( Window w, QEvent* e )
void BoxSwitchEffect::windowDamaged( EffectWindow* w, const QRect& damage ) void BoxSwitchEffect::windowDamaged( EffectWindow* w, const QRect& damage )
{ {
Q_UNUSED( damage );
if( mActivated ) if( mActivated )
{ {
if( mMode == TabBoxWindowsMode || mMode == TabBoxWindowsAlternativeMode ) if( mMode == TabBoxWindowsMode || mMode == TabBoxWindowsAlternativeMode )

View File

@ -1354,6 +1354,7 @@ void CoverSwitchEffect::paintWindowIcon( EffectWindow* w )
void CoverSwitchEffect::windowInputMouseEvent( Window w, QEvent* e ) void CoverSwitchEffect::windowInputMouseEvent( Window w, QEvent* e )
{ {
assert( w == input ); assert( w == input );
Q_UNUSED( w );
if( e->type() != QEvent::MouseButtonPress ) if( e->type() != QEvent::MouseButtonPress )
return; return;
// we don't want click events during animations // we don't want click events during animations

View File

@ -2118,6 +2118,7 @@ void CubeEffect::mouseChanged( const QPoint& pos, const QPoint& oldpos, Qt::Mous
void CubeEffect::windowInputMouseEvent( Window w, QEvent* e ) void CubeEffect::windowInputMouseEvent( Window w, QEvent* e )
{ {
assert( w == input ); assert( w == input );
Q_UNUSED( w );
QMouseEvent *mouse = dynamic_cast< QMouseEvent* >( e ); QMouseEvent *mouse = dynamic_cast< QMouseEvent* >( e );
if( mouse && mouse->type() == QEvent::MouseButtonRelease ) if( mouse && mouse->type() == QEvent::MouseButtonRelease )
{ {

View File

@ -114,7 +114,7 @@ void CubeEffectConfig::load()
bool closeOnMouseRelease = conf.readEntry( "CloseOnMouseRelease", false ); bool closeOnMouseRelease = conf.readEntry( "CloseOnMouseRelease", false );
bool walkThroughDesktop = conf.readEntry( "TabBox", false ); bool walkThroughDesktop = conf.readEntry( "TabBox", false );
m_ui->zPositionSlider->setValue( conf.readEntry( "ZPosition", 100 ) ); m_ui->zPositionSlider->setValue( conf.readEntry( "ZPosition", 100 ) );
m_ui->wallpaperRequester->setPath( conf.readEntry( "Wallpaper", "" ) ); m_ui->wallpaperRequester->setUrl( KUrl( conf.readEntry( "Wallpaper", "" ) ));
bool invertKeys = conf.readEntry( "InvertKeys", false ); bool invertKeys = conf.readEntry( "InvertKeys", false );
bool invertMouse = conf.readEntry( "InvertMouse", false ); bool invertMouse = conf.readEntry( "InvertMouse", false );
m_ui->capDeformationSlider->setValue( conf.readEntry( "CapDeformation", 0 ) ); m_ui->capDeformationSlider->setValue( conf.readEntry( "CapDeformation", 0 ) );
@ -226,7 +226,7 @@ void CubeEffectConfig::defaults()
m_ui->capColorButton->setColor( KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() ); m_ui->capColorButton->setColor( KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() );
m_ui->capsImageBox->setCheckState( Qt::Checked ); m_ui->capsImageBox->setCheckState( Qt::Checked );
m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Unchecked ); m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Unchecked );
m_ui->wallpaperRequester->setPath( "" ); m_ui->wallpaperRequester->setUrl( KUrl( "" ));
m_ui->zPositionSlider->setValue( 100 ); m_ui->zPositionSlider->setValue( 100 );
m_ui->walkThroughDesktopBox->setCheckState( Qt::Unchecked ); m_ui->walkThroughDesktopBox->setCheckState( Qt::Unchecked );
m_ui->invertKeysBox->setChecked( false ); m_ui->invertKeysBox->setChecked( false );

View File

@ -369,7 +369,7 @@ void DesktopGridEffect::windowInputMouseEvent( Window, QEvent* e )
isDesktop = w->isDesktop(); isDesktop = w->isDesktop();
if ( isDesktop ) if ( isDesktop )
XDefineCursor( display(), input, QCursor( Qt::ClosedHandCursor ).handle() ); XDefineCursor( display(), input, QCursor( Qt::ClosedHandCursor ).handle() );
else if( w != NULL && w->isMovable() || w->isMovableAcrossScreens() ) else if( w != NULL && ( w->isMovable() || w->isMovableAcrossScreens() ))
{ // Prepare it for moving { // Prepare it for moving
XDefineCursor( display(), input, QCursor( Qt::ClosedHandCursor ).handle() ); XDefineCursor( display(), input, QCursor( Qt::ClosedHandCursor ).handle() );
windowMoveDiff = w->pos() - unscalePos( me->pos(), NULL ); windowMoveDiff = w->pos() - unscalePos( me->pos(), NULL );

View File

@ -188,6 +188,7 @@ void LogoutEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data
{ {
GLRenderTarget* target = effects->popRenderTarget(); GLRenderTarget* target = effects->popRenderTarget();
assert( target == blurTarget ); assert( target == blurTarget );
Q_UNUSED( target );
// Render the blurred scene // Render the blurred scene
blurTexture->bind(); blurTexture->bind();

View File

@ -412,6 +412,7 @@ bool PresentWindowsEffect::borderActivated( ElectricBorder border )
void PresentWindowsEffect::windowInputMouseEvent( Window w, QEvent *e ) void PresentWindowsEffect::windowInputMouseEvent( Window w, QEvent *e )
{ {
assert( w == m_input ); assert( w == m_input );
Q_UNUSED( w );
// Which window are we hovering over? Always trigger as we don't always get move events before clicking // Which window are we hovering over? Always trigger as we don't always get move events before clicking
// We cannot use m_motionManager.windowAtPoint() as the window might not be visible // We cannot use m_motionManager.windowAtPoint() as the window might not be visible

View File

@ -155,6 +155,7 @@ void ShadowEffect::updateShadowColor()
QRect ShadowEffect::shadowRectangle( EffectWindow* w, const QRect& windowRectangle ) const QRect ShadowEffect::shadowRectangle( EffectWindow* w, const QRect& windowRectangle ) const
{ {
Q_UNUSED( w );
int shadowGrow = shadowFuzzyness + shadowSize; int shadowGrow = shadowFuzzyness + shadowSize;
return windowRectangle.adjusted( shadowXOffset - shadowGrow, shadowYOffset - shadowGrow, return windowRectangle.adjusted( shadowXOffset - shadowGrow, shadowYOffset - shadowGrow,
shadowXOffset + shadowGrow, shadowYOffset + shadowGrow); shadowXOffset + shadowGrow, shadowYOffset + shadowGrow);
@ -422,6 +423,8 @@ void ShadowEffect::drawQueuedShadows( EffectWindow* behindWindow )
// Modified version of SceneOpenGL::Window::prepareRenderStates() from scene_opengl.cpp // Modified version of SceneOpenGL::Window::prepareRenderStates() from scene_opengl.cpp
void ShadowEffect::prepareRenderStates( GLTexture *texture, double opacity, double brightness, double saturation ) void ShadowEffect::prepareRenderStates( GLTexture *texture, double opacity, double brightness, double saturation )
{ {
Q_UNUSED( texture );
Q_UNUSED( saturation );
#ifdef KWIN_HAVE_OPENGL_COMPOSITING #ifdef KWIN_HAVE_OPENGL_COMPOSITING
// setup blending of transparent windows // setup blending of transparent windows
glPushAttrib( GL_ENABLE_BIT ); glPushAttrib( GL_ENABLE_BIT );
@ -508,6 +511,7 @@ void ShadowEffect::prepareRenderStates( GLTexture *texture, double opacity, doub
// Modified version of SceneOpenGL::Window::restoreRenderStates() from scene_opengl.cpp // Modified version of SceneOpenGL::Window::restoreRenderStates() from scene_opengl.cpp
void ShadowEffect::restoreRenderStates( GLTexture *texture, double opacity, double brightness, double saturation ) void ShadowEffect::restoreRenderStates( GLTexture *texture, double opacity, double brightness, double saturation )
{ {
Q_UNUSED( texture );
#ifdef KWIN_HAVE_OPENGL_COMPOSITING #ifdef KWIN_HAVE_OPENGL_COMPOSITING
if( opacity != 1.0 || saturation != 1.0 || brightness != 1.0 ) if( opacity != 1.0 || saturation != 1.0 || brightness != 1.0 )
{ {
@ -558,6 +562,7 @@ void ShadowEffect::drawShadowQuadOpenGL( GLTexture *texture, QVector<float> vert
void ShadowEffect::drawShadowQuadXRender( XRenderPicture *picture, QRect rect, float xScale, float yScale, void ShadowEffect::drawShadowQuadXRender( XRenderPicture *picture, QRect rect, float xScale, float yScale,
QColor color, float opacity, float brightness, float saturation ) QColor color, float opacity, float brightness, float saturation )
{ {
Q_UNUSED( saturation );
#ifdef KWIN_HAVE_XRENDER_COMPOSITING #ifdef KWIN_HAVE_XRENDER_COMPOSITING
XRenderPicture fill; XRenderPicture fill;
if( color.isValid() ) if( color.isValid() )

View File

@ -111,6 +111,7 @@ void TaskbarThumbnailEffect::paintWindow( EffectWindow* w, int mask, QRegion reg
void TaskbarThumbnailEffect::windowDamaged( EffectWindow* w, const QRect& damage ) void TaskbarThumbnailEffect::windowDamaged( EffectWindow* w, const QRect& damage )
{ {
Q_UNUSED( damage );
// Update the thumbnail if the window was damaged // Update the thumbnail if the window was damaged
foreach( EffectWindow* window, thumbnails.keys() ) foreach( EffectWindow* window, thumbnails.keys() )
foreach( const Data &thumb, thumbnails.values( window )) foreach( const Data &thumb, thumbnails.values( window ))

View File

@ -1225,7 +1225,7 @@ void Client::checkWorkspacePosition()
newGeom.x() != leftMax ) newGeom.x() != leftMax )
{ // Left was touching before but isn't anymore { // Left was touching before but isn't anymore
// If the other side was touching make sure it still is afterwards // If the other side was touching make sure it still is afterwards
if( newGeom.y() == newGeom.x() + newGeom.width() == oldRightMax ) if( newGeom.x() + newGeom.width() == oldRightMax )
newGeom.setLeft( qMax( leftMax, screenArea.x() )); newGeom.setLeft( qMax( leftMax, screenArea.x() ));
else else
newGeom.moveLeft( qMax( leftMax, screenArea.x() )); newGeom.moveLeft( qMax( leftMax, screenArea.x() ));

View File

@ -87,8 +87,8 @@ void Monitor::resizeEvent( QResizeEvent* e )
void Monitor::checkSize() void Monitor::checkSize()
{ {
QRect contentsRect = previewRect(); QRect contentsRect = previewRect();
int w = 151; //int w = 151;
int h = 115; //int h = 115;
view->setGeometry(contentsRect); view->setGeometry(contentsRect);
scene->setSceneRect(QRect(QPoint(0,0), contentsRect.size())); scene->setSceneRect(QRect(QPoint(0,0), contentsRect.size()));
int x2 = ( contentsRect.width() - 20 ) / 2; int x2 = ( contentsRect.width() - 20 ) / 2;
@ -275,12 +275,14 @@ void Monitor::Corner::paint( QPainter* painter, const QStyleOptionGraphicsItem*
void Monitor::Corner::hoverEnterEvent( QGraphicsSceneHoverEvent * e) void Monitor::Corner::hoverEnterEvent( QGraphicsSceneHoverEvent * e)
{ {
Q_UNUSED( e );
m_hover = true; m_hover = true;
update(); update();
} }
void Monitor::Corner::hoverLeaveEvent( QGraphicsSceneHoverEvent * e) void Monitor::Corner::hoverLeaveEvent( QGraphicsSceneHoverEvent * e)
{ {
Q_UNUSED( e );
m_hover = false; m_hover = false;
update(); update();
} }