Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to hide borders in a QTDialog under Wayland?

How to hide borders in a QTDialog under Wayland?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 952 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.
  • roipoussiereR Offline
    roipoussiereR Offline
    roipoussiere
    wrote on last edited by roipoussiere
    #1

    I'm developing a Qt application in Python that I would like make compatible with Sway/Wayland.

    This simple script is supposed to create a modal window without borders neither title:

    import sys
    from PyQt5.QtWidgets import QApplication, QDialog, QLabel
    from PyQt5.QtCore import Qt
    
    app = QApplication(sys.argv)
    d = QDialog()
    d.setModal(True)
    d.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint)
    
    d.setMinimumWidth(400)
    d.setMinimumHeight(400)
    d.setMaximumWidth(400)
    d.setMaximumHeight(400)
    
    QLabel('Hello world', d)
    d.show()
    sys.exit(app.exec_())
    

    But the borders are still here:

    2019-11-20_14-11-1574256087.jpg

    It seems that this is not an issue with Sway, so I suppose it's a Qt issue?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      I don't see anything that is related to border nor title in your code. So I would say that either your code is incomplete or you don't have the correct expectation from Wayland. You are also not showing how you start your application.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • roipoussiereR Offline
        roipoussiereR Offline
        roipoussiere
        wrote on last edited by
        #3

        @SGaist said in How to hide borders in a QTDialog under Wayland?:

        Hi and welcome to devnet,

        Thank you! :)

        I don't see anything that is related to border nor title in your code.

        It's this line:

        d.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint)
        

        You are also not showing how you start your application.

        To execute under Wayland I do:

        QT_QPA_PLATFORM=wayland-egl .venv/bin/python ./main.py
        

        And for X11 (where borders are not present) I do:

        QT_QPA_PLATFORM=xcb .venv/bin/python ./main.py
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @roipoussiere said in How to hide borders in a QTDialog under Wayland?:

          d.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint)

          That line doesn't appear in the code of your original post.

          Can you give more information about your Wayland setup ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • roipoussiereR Offline
            roipoussiereR Offline
            roipoussiere
            wrote on last edited by
            #5

            @SGaist said in How to hide borders in a QTDialog under Wayland?:

            That line doesn't appear in the code of your original post.

            I edited my post to add this specific line few minutes after submitting it. It's strange that you don't see it.

            Can you give more information about your Wayland setup ?

            I use Sway Window manager with the default config.

            You can find here (after clinking on Details) the logs when executing my script with WAYLAND_DEBUG=client.

            1 Reply Last reply
            0
            • roipoussiereR Offline
              roipoussiereR Offline
              roipoussiere
              wrote on last edited by
              #6

              Any news here?

              Can someone confirm that this is a Qt issue on Wayland?

              1 Reply Last reply
              0
              • roipoussiereR Offline
                roipoussiereR Offline
                roipoussiere
                wrote on last edited by
                #7

                I reported this bug here: https://bugreports.qt.io/browse/QTBUG-80702

                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