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. Incorrect position of fenestration under Wayland.
Forum Updated to NodeBB v4.3 + New Features

Incorrect position of fenestration under Wayland.

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 403 Views 1 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.
  • F Offline
    F Offline
    Francky033
    wrote on last edited by
    #1

    Hello everyone!

    I have just compiled a program under Qt 6.6.3 and I notice that all the QQuickWidget windows I create systematically appear in the middle of the screen under Wayland.
    After some research, this seems to be a Wayland limitation.
    Is there anything planned to support this feature properly, or is it already possible to work around this problem?
    I realize that the program displays normally under Ubuntu 24.10 Wayland but incorrectly under Raspierry OS.

    Many thanks,

    Franck

    PS: Everything works normally under xcb...

    Christian EhrlicherC 1 Reply Last reply
    0
    • I Offline
      I Offline
      IgKh
      wrote on last edited by
      #2

      Yes it is a Wayland limitation. The core protocol does not allow application surfaces to know where they are positioned or move / resize themselves because "security". Other extension protocols (e.g. xdg-shell, and there are more) open up some limited capabilities for windows to affect their position, and the Qt Wayland client implements the client-side of some of some of them, but it all depends on if the particular compositor running chooses to implement them and how. This is different to the situation under X11, where there is a single common protocol to communicate with the Window Manager about such things.

      So it depends on the compositor running on your device.... It might have a special Wayland extension protocol of it own that it supports for this, or maybe it implements one of the common ones but in a broken fashion, or maybe there is a side D-Bus interface or a special IPC protocol (looking at you, Sway!).

      F 1 Reply Last reply
      2
      • F Francky033

        Hello everyone!

        I have just compiled a program under Qt 6.6.3 and I notice that all the QQuickWidget windows I create systematically appear in the middle of the screen under Wayland.
        After some research, this seems to be a Wayland limitation.
        Is there anything planned to support this feature properly, or is it already possible to work around this problem?
        I realize that the program displays normally under Ubuntu 24.10 Wayland but incorrectly under Raspierry OS.

        Many thanks,

        Franck

        PS: Everything works normally under xcb...

        Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • I IgKh

          Yes it is a Wayland limitation. The core protocol does not allow application surfaces to know where they are positioned or move / resize themselves because "security". Other extension protocols (e.g. xdg-shell, and there are more) open up some limited capabilities for windows to affect their position, and the Qt Wayland client implements the client-side of some of some of them, but it all depends on if the particular compositor running chooses to implement them and how. This is different to the situation under X11, where there is a single common protocol to communicate with the Window Manager about such things.

          So it depends on the compositor running on your device.... It might have a special Wayland extension protocol of it own that it supports for this, or maybe it implements one of the common ones but in a broken fashion, or maybe there is a side D-Bus interface or a special IPC protocol (looking at you, Sway!).

          F Offline
          F Offline
          felsi
          wrote last edited by
          #4

          I was facing the same problem with Debian/Gnome/Wayland.
          Because there are several threads with pretty useless information, here the solutions:

          Setting the variable QT_QPA_PLATFORM=xcb.
          I assume, that mutter treats the application as a X11 application and uses Xwayland.

          Or setting the variable QT_WAYLAND_SHELL_INTEGRATION=ivi-shell, like lgKh suggested.
          https://github.com/qt/qtwayland/tree/dev
          https://wayland.pages.freedesktop.org/weston/toc/ivi-shell.html

          Looks good to me.
          But maybe someone has an even better solution...

          1 Reply Last reply
          0
          • F Offline
            F Offline
            felsi
            wrote last edited by
            #5

            Oh, the second solution does not work.
            The shell integration could not be loaded, so the qpa plugin wayland could not be loaded, so it uses xcb as a fallback.
            It worked, so i didn't read the debug carefully, sorry.

            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