Summary: | drop target runs mad on loaded system and strangely moves around when dragged | ||
---|---|---|---|
Product: | [Applications] kget | Reporter: | Marcel Partap <mpartap> |
Component: | general | Assignee: | KGet authors <kget> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Marcel Partap
2004-12-18 21:47:56 UTC
dragged not dropped *fg tried it again, it feels more like you throw rather than drag it.. very strange indeed. I can confirm this but I can spot nothing in the code that could cause this. Maybe it's a qt bug. I'll try to investigate further SVN commit 435925 by pino: Another backport from the make_kget_cool branch: make the drop target movement more fluid. The drop target now can be slightly slower than the mouse movement when dragged, but sure it doesn't behave anymore like a crazy ball. BUG: 95415 M +17 -4 droptarget.cpp M +6 -2 droptarget.h --- trunk/KDE/kdenetwork/kget/droptarget.cpp #435924:435925 @@ -102,6 +102,8 @@ popupMenu->insertSeparator(); kmain->m_paQuit->plug(popupMenu); + isdragging = false; + // Enable dropping setAcceptDrops(true); } @@ -119,9 +121,11 @@ if (e->button() == LeftButton) { // toggleMinimizeRestore (); - oldX = 0; - oldY = 0; - +// oldX = 0; +// oldY = 0; + isdragging = true; + dx = QCursor::pos().x() - pos().x(); + dy = QCursor::pos().y() - pos().y(); } else if (e->button() == RightButton) { @@ -198,16 +202,25 @@ /** No descriptions */ void DropTarget::mouseMoveEvent(QMouseEvent * e) { +/* if (oldX == 0) { oldX = e->x(); oldY = e->y(); return; } ++*/ + if (isdragging) + move( QCursor::pos().x() - dx, QCursor::pos().y() - dy ); - QWidget::move(x() + (e->x() - oldX), y() + (e->y() - oldY)); +// move(x() + (e->x() - oldX), y() + (e->y() - oldY)); // <<-- } +void DropTarget::mouseReleaseEvent(QMouseEvent *) +{ + isdragging = false; +} + /** No descriptions */ void DropTarget::mouseDoubleClickEvent(QMouseEvent * e) { --- trunk/KDE/kdenetwork/kget/droptarget.h #435924:435925 @@ -56,6 +56,7 @@ /** No descriptions */ virtual void mouseMoveEvent(QMouseEvent *); virtual void mousePressEvent(QMouseEvent * e); + virtual void mouseReleaseEvent(QMouseEvent *); private slots: void toggleSticky(); @@ -76,8 +77,11 @@ QBitmap mask; public: // Public attributes /** */ - int oldX; - int oldY; +// int oldX; +// int oldY; + int dx; + int dy; + bool isdragging; }; #endif // _DROPTARGET_H |