force instant reaction for dnd border events
BUG: 136856 FIXED-IN: 4.9 REVIEW: 105254
This commit is contained in:
parent
30bb8be037
commit
8cae5fc073
2 changed files with 5 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue