Commit 050e06d2 authored by Tomaz  Canabrava's avatar Tomaz Canabrava

Fix Drag Drop from splits in Wayland

In wayland we cant use QCursor::position, it will always
return a bogus value
parent f96deb39
......@@ -574,9 +574,8 @@ void TerminalDisplay::hideDragTarget()
update();
}
void TerminalDisplay::showDragTarget()
void TerminalDisplay::showDragTarget(const QPoint& cursorPos)
{
auto cursorPos = mapFromGlobal(QCursor::pos());
using EdgeDistance = std::pair<int, Qt::Edge>;
auto closerToEdge = std::min<EdgeDistance>(
{
......
......@@ -74,7 +74,7 @@ public:
explicit TerminalDisplay(QWidget *parent = nullptr);
~TerminalDisplay() Q_DECL_OVERRIDE;
void showDragTarget();
void showDragTarget(const QPoint& pos);
void hideDragTarget();
void applyProfile(const Profile::Ptr& profile);
......
......@@ -307,7 +307,8 @@ void Konsole::ViewSplitter::dragMoveEvent(QDragMoveEvent* ev)
return;
}
currentDragTarget = terminal;
currentDragTarget->showDragTarget();
auto localPos = currentDragTarget->mapFromParent(ev->pos());
currentDragTarget->showDragTarget(localPos);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment