Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-25772

Utils::ToolTip::setUp() does not check if QGuiApplication::screenAt() returns nullptr

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • Qt Creator 4.15.0
    • All Other Issues, Editors
    • None
    • Linux distro/kernel version : arch linux, kernel version 5.12.5-arch1-1
      NVIDIA driver version : 465.31-3
      No DE, just awesomeWM as the window manager, no lockscreen setup
    • Linux/X11

    Description

      Noticed for a few weeks/months that Qt Creator will sometimes sometimes crash when my screens go to / wake from sleep on Linux (X11). The crash happened on Qt Creator 4.14, and still does on 4.15.

      I'm running a pretty barebones desktop experience on my machine : no DE, only awesomeWM as a simple window manager. The two monitors I use are connected to my discrete graphics card, one via DisplayPort, and one via HDMI. I'm using the NVIDIA proprietary driver under the hood.

      As said before, when waking up the screens from sleep Qt Creator will sometimes crash. Running coredumpctl gdb reveals the crash happens in lib/qtcreator/libUtils.so.4, under the symbol Utils::ToolTip::placeTip(), more specifically when calling QScreen::availableGeometry() on this line of the `Utils` library (note : this is my best guess of the culprit, because of the bug's random nature I could not reproduce this with an instance of Qt Creator running under a debugger).

      And, as per the documentation of QScreen::availableGeometry() (emphasis mine) :

      Returns the screen at point, or nullptr if outside of any screen.

      We would simply need to check for the availability of the underlying screen, and set the QRect to a default-constructed QRect if the screen's not available.

      The fix would be pretty simple, but I don't know if I'm allowed to provide a patch file on here.
      Also, I don't know how/if the UX would be affected in any way (though I'd wager not, the tooltips might just show themselves in the wrong position for a frame or two).

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              con Eike Ziller
              thibaulltt Thibault de Villèle
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes