Patch proxy widget rendering and plugins

Koos Vriezen koos.vriezen at xs4all.nl
Sat Nov 22 19:20:05 GMT 2003


On Sat, 22 Nov 2003, Lars Knoll wrote:

> On Friday 21 November 2003 19:00, Dirk Mueller wrote:
>
> > that it isn't added to the visiblerect list is a major bug as well.
>
> Koos, do you have a test case for this? I'll then look into it.

No, and I've no idea if it causes the sometimes gray rectangles for java
(eg. http://developer.netscape.com/docs/examples/java/hitman.html and
pressing F5 a few times).
Reading of the code:
RenderWidget::setQWidget:220 removes it from visibleWidgets
RenderWidget::paintObject:378 adds it. paintObject is called from
RenderReplaced::paint, so from KHTMLView::drawContents:468/482 that is
after the clipping is set. So the first time, clipping is not correctly
set.
Did some test, like

--- rendering/render_replaced.cpp       22 Nov 2003 15:59:52 -0000  1.149
+++ rendering/render_replaced.cpp       22 Nov 2003 19:05:58 -0000
@@ -199,6 +199,7 @@ void RenderWidget::setQWidget(QWidget *w
         }
         m_widget = widget;
         if (m_widget) {
+            m_widget->hide();
             connect( m_widget, SIGNAL( destroyed()), this, SLOT(
slotWidgetDestructed()));
             m_widget->installEventFilter(this);

@@ -377,7 +378,7 @@ void RenderWidget::paintObject(QPainter*
     }
     m_view->setWidgetVisible(this, true);
     m_view->addChild(m_widget, xPos, yPos );
-    m_widget->show();
+    //m_widget->show();
     paintWidget(p, m_widget, x, y, w, h, _tx, _ty);
 }

@@ -418,12 +419,15 @@ void RenderWidget::paintWidget(QPainter
     allowWidgetPaintEvents = true;

     if (!strcmp(widget->name(), "__khtml")) {
+        widget->show();
         bool dsbld = QSharedDoubleBuffer::isDisabled();
         QSharedDoubleBuffer::setDisabled(true);
        QPixmap pm = copyWidget(tx, ty, p, widget);
         QSharedDoubleBuffer::setDisabled(dsbld);
         p->drawPixmap(tx, ty, pm);
     } else {
+        if (!widget->isVisible())
+            QTimer::singleShot (10, widget, SLOT (show()));
         // QScrollview is difficult and I currently know of no way to get
         // the stuff on screen without flicker.
         //

so there is no/little chance of a painting race between khtml and the jvm
(if it was possible at all in X), but it doesn't show any improvements.
I guess for now let this be like it is, unless you see any problems.

I'm afraid I have to look elsewhere..

Koos





More information about the kfm-devel mailing list