From 7b2f79428acb7742ca019f5c63c571a733b012a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 27 Apr 2009 20:20:05 +0000 Subject: [PATCH] Mouse polling was deactivated wrongly in all zooming effects. BUG: 183983 svn path=/trunk/KDE/kdebase/workspace/; revision=960048 --- effects/lookingglass/lookingglass.cpp | 27 +++++++++++++++++++++------ effects/magnifier/magnifier.cpp | 24 ++++++++++++++++++++---- effects/zoom/zoom.cpp | 15 +++++++++++---- 3 files changed, 52 insertions(+), 14 deletions(-) diff --git a/effects/lookingglass/lookingglass.cpp b/effects/lookingglass/lookingglass.cpp index c362f4e336..e2f2fcb7dd 100644 --- a/effects/lookingglass/lookingglass.cpp +++ b/effects/lookingglass/lookingglass.cpp @@ -74,10 +74,25 @@ void LookingGlassEffect::reconfigure( ReconfigureFlags ) void LookingGlassEffect::toggle() { if( target_zoom == 1.0f ) + { target_zoom = 2.0f; + if( !polling ) + { + polling = true; + effects->startMousePolling(); + } + setEnabled( true ); + } else + { target_zoom = 1.0f; - setEnabled( true ); + if( polling ) + { + polling = false; + effects->stopMousePolling(); + } + setEnabled( false ); + } } void LookingGlassEffect::zoomIn() @@ -99,11 +114,11 @@ void LookingGlassEffect::zoomOut() { target_zoom = 1; setEnabled( false ); - } - if( polling ) - { - polling = false; - effects->stopMousePolling(); + if( polling ) + { + polling = false; + effects->stopMousePolling(); + } } effects->addRepaint( cursorPos().x() - radius, cursorPos().y() - radius, 2*radius, 2*radius ); } diff --git a/effects/magnifier/magnifier.cpp b/effects/magnifier/magnifier.cpp index 7058547bce..de16d7e4f0 100644 --- a/effects/magnifier/magnifier.cpp +++ b/effects/magnifier/magnifier.cpp @@ -161,11 +161,13 @@ void MagnifierEffect::zoomOut() { target_zoom /= 1.2; if( target_zoom < 1 ) - target_zoom = 1; - if( polling ) { - polling = false; - effects->stopMousePolling(); + target_zoom = 1; + if( polling ) + { + polling = false; + effects->stopMousePolling(); + } } effects->addRepaint( magnifierArea().adjusted( -FRAME_WIDTH, -FRAME_WIDTH, FRAME_WIDTH, FRAME_WIDTH )); } @@ -173,9 +175,23 @@ void MagnifierEffect::zoomOut() void MagnifierEffect::toggle() { if( target_zoom == 1.0 ) + { target_zoom = 2; + if( !polling ) + { + polling = true; + effects->startMousePolling(); + } + } else + { target_zoom = 1; + if( polling ) + { + polling = false; + effects->stopMousePolling(); + } + } effects->addRepaint( magnifierArea().adjusted( -FRAME_WIDTH, -FRAME_WIDTH, FRAME_WIDTH, FRAME_WIDTH )); } diff --git a/effects/zoom/zoom.cpp b/effects/zoom/zoom.cpp index 8a57e35946..6c89c1d6ed 100644 --- a/effects/zoom/zoom.cpp +++ b/effects/zoom/zoom.cpp @@ -95,11 +95,13 @@ void ZoomEffect::zoomOut() { target_zoom /= 1.2; if( target_zoom < 1 ) - target_zoom = 1; - if( polling ) { - polling = false; - effects->stopMousePolling(); + target_zoom = 1; + if( polling ) + { + polling = false; + effects->stopMousePolling(); + } } effects->addRepaintFull(); } @@ -107,6 +109,11 @@ void ZoomEffect::zoomOut() void ZoomEffect::actualSize() { target_zoom = 1; + if( polling ) + { + polling = false; + effects->stopMousePolling(); + } effects->addRepaintFull(); }