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

List:       kfm-devel
Subject:    Re: Recent selection regressions/showstoppers
From:       bj () altern ! org
Date:       2004-08-07 11:50:42
Message-ID: 200408071400.50021.bj () altern ! org
[Download RAW message or body]

Ok, I located the problem in this commit:
http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdelibs/khtml/xml/dom_docimpl.cpp.diff?r1=1.288&r2=1.289&sortby=date&f=h


It is related to the focus.
Attached patch fixes the bugs for me, but I would like to have someone else's 
view on the patch.
(ps: I will be away for the next 3 hours)
regards

jean-baptiste


["dom.diff" (text/x-diff)]

Index: dom_docimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/xml/dom_docimpl.cpp,v
retrieving revision 1.289
diff -u -3 -r1.289 dom_docimpl.cpp
--- dom_docimpl.cpp	2 Aug 2004 17:50:12 -0000	1.289
+++ dom_docimpl.cpp	7 Aug 2004 11:46:55 -0000
@@ -2042,7 +2042,7 @@
                 oldFocusNode->deref();
             }
         }
-
+	
         if (m_focusNode) {
             m_focusNode->ref();
             m_focusNode->dispatchHTMLEvent(EventImpl::FOCUS_EVENT,false,false);
@@ -2052,8 +2052,7 @@
             m_focusNode->setFocus();
             if (m_focusNode != newFocusNode) return;
         }
-
-        updateRendering();
+	updateRendering();
     }
 
     // ### remove this code as soon as the event flow between frames
@@ -2063,14 +2062,15 @@
     // which the document erroneously considers the focus widget
     // can receive focus by a mouse click, e.g. if a widget outside
     // KHTML was focused before.
-            if (view()) {
-	if (!m_focusNode || !m_focusNode->renderer() || !m_focusNode->renderer()->isWidget())
+    
+            if (view() && m_focusNode) {
+		if (!m_focusNode->renderer() || !m_focusNode->renderer()->isWidget())
                     view()->setFocus();
-	else if (static_cast<RenderWidget*>(m_focusNode->renderer())->widget() &&
-		 qApp->focusWidget() != static_cast<RenderWidget*>(m_focusNode->renderer())->widget())
-                    static_cast<RenderWidget*>(m_focusNode->renderer())->widget()->setFocus();
+	    else if (static_cast<RenderWidget*>(m_focusNode->renderer())->widget() &&
+	       qApp->focusWidget() != static_cast<RenderWidget*>(m_focusNode->renderer())->widget())
+                static_cast<RenderWidget*>(m_focusNode->renderer())->widget()->setFocus();
             }
-        }
+}
 
 void DocumentImpl::attachNodeIterator(NodeIteratorImpl *ni)
 {


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

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