You are not logged in.

1

Friday, January 30th 2009, 3:17pm

QT4 mess up the OpenGL context ?

Hi, I may have a bug about QT4 to submit to you.
The whole discussion can be found here
http://www.cairo-dock.org/bg_topic.php?t=2156, but here is a summary :
Cairo-Dock is an appli that draws on a RGBA GLX visual, that is to say draw with openGL on a window with real transparency.
Some users have noticed that if the dock is launched, VLC will crashes when trying to start it.
Little by little we've outlined a set of programs that will systematically crash or behave in a strange way if the dock is launched, or after it has been launched (SmPlayer & KMplayer will be transparent, Skype and VirtualBox will have some similar problems too, etc).
In the list of concerned programs, we noticed that all are QT4-based. No Gnome program are affected (for instance Totem), nor common X programs (like Mplayer). The dock works flawlessly with Compiz or any other window manager (including Kwin), the WM does not seem to affect the problem. Being under KDE or Gnome doesn't change anything too, only using qt instead of gtk seems to have an impact.

Setting

Source code

1
export XLIB_SKIP_ARGB_VISUALS=1

before launching VLC and the other will make them behave normally.

here is a debug from VLC after the crash :

Quoted

VLC media player 1.0.0-git Goldeneye
X Error: BadMatch (invalid parameter attributes) 8
Major opcode: 2 (X_ChangeWindowAttributes)
Resource id: 0x6800035
QPainter::begin: Paint device returned engine == 0, type: 1
QPainter::begin: Paint device returned engine == 0, type: 1
QPainter::begin: Paint device returned engine == 0, type: 1
QPainter::begin: Paint device returned engine == 0, type: 1
[????????] x11 video output error: X11 request 147.3 failed with error code 8:
BadMatch (invalid parameter attributes)
[????????] x11 video output notice: buggy X11 server claims shared memory
[????????] x11 video output notice: support though it does not work (OpenSSH?)
[????????] x11 video output error: X11 request 147.3 failed with error code 8:
BadMatch (invalid parameter attributes)
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 147 (MIT-SHM)
Minor opcode of failed request: 3 (X_ShmPutImage)
Serial number of failed request: 63
Current serial number in output stream: 64
So we are thinking that maybe there is a problem in QT4 concerning its openGL part.
I would greatly appreciate your help to solve this mistery !

In case you want to check, the code of the project can be found on :
svn checkout svn://svn.berlios.de/cairo-dock/trunk
the OpenGL stuff is all located in cairo-dock-draw-opengl.c
here is a sample, how I get the openGL config, since it seems to be the problem; maybe you will notice some big mistake :

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
GdkGLConfig *cairo_dock_get_opengl_config (gboolean bForceOpenGL, gboolean *bHasBeenForced)  // taken from a MacSlow's exemple.
{
        GdkGLConfig *pGlConfig = NULL;
        
        Display *XDisplay = cairo_dock_get_Xdisplay ();
        
        GLXFBConfig *pFBConfigs; 
        XRenderPictFormat *pPictFormat = NULL;
        int doubleBufferAttributes[] = {
                GLX_DRAWABLE_TYPE,      GLX_WINDOW_BIT,
                GLX_RENDER_TYPE,                GLX_RGBA_BIT,
                GLX_DOUBLEBUFFER,       True,
                GLX_RED_SIZE,           1,
                GLX_GREEN_SIZE,                 1,
                GLX_BLUE_SIZE,          1,
                GLX_ALPHA_SIZE,                 1,
                GLX_DEPTH_SIZE,                 1,
                GLX_STENCIL_SIZE,       1,
                None};
        
        
        XVisualInfo *pVisInfo = NULL;
        int i, iNumOfFBConfigs = 0;
        cd_debug ("cherchons les configs ...");
        pFBConfigs = glXChooseFBConfig (XDisplay,
                DefaultScreen (XDisplay),
                doubleBufferAttributes,
                &iNumOfFBConfigs);
        
        cd_debug (" -> %d FBConfig(s)", iNumOfFBConfigs);
        for (i = 0; i < iNumOfFBConfigs; i++)
        {
                pVisInfo = glXGetVisualFromFBConfig (XDisplay, pFBConfigs[i]);
                if (!pVisInfo)
                {
                        cd_warning ("this FBConfig has no visual.");
                        continue;
                }
                
                pPictFormat = XRenderFindVisualFormat (XDisplay, pVisInfo->visual);
                if (!pPictFormat)
                {
                        cd_warning ("this visual has an unknown format.");
                        XFree (pVisInfo);
                        pVisInfo = NULL;
                        continue;
                }
                
                if (pPictFormat->direct.alphaMask > 0)
                {
                        cd_message ("Strike, found a GLX visual with alpha-support !");
                        *bHasBeenForced = FALSE;
                        break;
                }

                XFree (pVisInfo);
                pVisInfo = NULL;
        }
        if (pFBConfigs)
                XFree (pFBConfigs);
        
        if (pVisInfo == NULL && bForceOpenGL)
        {
                cd_warning ("we could not get an ARGB-visual, trying to get an RGB one...");
                *bHasBeenForced = TRUE;
                doubleBufferAttributes[13] = 0;
                pFBConfigs = glXChooseFBConfig (XDisplay,
                        DefaultScreen (XDisplay),
                        doubleBufferAttributes,
                        &iNumOfFBConfigs);
                cd_message ("got %d FBConfig(s) this time", iNumOfFBConfigs);
                for (i = 0; i < iNumOfFBConfigs; i++)
                {
                        pVisInfo = glXGetVisualFromFBConfig (XDisplay, pFBConfigs[i]);
                        if (!pVisInfo)
                        {
                                cd_warning ("this FBConfig has no visual.");
                        }
                        else
                                break;
                }
                if (pVisInfo == NULL)
                {
                        cd_warning ("still no visual, this is the last chance");
                        pVisInfo = glXChooseVisual (XDisplay,
                                DefaultScreen (XDisplay),
                                doubleBufferAttributes);
                }
        }
        if (pVisInfo != NULL)
        {
                cd_message ("ok, got a visual");
                pGlConfig = gdk_x11_gl_config_new_from_visualid (pVisInfo->visualid);
                XFree (pVisInfo);
        }
        else
        {
                cd_warning ("couldn't find a suitable GLX Visual, OpenGL can't be used.\n (sorry to say that, but your graphic card and/or its driver is crappy)");
                g_bUseOpenGL = FALSE;
        }
        
        return pGlConfig;
}

2

Tuesday, March 3rd 2009, 4:40pm

up ?
it's really ennoying for people who are using Cairo-Dock with KDE.

3

Thursday, June 18th 2009, 4:33pm

Still no answer ?

4

Saturday, July 11th 2009, 10:55am

Up !

5

Thursday, July 16th 2009, 4:04pm

Up please !

6

Saturday, October 17th 2009, 9:11pm

Up !

Up !

7

Monday, January 11th 2010, 1:27pm

It's still problem.

8

Thursday, April 29th 2010, 4:39pm

QT devs!
Please update the state for this bug!

Thank you