MantisBT - VTK
View Issue Details
0008648VTK(No Category)public2009-03-02 02:552011-01-13 17:00
Jeroen Wijnhout 
Clinton Stimpson 
normalmajoralways
closednot fixable 
 
 
0008648: QVTKWidget does not work well with compiz
When multiple QVTKWidget are used when using the compiz window manager (Ubuntu 8.10), very weird behavior is seen: On resizing one or more of the QVTKWidget stops responding. Sometimes you have to resize once, sometimes often for this to happen. Sometimes the whole desktop blocks before a resize is completed. When a QVTKWidget stops responding, clicking on it makes the complete desktop flicker once. When the window special effects are disabled (Ubuntu then switchs to a non compositing window manager) the QVTKWidgets work fine.
VTK 5.2.0
No tags attached.
zip QVTKWidgetTest.zip (20,050) 2009-03-04 04:16
https://www.vtk.org/Bug/file/7092/QVTKWidgetTest.zip
patch imageviewer.patch (1,008) 2009-03-04 11:30
https://www.vtk.org/Bug/file/7100/imageviewer.patch
Issue History
2009-03-02 02:55Jeroen WijnhoutNew Issue
2009-03-04 04:16Jeroen WijnhoutFile Added: QVTKWidgetTest.zip
2009-03-04 04:23Jeroen WijnhoutNote Added: 0015529
2009-03-04 11:30Clinton StimpsonFile Added: imageviewer.patch
2009-03-04 11:33Clinton StimpsonNote Added: 0015537
2009-03-04 11:33Clinton StimpsonStatusbacklog => tabled
2009-03-04 11:33Clinton StimpsonAssigned To => Clinton Stimpson
2009-03-04 15:49David ColeNote Added: 0015547
2009-03-04 16:05Clinton StimpsonNote Added: 0015549
2009-03-04 16:05Clinton StimpsonStatustabled => @80@
2009-03-04 16:05Clinton StimpsonResolutionopen => fixed
2009-03-05 04:33Jeroen WijnhoutNote Added: 0015558
2009-03-05 04:33Jeroen WijnhoutStatus@80@ => @20@
2009-03-05 04:33Jeroen WijnhoutResolutionfixed => reopened
2009-03-05 10:58Clinton StimpsonNote Added: 0015566
2009-03-06 03:18Jeroen WijnhoutNote Added: 0015586
2009-03-19 16:02Clinton StimpsonNote Added: 0015739
2009-03-19 16:02Clinton StimpsonStatus@20@ => closed
2009-03-19 16:02Clinton StimpsonResolutionreopened => not fixable
2011-01-13 17:00Source_changeset_attached => VTK master a2bd8391
2011-01-13 17:00Source_changeset_attached => VTK master 020ef709
2011-06-16 13:11Zack GalbreathCategory => (No Category)

Notes
(0015529)
Jeroen Wijnhout   
2009-03-04 04:23   
I've uploaded a test case (you might have to edit the .pro file to set the VTKDIR variable). Run the QVTKWidgetTest application, load the image (by pressing Ctrl+O, it loads the image 1.png). After a view resizes (usually within 10) one or more of the QVTKWidgets freezes.

This is with compiz version: 1:0.7.8-0ubuntu4.1 on Ubuntu 8.10.
Nvidia driver: 177.82-0ubuntu0.1

On my system this is completely reproducible, although the number of resizes that is necessary varies from time to time.
(0015537)
Clinton Stimpson   
2009-03-04 11:33   
I've attached a patch to fix vtkImageViewer2.cxx.
Also, you should fix your example to do this:

    // bind the window first before anything
    m_imageViewer->SetRenderWindow(GetRenderWindow());
    m_imageViewer->SetupInteractor(GetInteractor());
    m_imageViewer->SetInput(_image);
    m_imageViewer->Render();

As for the compiz specific behavior, I can reproduce it if I turn compiz on, but I can't help a compiz bug. Even ParaView starts acting funny when you add the 4th view.
(0015547)
David Cole   
2009-03-04 15:49   
Fixed in CVS HEAD:

cvs commit -m "BUG: Fix issue 0008648. Better SetSize code in vtkImageViewer2. Thanks to Clinton Stimpson for the patch."

/cvsroot/VTK/VTK/Rendering/vtkImageViewer2.cxx,v <-- Rendering/vtkImageViewer2.cxx
new revision: 1.40; previous revision: 1.39
(0015549)
Clinton Stimpson   
2009-03-04 16:05   
I'm now suspecting the resize problem is a bug in the nVidia drivers. If I keep compiz running with nVidia GL drivers, but make this test app run with Mesa3d, the problem goes away.

I don't think there's anything more that can be done in VTK to help you.
(0015558)
Jeroen Wijnhout   
2009-03-05 04:33   
Thanks for the patch on vtkImageViewer2. Integrating it with QVTKWidget works without any problems now. However the original bug was on the interaction of QVTKWidget with Compiz. This bug is not solved. I agree that it is most likely a NVidia driver bug, but the status is now set to fixed while the bug is really rejected. This is just a minor issue, but it now appears as if the QVTKWidget/Compiz problem has been solved.

Btw, perhaps the bug can be circumvented in QVTKWidget::x11_setup_window(), which has some explicit X11 calls that possibly triggers the bug?
(0015566)
Clinton Stimpson   
2009-03-05 10:58   
QVTKWidget::x11_setup_window() is required to get as many features as possible from the server side GL support.
Some X11 servers give a black/white or grayscale graphics window (depending on the default visual) unless that code is called. Also because KDE/Gnome typically want more features, the default visual gives most/all of the features to VTK apps without needing to call x11_setup_window(). One feature some linux users still don't get without x11_setup_window() is anti-aliasing.

Besides, Qt's OpenGL module does the same thing.

Its my guess this problem could be reproduced without QVTKWidget.

A quick google of "compiz resize slow" brings up a lot of hits. By design, there's nothing a client app can do to freeze the desktop unless there's a bug in the X11 server or one of its extension modules.
(0015586)
Jeroen Wijnhout   
2009-03-06 03:18   
Thanks for explaining why x11_setup_window is needed, I was kind of wondering about that.

I certainly experienced slow resizes under Compiz, but this behavior is even worse. But you are right, QVTKWidget is not to blame. I ditched Compiz for the time being and am happily using Qt/VTK now.

As far as I am concerned you can resolve this issue as "rejected" (or the equivalent of that in Mantis).
(0015739)
Clinton Stimpson   
2009-03-19 16:02   
Nothing to fix this problem in QVTKWidget.