Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PySide6 QMainWindow move() not working on Ubuntu 22.04
Forum Updated to NodeBB v4.3 + New Features

PySide6 QMainWindow move() not working on Ubuntu 22.04

Scheduled Pinned Locked Moved Unsolved Qt for Python
7 Posts 3 Posters 2.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ErriezE Offline
    ErriezE Offline
    Erriez
    wrote on last edited by Erriez
    #1

    The following example with PySide6 6.1.4 installed with PIP does not move the window to a fixed screen location on Ubuntu 22.04, but works on Windows 10:

    # Example does not move window on Ubuntu 22.04
    from PySide6.QtWidgets import QApplication, QMainWindow
    import sys
    
    app = QApplication(sys.argv)
    mainwindow = QMainWindow()
    mainwindow.show()
    
    # Move not working on Ubuntu 22.04, works on Windows 10:
    mainwindow.move(1000, 800)
    
    app.exec()
    

    What could be the reason for a difference between Windows and Linux?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      friedemannkleint
      wrote on last edited by
      #2

      The code works fine on Ubuntu 22.04/KDE / X11. Are you using Wayland?

      ErriezE 1 Reply Last reply
      0
      • F friedemannkleint

        The code works fine on Ubuntu 22.04/KDE / X11. Are you using Wayland?

        ErriezE Offline
        ErriezE Offline
        Erriez
        wrote on last edited by
        #3

        @friedemannkleint Thanks for your answer. Yes, I'm using:

        • Ubuntu 22.04.1 LTS 64-bit (Running in VirtualBox)
        • All updates installed.
        • GNOME Version 42.5.
        • Windowing System: Wayland.

        The window opens in the upper left corner and not at position x=1000, y=800.

        Do you have a suggestion how to analyze this?

        1 Reply Last reply
        0
        • ErriezE Offline
          ErriezE Offline
          Erriez
          wrote on last edited by
          #4

          Reproducible with PySide2 on Ubuntu 22.04.1. Any suggestions?

          JonBJ 1 Reply Last reply
          0
          • ErriezE Erriez

            Reproducible with PySide2 on Ubuntu 22.04.1. Any suggestions?

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @Erriez Are you able to verify that is does work if you use Xorg?

            ErriezE 1 Reply Last reply
            0
            • JonBJ JonB

              @Erriez Are you able to verify that is does work if you use Xorg?

              ErriezE Offline
              ErriezE Offline
              Erriez
              wrote on last edited by Erriez
              #6

              @JonB I confirm the following with the test example in the first comment:

              • Ubuntu on Wayland: Does not work
              • Ubuntu X11: Works
              • LXDE: Works
              • Openbox: Works
              • MATE 22.10: Works
              • Xfce: Works
              • XUbuntu: Works
              • Windows 10: Works

              Ubuntu Wayland is our default development platform and commonly used by our customers. Is there some special configuration needed for Wayland?

              Jira bug report: PYSIDE-2190

              ErriezE 1 Reply Last reply
              1
              • ErriezE Erriez

                @JonB I confirm the following with the test example in the first comment:

                • Ubuntu on Wayland: Does not work
                • Ubuntu X11: Works
                • LXDE: Works
                • Openbox: Works
                • MATE 22.10: Works
                • Xfce: Works
                • XUbuntu: Works
                • Windows 10: Works

                Ubuntu Wayland is our default development platform and commonly used by our customers. Is there some special configuration needed for Wayland?

                Jira bug report: PYSIDE-2190

                ErriezE Offline
                ErriezE Offline
                Erriez
                wrote on last edited by Erriez
                #7

                @Erriez An unexpected answer in PYSIDE-2190:

                This is a platform-specific issue of the underlying Qt library unrelated to the Python bindings for Qt which this project tracks. Please contact Qt support or report it under the QTBUG project along with a minimal C++ example ( see https://wiki.qt.io/Reporting_Bugs ).

                The related issue QTBUG-86780 states that this is apparently not possible.

                See my comment in PYSIDE-2190 which demonstrates a TKinter application which can move a window with a few lines of code on all platforms, including Ubuntu Wayland.

                Conclusion:

                • Moving the application window is not supported in Qt / PySide 6.4.1.
                • Known issue QTBUG-86780, but still not documented in qtforpython-6.
                • Confirmed in QTBUG-110119.

                The reason why the quality of the Qt documentation is below our expectation is that the Qt developers confirmed this issue on Wayland and are ignoring the request to update the documentation.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved