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

High DPI and multi-monitors: window appears offscreen.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Need More Info
    • Priority: Not Evaluated
    • Resolution: Incomplete
    • Affects Version/s: 5.9.1, 5.9.2, 5.10.0 Beta 4
    • Fix Version/s: None
    • Component/s: QPA: Windows
    • Labels:
      None

      Description

      In the following context, calling resize or move on a window before showing it results in an invisible window (see example below).

      • multi-monitor
      • Windows 10
      • Not the first window to appear
      • High DPI (at least 200%)
      • Mouse cursor is not on the primary screen. 
      #include "mainwindow.h"
      #include <QApplication>
      #include <QTimer>
      
      int main(int argc, char *argv[])
      {
      _wputenv_s(L"QT_AUTO_SCREEN_SCALE_FACTOR", L"1");
      
      QApplication a(argc, argv);
      //Timer gives time to move the cursor to another screen
      QWidget* f1 = new QWidget();
      QWidget* f2 = new QWidget();
      QTimer::singleShot(2000, [&]{
      f1->setWindowTitle("test f1");
      f1->show();
      f1->resize(100, 100);
      });
      
      QTimer::singleShot(5000, [&]{
      f2->setWindowTitle("test f2");
      f2->resize(100, 100);
      f2->show();
      });
      return a.exec();
      }
      
      

        Attachments

        1. qtbug64498.zip
          1 kB
        2. qtdiag_output.txt
          6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              kleint Friedemann Kleint
              Reporter:
              schristin@druide.com Sébastien Christin
            • Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes