summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2012-06-14 20:40:12 (GMT)
committerThomas Lübking <thomas.luebking@gmail.com>2012-06-24 17:26:43 (GMT)
commitc1cbb499d011227bffe174d721a164606f2e8bd6 (patch)
tree4680c593e61912d8b54495242383305fe0d45af7
parent3071d561f5708ddc40aad3e9e6ed5218476fe64b (diff)
force instant reaction for dnd border events
BUG: 136856 FIXED-IN: 4.9 REVIEW: 105254
-rw-r--r--kwin/screenedge.cpp6
-rw-r--r--kwin/screenedge.h3
2 files changed, 5 insertions, 4 deletions
diff --git a/kwin/screenedge.cpp b/kwin/screenedge.cpp
index 380ec5d8..a1507c3 100644
--- a/kwin/screenedge.cpp
+++ b/kwin/screenedge.cpp
@@ -192,7 +192,7 @@ void ScreenEdge::unreserve(ElectricBorder border)
QTimer::singleShot(0, this, SLOT(update()));
}
-void ScreenEdge::check(const QPoint& pos, Time now)
+void ScreenEdge::check(const QPoint& pos, Time now, bool forceNoPushback)
{
if ((pos.x() != m_screenEdgeLeft) &&
(pos.x() != m_screenEdgeRight) &&
@@ -211,7 +211,7 @@ void ScreenEdge::check(const QPoint& pos, Time now)
Time treshold_reset = 250; // Reset timeout
Time treshold_trigger = options->electricBorderCooldown(); // Minimum time between triggers
int distance_reset = 30; // Mouse should not move more than this many pixels
- int pushback_pixels = options->electricBorderPushbackPixels();
+ int pushback_pixels = forceNoPushback ? 0 : options->electricBorderPushbackPixels();
ElectricBorder border;
if (pos.x() == m_screenEdgeLeft && pos.y() == m_screenEdgeTop)
@@ -374,7 +374,7 @@ bool ScreenEdge::isEntered(XEvent* e)
for (int i = 0; i < ELECTRIC_COUNT; ++i)
if (m_screenEdgeWindows[i] != None && e->xclient.window == m_screenEdgeWindows[i]) {
updateXTime();
- check(QPoint(e->xclient.data.l[2] >> 16, e->xclient.data.l[2] & 0xffff), xTime());
+ check(QPoint(e->xclient.data.l[2] >> 16, e->xclient.data.l[2] & 0xffff), xTime(), true);
return true;
}
}
diff --git a/kwin/screenedge.h b/kwin/screenedge.h
index aa89bf0..b2cda7b 100644
--- a/kwin/screenedge.h
+++ b/kwin/screenedge.h
@@ -58,8 +58,9 @@ public:
* if one is enabled for the current region and the timeout is satisfied
* @param pos the position of the mouse pointer
* @param now the time when the function is called
+ * @param forceNoPushBack needs to be called to workaround some DnD clients, don't use unless you want to chek on a DnD event
*/
- void check(const QPoint& pos, Time now);
+ void check(const QPoint& pos, Time now, bool forceNoPushBack = false);
/**
* Restore the size of the specified screen edges
* @param border the screen edge to restore the size of