On Wed, Oct 26, 2016 at 07:04:35PM +1100, Erik de Castro Lopo wrote:
> Anthony Towns wrote:
> > Maybe
> > /usr/lib/x86_64-linux-gnu/qt5/examples/widgets/desktop/systray/systray
> > might reproduce the crash?
> Indeed it does! Gdb backtrace follows.
Okay, that makes it a Qt/GL bug afaics then. Might be worth trying the
attached. I get:
$ g++ -o test test.cpp -lX11 -lGL -Wall -W
$ ./test
config 0 alphaSize 0
config 1 alphaSize 0
config 2 alphaSize 0
...
config 36 alphaSize 0
config 37 alphaSize 0
config 38 alphaSize 8
config 39 alphaSize 8
I'm guessing you'll get some visual==NULL!! warnings as well at which
point you might be able to work out what's going on?
Cheers,
aj
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <GL/gl.h>
#include <GL/glx.h>
#include <GL/glxext.h>
int main(void) {
Display *display = XOpenDisplay(NULL);
int screen = DefaultScreen( display );
// should be:
// int drawableBit = 1;
// QSurfaceFormat format = window()->requestedFormat();
// QVector<int> spec = qglx_buildSpec(format, drawableBit);
// visual_attribs = spec.constData()
// but we'll try allowing anything... :-/
static int visual_attribs[] = { None };
int confcount = 0;
GLXFBConfig *configs;
configs = glXChooseFBConfig(display, screen, visual_attribs, &confcount);
if (configs == NULL) {
printf("configs was null, confcount is %d\n", confcount);
return 0;
}
for (int i = 0; i < confcount; i++) {
int alphaSize;
glXGetFBConfigAttrib(display,configs[i],GLX_ALPHA_SIZE,&alphaSize);
printf("config %d alphaSize %d\n", i, alphaSize);
XVisualInfo *visual = glXGetVisualFromFBConfig(display, configs[i]);
if (visual == NULL) {
printf("config %d visual==NULL!!\n", i);
}
}
return 0;
}