src/gui/kernel/qwidget_x11.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   525         qt_x11_create_desktop_on_screen != xinfo.screen()) {
   525         qt_x11_create_desktop_on_screen != xinfo.screen()) {
   526         // desktop on a certain screen other than the default requested
   526         // desktop on a certain screen other than the default requested
   527         QX11InfoData *xd = &X11->screens[qt_x11_create_desktop_on_screen];
   527         QX11InfoData *xd = &X11->screens[qt_x11_create_desktop_on_screen];
   528         xinfo.setX11Data(xd);
   528         xinfo.setX11Data(xd);
   529     } else if (parentXinfo && (parentXinfo->screen() != xinfo.screen()
   529     } else if (parentXinfo && (parentXinfo->screen() != xinfo.screen()
   530                                || parentXinfo->visual() != xinfo.visual()))
   530                                || (parentXinfo->visual() != xinfo.visual()
       
   531                                    && !q->inherits("QGLWidget"))))
   531     {
   532     {
       
   533         // QGLWidgets have to be excluded here as they have a
       
   534         // specially crafted QX11Info structure which can't be swapped
       
   535         // out with the parent widgets QX11Info. The parent visual,
       
   536         // for instance, might not even be GL capable.
   532         xinfo = *parentXinfo;
   537         xinfo = *parentXinfo;
   533     }
   538     }
   534 
   539 
   535     //get display, screen number, root window and desktop geometry for
   540     //get display, screen number, root window and desktop geometry for
   536     //the current screen
   541     //the current screen
  1443                 int pos = icon_data.size();
  1448                 int pos = icon_data.size();
  1444                 icon_data.resize(pos + 2 + image.width()*image.height());
  1449                 icon_data.resize(pos + 2 + image.width()*image.height());
  1445                 icon_data[pos++] = image.width();
  1450                 icon_data[pos++] = image.width();
  1446                 icon_data[pos++] = image.height();
  1451                 icon_data[pos++] = image.height();
  1447                 if (sizeof(long) == sizeof(quint32)) {
  1452                 if (sizeof(long) == sizeof(quint32)) {
  1448                     memcpy(icon_data.data() + pos, image.scanLine(0), image.numBytes());
  1453                     memcpy(icon_data.data() + pos, image.scanLine(0), image.byteCount());
  1449                 } else {
  1454                 } else {
  1450                     for (int y = 0; y < image.height(); ++y) {
  1455                     for (int y = 0; y < image.height(); ++y) {
  1451                         uint *scanLine = reinterpret_cast<uint *>(image.scanLine(y));
  1456                         uint *scanLine = reinterpret_cast<uint *>(image.scanLine(y));
  1452                         for (int x = 0; x < image.width(); ++x)
  1457                         for (int x = 0; x < image.width(); ++x)
  1453                             icon_data[pos + y*image.width() + x] = scanLine[x];
  1458                             icon_data[pos + y*image.width() + x] = scanLine[x];