src/gui/kernel/qwidget_x11.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
--- a/src/gui/kernel/qwidget_x11.cpp	Tue Jan 26 12:42:25 2010 +0200
+++ b/src/gui/kernel/qwidget_x11.cpp	Tue Feb 02 00:43:10 2010 +0200
@@ -527,8 +527,13 @@
         QX11InfoData *xd = &X11->screens[qt_x11_create_desktop_on_screen];
         xinfo.setX11Data(xd);
     } else if (parentXinfo && (parentXinfo->screen() != xinfo.screen()
-                               || parentXinfo->visual() != xinfo.visual()))
+                               || (parentXinfo->visual() != xinfo.visual()
+                                   && !q->inherits("QGLWidget"))))
     {
+        // QGLWidgets have to be excluded here as they have a
+        // specially crafted QX11Info structure which can't be swapped
+        // out with the parent widgets QX11Info. The parent visual,
+        // for instance, might not even be GL capable.
         xinfo = *parentXinfo;
     }
 
@@ -1445,7 +1450,7 @@
                 icon_data[pos++] = image.width();
                 icon_data[pos++] = image.height();
                 if (sizeof(long) == sizeof(quint32)) {
-                    memcpy(icon_data.data() + pos, image.scanLine(0), image.numBytes());
+                    memcpy(icon_data.data() + pos, image.scanLine(0), image.byteCount());
                 } else {
                     for (int y = 0; y < image.height(); ++y) {
                         uint *scanLine = reinterpret_cast<uint *>(image.scanLine(y));