[Kget] [Bug 95415] drop target runs mad on loaded system and strangely moves around when dragged

Pino Toscano toscano.pino at tiscali.it
Mon Jul 18 19:11:02 CEST 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=95415         
toscano.pino tiscali it changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From toscano.pino tiscali it  2005-07-18 19:11 -------
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



More information about the Kget mailing list