From e49064c356b07c5f0e8961841cb6fe8bae073c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 19 Oct 2009 08:24:25 +0000 Subject: [PATCH] Check the dndEventDelay in Desktop Grid so that a click with moving does not move the window but activate the desktop. BUG: 211041 svn path=/trunk/KDE/kdebase/workspace/; revision=1037445 --- effects/desktopgrid/desktopgrid.cpp | 5 ++++- effects/desktopgrid/desktopgrid.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/effects/desktopgrid/desktopgrid.cpp b/effects/desktopgrid/desktopgrid.cpp index efa0f7b3e6..dcbca725e1 100644 --- a/effects/desktopgrid/desktopgrid.cpp +++ b/effects/desktopgrid/desktopgrid.cpp @@ -33,6 +33,7 @@ along with this program. If not, see . #include #include #include +#include namespace KWin { @@ -323,7 +324,8 @@ void DesktopGridEffect::windowInputMouseEvent( Window, QEvent* e ) if( e->type() == QEvent::MouseMove ) { int d = posToDesktop( me->pos()); - if( windowMove != NULL ) + if( windowMove != NULL && + (me->pos() - dragStartPos).manhattanLength() > KGlobalSettings::dndEventDelay() ) { // Handle window moving if( !wasWindowMove ) // Activate on move effects->activateWindow( windowMove ); @@ -363,6 +365,7 @@ void DesktopGridEffect::windowInputMouseEvent( Window, QEvent* e ) if( me->buttons() == Qt::LeftButton ) { // QRect rect; + dragStartPos = me->pos(); bool isDesktop = (me->modifiers() & Qt::ControlModifier); EffectWindow* w = isDesktop ? NULL : windowAt( me->pos()); if ( w != NULL ) diff --git a/effects/desktopgrid/desktopgrid.h b/effects/desktopgrid/desktopgrid.h index 0d7cc328fc..5b1a6648dd 100644 --- a/effects/desktopgrid/desktopgrid.h +++ b/effects/desktopgrid/desktopgrid.h @@ -86,6 +86,7 @@ class DesktopGridEffect bool wasWindowMove, wasDesktopMove; EffectWindow* windowMove; QPoint windowMoveDiff; + QPoint dragStartPos; // Soft highlighting QList hoverTimeline;