Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-69581

[regression] After shrinking to zero size XCB window loses ability to future back surface reinitialisation

XMLWordPrintable

    • Linux/X11

      The following test program is intended for the bug reproducing. Run the program and click on its window. The assertion will fail. The reason is that after shrinking to zero size a XCB window loses ability to QXcbBackingStore proper initialization while resizing. This bug is absent in Qt version 5.6.

      #include <QApplication>
      #include <QWidget>
      #include <QPainter>
      
      class TestWidget : public QWidget
      \{
      public:
       TestWidget(QWidget *parent);
      protected:
      void paintEvent(QPaintEvent *ev);
      };
      
      TestWidget::TestWidget(QWidget *parent) :QWidget(parent)
      \{
       setWindowFlags(Qt::Window);
      }
      
      void
      TestWidget::paintEvent(QPaintEvent *ev)
      \{
       QPainter P;
       int res=P.begin(this);
       Q_ASSERT(res);
      }
      
      static TestWidget *test_widget;
      
      void test()
      \{
       test_widget->resize(50, 100);
      }
      
      class MainWidget : public QWidget
      \{
      public:
       MainWidget():QWidget(0)
       \{
      
       }
      protected:
       bool event(QEvent *ev)
       \{
        QEvent::Type type=ev->type();
        switch(type)
        \{
         case QEvent::MouseButtonPress:
         test();
         return 1;
        }
        return QWidget::event(ev);
       }
      };
      
      int main(int argc, char *argv[])
      \{
       QApplication app(argc, argv);
       MainWidget widget;
       test_widget=new TestWidget(&widget);
       test_widget->show();
       test_widget->move(100, 100);
       test_widget->resize(0, 0);
      
       widget.resize(640, 256);
       widget.show();
       return app.exec();
      }
      

        1. QTBUG-69581.tgz
          1 kB
          Shawn Rutledge
        2. Screenshot from 2018-07-26 18-41-53.png
          370 kB
          sergeylogunov
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            paeglis Gatis Paeglis
            sergeylogunov sergeylogunov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes