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. GNOME+Wayland: Adwaita decorator hides text in QMessageBox, aboutQt, etc.
Qt 6.11 is out! See what's new in the release blog

GNOME+Wayland: Adwaita decorator hides text in QMessageBox, aboutQt, etc.

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 598 Views 2 Watching
  • 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.
  • R Offline
    R Offline
    ridderhoff
    wrote last edited by
    #1

    With Wayland GNOME (40.4 RHEL 9.8), using the default Qt Adwaita window decorator the text in QMessageBox overflows and gets hidden (and not resizeable). This is definitely a bug that should get fixed (if not already fixed in upstream), but at least it's easy for me to work around with QSS or even just adding newlines to the end. However, I found that the same bug also impacts the QApplication::aboutQt() dialog (entire last line truncated) and I have no clue how to fix that one.

    alt text

    So far I've only seen this with the Adwaita wayland client decorator, however, I can't use the radient decorator as it doesn't add borders, shadows, etc. making it basically unusable with stacked windows and susceptibility to migraines. Is there a fix/workaround for this or is my only option to force xcb on wayland?

    I mostly use C++ but here's a pyqt6 demonstration:

    import sys
    from PyQt6.QtWidgets import QApplication, QMessageBox
    
    app = QApplication(sys.argv)
    app.aboutQt()
    QMessageBox.question(
        None, 
        "GNOME40 RHEL 9.8 PyQt6.10.2 / Qt6.6.2", 
        "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
    )
    
    I 1 Reply Last reply
    0
    • R Offline
      R Offline
      ridderhoff
      wrote last edited by
      #2

      Also is there a way to get native window drop shadows in wayland gnome with Qt6?

      1 Reply Last reply
      0
      • R ridderhoff

        With Wayland GNOME (40.4 RHEL 9.8), using the default Qt Adwaita window decorator the text in QMessageBox overflows and gets hidden (and not resizeable). This is definitely a bug that should get fixed (if not already fixed in upstream), but at least it's easy for me to work around with QSS or even just adding newlines to the end. However, I found that the same bug also impacts the QApplication::aboutQt() dialog (entire last line truncated) and I have no clue how to fix that one.

        alt text

        So far I've only seen this with the Adwaita wayland client decorator, however, I can't use the radient decorator as it doesn't add borders, shadows, etc. making it basically unusable with stacked windows and susceptibility to migraines. Is there a fix/workaround for this or is my only option to force xcb on wayland?

        I mostly use C++ but here's a pyqt6 demonstration:

        import sys
        from PyQt6.QtWidgets import QApplication, QMessageBox
        
        app = QApplication(sys.argv)
        app.aboutQt()
        QMessageBox.question(
            None, 
            "GNOME40 RHEL 9.8 PyQt6.10.2 / Qt6.6.2", 
            "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
        )
        
        I Offline
        I Offline
        IgKh
        wrote last edited by IgKh
        #3

        Regarding QMessageBox text overflow, there was this ticket: https://qt-project.atlassian.net/browse/QTBUG-137253. It was closed due to lack of reproducibility since at least Qt 6.9.2. I also cannot reproduce any issues with Qt 6.11.1 under GNOME 50 in Arch Linux with your code sample. I'm not sure how Qt is packaged in RHEL, but be sure that you are using the Adwaita decorations plugin from the upstream qt6-qtwayland package.

        @ridderhoff said in GNOME+Wayland: Adwaita decorator hides text in QMessageBox, aboutQt, etc.:

        So far I've only seen this with the Adwaita wayland client decorator, however, I can't use the radient decorator as it doesn't add borders, shadows, etc. making it basically unusable with stacked windows and susceptibility to migraines. Is there a fix/workaround for this or is my only option to force xcb on wayland?

        Not use GNOME, or not use Qt. Yes, seriously. Qt's client side decorations plugins for Wayland exist because all Wayland applications must be able to draw their own decorations according to the basic protocol rules, but they are just a fallback.

        Qt, across all desktop platforms, was made with the position that window decorations are the responsibility of the window manager / platform as they are key part of the consistency of a GUI platform's user experience. GNOME's developers however won't even entertain the concept of Server Side Decorations, and refuse to implement the relevant Wayland protocol. My understanding of the project's position is that applications that want to have good window decorations (or work well in the environment in general) must be built with libadwaita; the existence of any other application toolkit is an afterthought at best.

        Whatever Qt can provide will always be playing catch-up. It is not that it can't be improved, just that it needs someone who cares about it enough to keep at it for a long time.

        You can indeed force going through XWayland (where Mutter has no choice but to provide server side decorations), or perhaps see if KDE or COSMIC are to your liking.

        1 Reply Last reply
        1
        • R Offline
          R Offline
          ridderhoff
          wrote last edited by
          #4

          I installed Qt 6.11.1 with the maintenance tool and made a simple C++ aboutQt() demo RHEL9. I then used patchelf --set-rpath and LD_DEBUG=libs to confirm that it was not using the system's Qt 6.6.2 libraries. The text clipping bug was still present. So maybe the underlying problem is/was a change/bug in Gnome/Mutter/Wayland/etc.? The EPEL package for qt6-qtwayland doesn't include the adwaita decorator despite having it set as the default. So maybe it's something they knew about.

          $ cat demo.pro
          TEMPLATE = app
          QT += gui widgets core
          SOURCES += main.cpp
          TARGET = demo
          
          $ cat main.cpp
          #include <QApplication>
          int main(int argc, char** argv) {
              QApplication app(argc, argv);
              app.aboutQt();
          }
          
          $ /opt/Qt/6.11.1/gcc_64/bin/qmake
          $ make
          $ patchelf --set-rpath "/opt/Qt/6.11.1/gcc_64/lib:/opt/Qt/6.11.1/gcc_64/plugins" ./demo
          $ LD_DEBUG=libs ./demo 2>&1| grep adwaita
          calling init: /opt/Qt/6.11.1/gcc_64/plugins/wayland-decoration-client/libadwaita.so
          

          I also don't experience the text clipping issue on Arch, but it would be nice to have drop shadows. Totally understand your points about GNOME devs randomly removing things and not providing workarounds (don't get me started on tray icons). Unfortunately I've given up on trying to convince everyone to use tiling WMs and RHEL9 w/ GNOME is something I'm required to support.

          I think xcb is fine but do you have any pointers for dynamically picking the right platform plugin / decorator to use? Or maybe I should just assume Wayland users have xwayland installed.

          1 Reply Last reply
          0
          • I Offline
            I Offline
            IgKh
            wrote last edited by
            #5

            Yes, your setup seems alright. Do note that the ticket was closed due to lack of reproduction, not due to a fix being made. It is quite possible that the bug is there, but not on all distributions. I'd suggest commenting there with your own findings, and you might want to tag Jan Grulich as well.

            Assuming that users have XWayland installed anyway is a safe assumption, and will probably keep being so for at least a few more years.

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

              Hi,

              Did you set the QT_DEBUG_PLUGINS environment variable to 1 before starting your application ?
              It might give you additional clues.

              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

              • Login

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