Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-21321 XCB/QPA support is not finished yet
  3. QTBUG-21094

tst_qsgtextinput::cursorRectangle fails on qpa, xcb depending on X server's DPI

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Done
    • P1: Critical
    • 5.0.0
    • None

    Description

      This autotest fails on some systems, but not others. Through tweaking configuration of various machines I was able to figure out that the DPI setting of the x server influences the result.

      On my workstation, the test passes:

      $ xdpyinfo | grep -i 'dots per inch'
        resolution:    90x87 dots per inch
      $ make check TESTARGS=cursorRectangle
      ./tst_qsgtextinput cursorRectangle
      
      Information of screen 346:
        width.........: 1920
        height........: 1200
        depth.........: 24
        white pixel...: ffffff
        black pixel...: 0
      
      Running window manager: compiz
      ********* Start testing of tst_qsgtextinput *********
      Config: Using QTest library 5.0.0, Qt 5.0.0
      created GL window: 100663298
      created GL window: 100663302
      PASS   : tst_qsgtextinput::initTestCase()
      QWARN  : tst_qsgtextinput::cursorRectangle() font "Helvetica,12,-1,5,50,0,0,0,0,0" 
      QWARN  : tst_qsgtextinput::cursorRectangle() width of "Hello" 33 
      PASS   : tst_qsgtextinput::cursorRectangle()
      PASS   : tst_qsgtextinput::cleanupTestCase()
      Totals: 3 passed, 0 failed, 0 skipped
      ********* Finished testing of tst_qsgtextinput *********
      Number of leaked items: 0
      

      (note: the `font', `width' lines come from extra debugging I added to the test)

      On a virtual machine with a different DPI, the test fails:

      $ xdpyinfo | grep -i 'dots per inch'
        resolution:    96x96 dots per inch
      $ make check TESTARGS=cursorRectangle
      ./tst_qsgtextinput cursorRectangle
      
      Information of screen 258:
        width.........: 800
        height........: 600
        depth.........: 24
        white pixel...: ffffff
        black pixel...: 0
      
      Running window manager: KWin
      ********* Start testing of tst_qsgtextinput *********
      Config: Using QTest library 5.0.0, Qt 5.0.0
      created GL window: 54525954
      created GL window: 54525957
      PASS   : tst_qsgtextinput::initTestCase()
      QWARN  : tst_qsgtextinput::cursorRectangle() font "Helvetica,12,-1,5,50,0,0,0,0,0" 
      QWARN  : tst_qsgtextinput::cursorRectangle() width of "Hello" 38 
      FAIL!  : tst_qsgtextinput::cursorRectangle() 'r.right() > textWidth - error' returned FALSE. ()
         Loc: [tst_qsgtextinput.cpp(1839)]
      PASS   : tst_qsgtextinput::cleanupTestCase()
      Totals: 2 passed, 1 failed, 0 skipped
      ********* Finished testing of tst_qsgtextinput *********
      Number of leaked items: 0
      make: *** [check] Error 1
      

      If I restart the X server on the VM with -dpi 90, the test passes.

      Ideally either (1) the test makes some attempt to be agnostic to the DPI setting, (2) the test checks the DPI setting and skips if it doesn't match the required value, (3) the required DPI setting is documented.

      Attachments

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

        Activity

          People

            denexter Andrew den Exter (closed Nokia identity) (Inactive)
            rmcgover Rohan McGovern (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes