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

Positioning QDockWidgets has no effect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 6.1.0 Alpha
    • Fix Version/s: None
    • Component/s: QPA: Wayland
    • Labels:
      None
    • Environment:
      Ubuntu 20.04, Mutter
    • Platform/s:
      Linux/Wayland

      Description

      It's possible that this is a side effect of how Wayland works, but it seems odd: You can position windows, but when positioning floating dock widgets they always end up to the top left of the main window.

      Reproducible with the following example:

      #include <QtWidgets>
      #include <QtGui>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QMainWindow window;
          window.resize(QSize(300, 300));
          window.move(QPoint(100, 100));
      
          QDockWidget *dock = new QDockWidget(&window);
          dock->setAllowedAreas(Qt::AllDockWidgetAreas);
      
          window.addDockWidget(Qt::TopDockWidgetArea, dock);
          dock->resize(QSize(50, 50));
          dock->move(QPoint(200, 200));
          dock->setFloating(true);
          window.show();
      
          return a.exec();
      }
      

      On X11 this works fine, but on Wayland the dock widget is mispositioned. Found when investigating QDockWidget autotest.

        Attachments

        For Gerrit Dashboard: QTBUG-91483
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            esabraha Eskil Abrahamsen Blomfeldt
            Reporter:
            esabraha Eskil Abrahamsen Blomfeldt
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes