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. Qt::Popup window in debugger seizes up whole windowing system
Forum Updated to NodeBB v4.3 + New Features

Qt::Popup window in debugger seizes up whole windowing system

Scheduled Pinned Locked Moved Unsolved General and Desktop
26 Posts 6 Posters 3.9k Views 5 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.
  • Christian EhrlicherC Offline
    Christian EhrlicherC Offline
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by
    #17

    I already told somewhere else that 'popup' and debugging doesn't work together. You will likely get the same problems with other gui frameworks.

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    JonBJ 1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher

      I already told somewhere else that 'popup' and debugging doesn't work together. You will likely get the same problems with other gui frameworks.

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

      @Christian-Ehrlicher
      Yes, and that is a nightmare for debugging, if you cannot help but have a popup and need to debug while it's on-screen. As I have found, and almost have to give up on debugging my code since a lot happens when this popup is up :(

      I seem to recall in the distant past that this was an issue from e.g. Visual Studio if you had a combo box's drop down visible when you need to break, because in Windows that popup-box-of-choices is a special kind of "top-level desktop window" which blocks all input till the user does next click, and you can't access it or the debugger. Which caused us problems while developing code. I don't remember whether a later version of Windows (or VS) made this issue go away.

      I 1 Reply Last reply
      0
      • JonBJ JonB

        @Christian-Ehrlicher
        Yes, and that is a nightmare for debugging, if you cannot help but have a popup and need to debug while it's on-screen. As I have found, and almost have to give up on debugging my code since a lot happens when this popup is up :(

        I seem to recall in the distant past that this was an issue from e.g. Visual Studio if you had a combo box's drop down visible when you need to break, because in Windows that popup-box-of-choices is a special kind of "top-level desktop window" which blocks all input till the user does next click, and you can't access it or the debugger. Which caused us problems while developing code. I don't remember whether a later version of Windows (or VS) made this issue go away.

        I Offline
        I Offline
        iynaur
        wrote on last edited by
        #19

        @JonB You can try debug with -platform wayland

        JonBJ 1 Reply Last reply
        0
        • I iynaur

          @JonB You can try debug with -platform wayland

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

          @iynaur said in Qt::Popup window in debugger seizes up whole windowing system:

          @JonB You can try debug with -platform wayland

          Now this is totally beyond me! "wayland" means nothing to me. All I know is I have a Ubuntu VM (VirtualBox) running on my Windows 7 host. I believe it uses X11. Maybe that is "xcb", I don't know.

          In a word, are you saying I have/can try/will work using "wayland"? I cannot test atm....

          I 1 Reply Last reply
          0
          • JonBJ JonB

            @iynaur said in Qt::Popup window in debugger seizes up whole windowing system:

            @JonB You can try debug with -platform wayland

            Now this is totally beyond me! "wayland" means nothing to me. All I know is I have a Ubuntu VM (VirtualBox) running on my Windows 7 host. I believe it uses X11. Maybe that is "xcb", I don't know.

            In a word, are you saying I have/can try/will work using "wayland"? I cannot test atm....

            I Offline
            I Offline
            iynaur
            wrote on last edited by
            #21

            @JonB Could try this:
            https://linuxconfig.org/how-to-enable-disable-wayland-on-ubuntu-20-04-desktop
            and just run your app with
            ./yourapp -platform wayland
            in terminal

            JonBJ 2 Replies Last reply
            1
            • I iynaur

              @JonB Could try this:
              https://linuxconfig.org/how-to-enable-disable-wayland-on-ubuntu-20-04-desktop
              and just run your app with
              ./yourapp -platform wayland
              in terminal

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

              @iynaur
              Thank you! Will try tomorrow, if I remember....

              Though there are comments to the link you reference:

              I think I have followed this tutorial step by step, but I am still missing the Wayland option in the login menu…

              Same here. I followed the steps but the only options I see are “Ubuntu” and “Gnome Classic”.

              Note! Do not forget that the gpu drivers (nvidia, amd or intel) should allow the use of Wayland. If you have proprietary nvidia drivers uninstall them and install nouveau drivers.

              (Hopefully the last one is not relevant to me.)

              1 Reply Last reply
              0
              • I iynaur

                @JonB Could try this:
                https://linuxconfig.org/how-to-enable-disable-wayland-on-ubuntu-20-04-desktop
                and just run your app with
                ./yourapp -platform wayland
                in terminal

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

                @iynaur , or @ anyone else who knows!
                Well, I followed those instructions. Wayland was already enabled. I logged in using Wayland on Ubuntu. (Seems fine, all looked much the same as when I use X.) Did the ./yourapp -platform wayland. I get warning

                Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
                

                so did export QT_QPA_PLATFORM=wayland and ran again. Get same warning, it didn't make any difference. I get

                qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
                This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
                
                Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
                

                So I did what I tell everyone else: export QT_DEBUG_PLUGINS=1.

                It reports finding the metadata for each of the mentioned available platform plugins. Final line:

                QFactoryLoader::QFactoryLoader() checking directory path "/home/jon/AtH/debug/platforms" ...
                qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
                

                Since wayland is not listed among the Available platform plugins I presume this means I am supposed to have/install something to make Qt app run under Wayland? I do not compile Qt, I use the version (5.12) which is supplied with Ubuntu 20.04.

                So, what am I supposed to do now? Am I supposed to get some Qt support for Wayland from somewhere?

                Meanwhile I will do some further Googling....

                UPDATE
                I come across https://wiki.archlinux.org/index.php/wayland#Qt for Arch stating:

                To enable Wayland support in Qt 5 or 6, install the qt5-wayland or qt6-wayland package, respectively.

                So I get I need to install something. But under Ubuntu apt-get install qt5-wayland gets me E: Unable to locate package qt5-wayland, so now what...?

                UPDATE2
                OK, so I discover under Ubuntu it has to be

                apt-get install qtwayland5
                

                Sigh :)

                OK, so now my app does run under Wayland! Yippee!!

                I will soon try debugging now with Qt::Popup and see if I no longer "hang"!

                Meanwhile, I don't much like the way it looks under Wayland display manager, compared to GNOME :( For one thing, the fonts look bigger, it looks horrible compared to xcb. Maybe I need to configure Wayland somewhere to alter.....

                OK, I agree debugging no longer "freezes whole machine" with code Qt::Popup, which is great. But the Wayland layout/look/fonts are so horrible I cannot use this unless I can configure something somehow. Which I'm not getting from Googling? I don't even know that under Wayland app is using the default Fusion style I had under X11? Anyone know what to do to "configure" for Wayland, or is this not possible? Thanks!

                I 1 Reply Last reply
                0
                • JonBJ JonB

                  @iynaur , or @ anyone else who knows!
                  Well, I followed those instructions. Wayland was already enabled. I logged in using Wayland on Ubuntu. (Seems fine, all looked much the same as when I use X.) Did the ./yourapp -platform wayland. I get warning

                  Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
                  

                  so did export QT_QPA_PLATFORM=wayland and ran again. Get same warning, it didn't make any difference. I get

                  qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
                  This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
                  
                  Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
                  

                  So I did what I tell everyone else: export QT_DEBUG_PLUGINS=1.

                  It reports finding the metadata for each of the mentioned available platform plugins. Final line:

                  QFactoryLoader::QFactoryLoader() checking directory path "/home/jon/AtH/debug/platforms" ...
                  qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
                  

                  Since wayland is not listed among the Available platform plugins I presume this means I am supposed to have/install something to make Qt app run under Wayland? I do not compile Qt, I use the version (5.12) which is supplied with Ubuntu 20.04.

                  So, what am I supposed to do now? Am I supposed to get some Qt support for Wayland from somewhere?

                  Meanwhile I will do some further Googling....

                  UPDATE
                  I come across https://wiki.archlinux.org/index.php/wayland#Qt for Arch stating:

                  To enable Wayland support in Qt 5 or 6, install the qt5-wayland or qt6-wayland package, respectively.

                  So I get I need to install something. But under Ubuntu apt-get install qt5-wayland gets me E: Unable to locate package qt5-wayland, so now what...?

                  UPDATE2
                  OK, so I discover under Ubuntu it has to be

                  apt-get install qtwayland5
                  

                  Sigh :)

                  OK, so now my app does run under Wayland! Yippee!!

                  I will soon try debugging now with Qt::Popup and see if I no longer "hang"!

                  Meanwhile, I don't much like the way it looks under Wayland display manager, compared to GNOME :( For one thing, the fonts look bigger, it looks horrible compared to xcb. Maybe I need to configure Wayland somewhere to alter.....

                  OK, I agree debugging no longer "freezes whole machine" with code Qt::Popup, which is great. But the Wayland layout/look/fonts are so horrible I cannot use this unless I can configure something somehow. Which I'm not getting from Googling? I don't even know that under Wayland app is using the default Fusion style I had under X11? Anyone know what to do to "configure" for Wayland, or is this not possible? Thanks!

                  I Offline
                  I Offline
                  iynaur
                  wrote on last edited by
                  #24

                  @JonB you may use wayland just for debug your app and use your app in xcb mode (xcb mode can run in wayland desktop env). unless you are debugging ui rendering related code.
                  i dont know how to configure wayland ui either.

                  JonBJ 1 Reply Last reply
                  1
                  • I iynaur

                    @JonB you may use wayland just for debug your app and use your app in xcb mode (xcb mode can run in wayland desktop env). unless you are debugging ui rendering related code.
                    i dont know how to configure wayland ui either.

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

                    @iynaur
                    Thanks, yes. I have to switch to that "log onto Wayland Ubuntu" to be able to use it all (I think so, anyway?), I think you're right that you can still run xcb mode for there though, but I don't much like logging in that way. I will keep it for emergency debugging. Shame, but better than nothing!

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      Plastic.Jesus
                      wrote on last edited by
                      #26

                      I know this is an old post, but some additional info:

                      This not only seizes up the window manager, but actually seems to have the effect of eventually seizing up the whole kernel - power-off / power-on.

                      I encountered this problem a few weeks ago - it is indeed easily reproducible.

                      System is Fedora 39, running KDE / X.

                      Once the debugger breaks, KDE is seized hard, as described in earlier posts. My plan was to use Ctrl+Alt+F3 to get a console login prompt from where I was planning to attempt to killall -9 gdb. I was actually able to login if I did it quickly. The echo of keystrokes was very laggy, and by the time I got a few keystrokes entered to kill the debugger, the entire kernel seems seized. Monitors go to sleep and can't ping from another computer. This seems particularly surprising as all the processes involved are running in user space, and the text terminal does not have any window manager involved.

                      Hopefully this might provide a clue to anyone working on a solution.

                      Unfortunately, this lock-up is so destructive that I gave up trying to debug Qt::Popup widgets, and am just removing that flag while debugging - or of course good old printf / qDebug.

                      1 Reply Last reply
                      0
                      • Pl45m4P Pl45m4 referenced this topic on

                      • Login

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