summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmundson <[email protected]>2018-10-05 13:52:05 +0100
committerDavid Edmundson <[email protected]>2018-10-05 13:52:16 +0100
commit09074fcbbe774d6a7b5b1797e2b6328f9573c5ae (patch)
tree46a69cb101a5efd49c41246446488a21e87282ed
parente0296f210953a921a169b9212d08c7cb62df2fa6 (diff)
Don't drag windows in empty areas from touch/pen events
For a mouse users have the precision that if they clicked in an empty area they want to perform some action. For touch and tablets that isn't necessarily true. From Boud in a kwin report: "The drag the window by empty areas is a nasty one as well, especially when you're using a pen."
-rw-r--r--kstyle/oxygenwindowmanager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/kstyle/oxygenwindowmanager.cpp b/kstyle/oxygenwindowmanager.cpp
index 43f0fb7..64ca77d 100644
--- a/kstyle/oxygenwindowmanager.cpp
+++ b/kstyle/oxygenwindowmanager.cpp
@@ -453,6 +453,10 @@ namespace Oxygen
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>( event );
if( !( mouseEvent->modifiers() == Qt::NoModifier && mouseEvent->button() == Qt::LeftButton ) )
{ return false; }
+#if !OXYGEN_USE_KDE4
+ if (mouseEvent->source() != Qt::MouseEventNotSynthesized)
+ { return false; }
+#endif
// check lock
if( isLocked() ) return false;
@@ -508,6 +512,10 @@ namespace Oxygen
{
Q_UNUSED( object );
+#if !OXYGEN_USE_KDE4
+ if (mouseEvent->source() != Qt::MouseEventNotSynthesized)
+ { return false; }
+#endif
// stop timer
if( _dragTimer.isActive() ) _dragTimer.stop();