Hi,
We are having problems with one of out Qt applications (running native Qt event loop) which
also displays ROOT histograms in ROOT canvas. In some cases it generates loads of messages
with X11 errors, like:
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 55 (X_CreateGC)
Resource id: 0x0
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 55 (X_CreateGC)
Resource id: 0x0
X Error: BadGC (invalid GC parameter) 13
Major opcode: 60 (X_FreeGC)
Resource id: 0x0
X Error: BadGC (invalid GC parameter) 13
Major opcode: 60 (X_FreeGC)
Resource id: 0x0
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 55 (X_CreateGC)
Resource id: 0x0
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 55 (X_CreateGC)
Resource id: 0x0
X Error: BadGC (invalid GC parameter) 13
Major opcode: 56 (X_ChangeGC)
Resource id: 0x0
... and so on
This usually happens when opening ROOT context menu and selecting one of the entries there, e.g. Inspect
or SetLineAttributes. I tried to debug it but could not see any obvious issues in our code. Looking at the
backtrace in debugger I think what happens is that QtRoot tries to draw on Qt widgets that have not been
mapped to X11 display (hence “Resource id: 0x0” in the messages). This could be related to how events
are processed in QtRoot, I have a suspicion that order of the events may be different from pure-ROOT
event loop.
This is observed with CERN-installed ROOT v5.36.13. I made simple test application which reproduces this
error in a few lines of code:
#include <QtGui/QApplication>
#include <TROOT.h>
#include <TQtWidget.h>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
TQtWidget::InitRint(false, "test_qtroot", &argc, argv);
gROOT->Inspect();
return app.exec();
}
and a Makefile:
QTDIR = /afs/cern.ch/sw/lcg/external/qt/4.8.4/x86_64-slc6-gcc47-opt
ROOTSYS = /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.13/x86_64-slc6-gcc47-dbg/root
CXXFLAGS = -I$(QTDIR)/include $(shell $(ROOTSYS)/bin/root-config --cflags)
LDLIBS = $(shell $(ROOTSYS)/bin/root-config --libs) -lQtRoot -L$(QTDIR)/lib -lQtCore -lQtGui
test_qtroot: test_qtroot.cc
Make sure that you set ROOTSYS, QTDIR and LD_LIBRARY_PATH in your shell before you run executable.
Could someone help us to find workaround for this issue?
Another less urgent thing is that QtRoot prints some weird messages to a terminal:
** $Id$ this=0x1d80360
Symbol font family found: "Standard Symbols L"
Font metric w = 148 h = 14 points= 0 pixels= 12 QFont( "Arial,0,12,0,80,0,0,0,0,0" )
TGQt::ClearArea: *** wrong client are size: 0 : 0
Would be nice to get rid of those, they end up in the logs and confuse people.
Thanks,
Andy