Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-45564

First application on X Server gets no mouse/touch dragging

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.5.1
    • None

    Description

      Repro steps:

      1. Start X11.
      2. Run the widgets/scroller/graphicsview demo. Mouse and touch drags are ignored, and the program appears unresponsive.
      3. Kill the graphicsview demo.
      4. Run the same program again. Mouse and touch drags move the items around as expected.

      The easy way to do the above is to write a ~/.xsession file containing just

      exec /usr/lib/x86_64-linux-gnu/qt5/examples/widgets/scroller/graphicsview/graphicsview
      

      Fix it with this (ugly) workaround:

      timeout 0.02s /usr/lib/x86_64-linux-gnu/qt5/examples/gui/rasterwindow/rasterwindow
      exec /usr/lib/x86_64-linux-gnu/qt5/examples/widgets/scroller/graphicsview/graphicsview
      

      Note: I haven't started a window manager in the above, so that rules out one possible confounding factor. In fact, if I do start a window manager, it's necessary to let it start managing before performing the workaround step.

      I wonder if something is being initialised too late, but persists on the X server so that the next application finds it.

      Further investigation reveals the minimum I need to do for the workaround is

      #include <QGuiApplication>
      
      int main(int argc, char *argv[])
      {
          QGuiApplication app(argc, argv);
          return EXIT_SUCCESS;
      }
      

      It's not enough to just cause the GUI lib to be linked (e.g. by referencing QGuiApplication::staticMetaObject), but OTOH it's not necessary to call any more than the constructor. Running the above program before my application makes mouse/touch dragging work (for me).

      Attachments

        For Gerrit Dashboard: QTBUG-45564
        # Subject Branch Project Status CR V

        Activity

          People

            paeglis Gatis Paeglis
            tms13 Toby Speight
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes