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. Qt5 QWindow inside windowContainer not receiving keyboard events on Wayland
Forum Updated to NodeBB v4.3 + New Features

Qt5 QWindow inside windowContainer not receiving keyboard events on Wayland

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 422 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.
  • S Offline
    S Offline
    SamiV123
    wrote last edited by SamiV123
    #1

    Hello

    I have a QWindow that I use to render to with OpenGL.

    I set the QWindow inside a QWidget using 'QWidget::createWindowContainer'.

    On Wayland (KDE Plasma, 6.6.4, Qt 5.15.17)

    I can't receive any input events (keypresses, key releases).

    The 'keyPressEvent' virtual function is NOT invoked on the QWindow. I also tried registering an event filter on the QWidget that the createWindowContainer returns but that also didn't work

    Is there a solution to this?

    Additional bonus problems and incompetence points:

    1. I'm using QWindow instead of QOpenGLWidget because QOpenGLWidget has DOG SHIT for performance (an order of magnitude difference between the two, so the integration in the latter obviously does something mega stupid.. a glReadPixels probably..)

    2. If I set ´QT_QPA_PLATFORM=xcb' then the keyboard input event issue goes away but I get random crashes in the NVIDIA (580.76.05) OpenGL driver in random API calls such as glBufferData or even glClearColor. So obviously with this platform integration there's something seriously broken with the whole graphics stack.

    3. Also the rendering sometimes goes blank.

    Any ideas?

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

      Hi,

      Something is not clear: are you using 5.15.17 or is it the Qt version used by Plasma ?
      Do you have the same issue if building your application with Qt 6 ?

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

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Something is not clear: are you using 5.15.17 or is it the Qt version used by Plasma ?
        Do you have the same issue if building your application with Qt 6 ?

        S Offline
        S Offline
        SamiV123
        wrote last edited by SamiV123
        #3

        @SGaist said in Qt5 QWindow inside windowContainer not receiving keyboard events on Wayland:

        Hi,

        Something is not clear: are you using 5.15.17 or is it the Qt version used by Plasma ?
        Do you have the same issue if building your application with Qt 6 ?

        I suppose KDE is using Qt6 which is installed side by side. My Application is built against this Qt5 version.

        "Do you have the same issue if building your application with Qt 6 ?"

        I'm not going to port +200kloc to Qt6 just to try this. This is on Qt5 and that's that.

        R 1 Reply Last reply
        0
        • S Offline
          S Offline
          SamiV123
          wrote last edited by
          #4

          Ok, I tried many other workarounds including trying to install event filters and such and no chance.

          Looks like this the Qt5 Wayland integration is a SNAFU.

          1 Reply Last reply
          0
          • S SamiV123

            @SGaist said in Qt5 QWindow inside windowContainer not receiving keyboard events on Wayland:

            Hi,

            Something is not clear: are you using 5.15.17 or is it the Qt version used by Plasma ?
            Do you have the same issue if building your application with Qt 6 ?

            I suppose KDE is using Qt6 which is installed side by side. My Application is built against this Qt5 version.

            "Do you have the same issue if building your application with Qt 6 ?"

            I'm not going to port +200kloc to Qt6 just to try this. This is on Qt5 and that's that.

            R Offline
            R Offline
            RebeccaREells
            Banned
            wrote last edited by RebeccaREells
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • S SamiV123 referenced this topic

            • Login

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