[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/khtml/rendering
From:       Germain Garand <germain () ebooksfrance ! org>
Date:       2010-02-13 17:04:02
Message-ID: 1266080642.038200.14017.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1089664 by ggarand:

mitigate textarea selection extension problem by clamping
the mouse move event to the widget rect, so that the
selection isn't reset when you leave the widget rect while selecting.

at least you can now extend+scroll from top to bottom (selecting
from bottom to top still doesn't scroll properly though.)

possible turnaround would be to send a mousewheel event in the appropriate
direction when the mouse event is outside the rect..

CCBUG: 156574

 M  +16 -0     render_replaced.cpp  


--- trunk/KDE/kdelibs/khtml/rendering/render_replaced.cpp #1089663:1089664
@@ -1004,6 +1004,20 @@
         QPoint p(me.clientX() - absx + m_view->contentsX(),
                  me.clientY() - absy + m_view->contentsY());
 
+        if (ev.id() == EventImpl::MOUSEMOVE_EVENT && view()->mouseEventsTarget()) {
+            // mitigate the problem that mouse moves outside of the widget rect
+            // interrupt the selection process in textarea (#156574)
+            // e.g. when extending a selection upward to make a textarea scroll
+            // while selecting its content.
+            // We don't emulate properly what Qt does it seems,tough I verified
+            // the move event is properly forwarded to the textarea and has
+            // appropriate coordinates. Might be Enter/Leave issue. ### FIXME
+            // In the meantime, clamping the event to the widget rect
+            // will at least prevent the selection to be lost.
+            p.setX(qMin(qMax(0,p.x()),m_widget->width()));
+            p.setY(qMin(qMax(0,p.y()),m_widget->height()));
+        }
+
         QWidget* target = 0;
         target = m_widget->childAt(p);
 
@@ -1034,6 +1048,8 @@
         }
 
         if (target && ev.id() == EventImpl::MOUSEMOVE_EVENT) {
+            // ### is this one still necessary? it doubles every mouse event...
+            // I'd reckon it's no longer needed since Harri made the event propagation bubble
             QMouseEvent evt(QEvent::MouseMove, p, Qt::NoButton,
                             QApplication::mouseButtons(), QApplication::keyboardModifiers());
             QApplication::sendEvent(target, &evt);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic