Hi, I may have a bug about QT4 to submit to you.
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.
So we are thinking that maybe there is a problem in QT4 concerning its openGL part.
here is a sample, how I get the openGL config, since it seems to be the problem; maybe you will notice some big mistake :
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;
}
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;
}
To copy to clipboard, switch view to plain text mode
Bookmarks