qt: Set AA_EnableHighDpiScaling attribute early #16254

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:20190620-EnableHighDpiScaling-warning changing 1 files +3 −2
  1. hebasto commented at 5:51 pm on June 20, 2019: member

    Running bitcoin-qt compiled against Qt 5.12.4 causes a warning:

    0hebasto@bionic-qt:~/bitcoin$ src/qt/bitcoin-qt 
    1Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.
    

    This PR fixes this issue.

    From Qt docs:

    Enables high-DPI scaling in Qt on supported platforms (see also High DPI Displays). Supported platforms are X11, Windows and Android. Enabling makes Qt scale the main (device independent) coordinate system according to display scale factors provided by the operating system. This corresponds to setting the QT_AUTO_SCREEN​_SCALE_FACTOR environment variable to 1. This attribute must be set before QGuiApplication is constructed. This value was added in Qt 5.6.

  2. Set AA_EnableHighDpiScaling attribute early
    Qt docs: This attribute must be set before QGuiApplication is 
    constructed.
    099e4b9ad3
  3. in src/qt/bitcoin.cpp:443 in 7b73b78f7f outdated
    435@@ -436,12 +436,13 @@ int GuiMain(int argc, char* argv[])
    436     Q_INIT_RESOURCE(bitcoin);
    437     Q_INIT_RESOURCE(bitcoin_locale);
    438 
    439+#if QT_VERSION >= 0x050600
    440+    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    441+#endif
    442+
    443     BitcoinApplication app(*node, argc, argv);
    


    MarcoFalke commented at 6:01 pm on June 20, 2019:
    I’d rather move this after all setAttribute. This shouldn’t cause any issues, right?
  4. DrahtBot added the label GUI on Jun 20, 2019
  5. hebasto force-pushed on Jun 20, 2019
  6. hebasto commented at 6:27 pm on June 20, 2019: member

    @MarcoFalke

    I’d rather move this after all setAttribute. This shouldn’t cause any issues, right?

    Done.

  7. MarcoFalke commented at 6:50 pm on June 20, 2019: member

    Thanks for fixing this.

    ACK 099e4b9ad3d9967051d5c3d45c6315d1b30fea05

    Before (see the broken icons in the lower right): Screenshot from 2019-06-20 14-47-43

    After: Screenshot from 2019-06-20 14-46-30

  8. MarcoFalke commented at 6:50 pm on June 20, 2019: member
    Is this for backport? @jonasschnelli
  9. jonasschnelli commented at 7:02 pm on June 20, 2019: contributor

    Nice! Finally someone figured this out and made it happen.

    utACK 099e4b9ad3d9967051d5c3d45c6315d1b30fea05 Will test on Win/linux soon.

    It’s def. a backport.

  10. laanwj added the label Needs backport on Jun 20, 2019
  11. laanwj added this to the milestone 0.18.1 on Jun 20, 2019
  12. MarcoFalke added the label Needs gitian build on Jun 20, 2019
  13. promag commented at 10:34 pm on June 20, 2019: member

    Before (see the broken icons in the lower left): @MarcoFalke you mean on the lower right? @hebasto can you run QT_FATAL_WARNINGS=1 src/qt/bitcoin-qt without this change?

  14. hebasto commented at 4:02 am on June 21, 2019: member

    @promag

    can you run QT_FATAL_WARNINGS=1 src/qt/bitcoin-qt without this change?

    0hebasto@bionic-qt:~/bitcoin$ QT_FATAL_WARNINGS=1 src/qt/bitcoin-qt 
    1Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.
    2Aborted (core dumped)
    
  15. DrahtBot commented at 5:53 am on June 21, 2019: member

    Gitian builds for commit 9c95515ba034b50bd86b663914ff7598820f28e9 (master):

    Gitian builds for commit 4460284f4ddbdb8f34e164d8a67b36a0eafe8e9f (master and this pull):

  16. DrahtBot removed the label Needs gitian build on Jun 21, 2019
  17. promag commented at 7:10 am on June 21, 2019: member
    @hebasto thank you. I think reviewers should set QT_FATAL_WARNINGS=1 on their systems, can prevent incomplete changes like #16118.
  18. fanquake approved
  19. fanquake commented at 1:22 pm on June 23, 2019: member

    ACK 099e4b9ad3d9967051d5c3d45c6315d1b30fea05. Did some testing on Bionic and Windows 10 (using VirtualBox). I couldn’t see any obvious visual difference, but given Marco’s screens above, this change is obviously better. I also checked that there wasn’t any sort of regression on macOS.

    master on Bionic using Qt 5.12.4: master_ubuntu_bionic_qt_12_4

    This PR on Bionic using Qt 5.12.4: 16254_ubuntu_bionic_qt_12_4

    master on Windows 10 using depends: master_windows_depends

    This PR on Windows 10 using depends: 16254_windows_depends

    This PR on macOS 10.14.5 using Qt 5.12.3: 16254_macos_qt_5_12_3

    Confirmed that the below warning is no longer shown when running on Bionic:

    0Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created.
    
  20. MarcoFalke added the label Needs gitian build on Jun 23, 2019
  21. fanquake referenced this in commit c8fee6769a on Jun 24, 2019
  22. jonasschnelli commented at 12:40 pm on June 24, 2019: contributor

    Tested on Win10… much much better HiDPI experience.

    Master:

    This PR:

  23. MarcoFalke removed the label Needs gitian build on Jun 24, 2019
  24. MarcoFalke referenced this in commit 44e849c35a on Jun 24, 2019
  25. MarcoFalke merged this on Jun 24, 2019
  26. MarcoFalke closed this on Jun 24, 2019

  27. MarcoFalke referenced this in commit 715da91e91 on Jun 24, 2019
  28. hebasto deleted the branch on Jun 24, 2019
  29. jonasschnelli commented at 1:47 pm on June 24, 2019: contributor

    Though it seems not to resolve the HiDPI issues on Ubuntu Gnome:

  30. MarcoFalke commented at 1:51 pm on June 24, 2019: member
    Hmm, that’s odd. I was testing on fedora 30 gnome and the issue was fixed there.
  31. DrahtBot commented at 2:22 pm on June 24, 2019: member

    Gitian builds for commit 2cbcc55ba6aea26d64eae3981b83dac04f70240f (master):

    Gitian builds for commit 6969aa8f11289066702e4bcc2a745286b6c46cae (master and this pull):

  32. jonasschnelli commented at 2:36 pm on June 24, 2019: contributor
    It’s glitchy… sometimes it works. Especially if I pass in --resetguisettings. Haven’t figured out why exactly.
  33. fanquake removed the label Needs backport on Jun 26, 2019
  34. fanquake commented at 4:04 am on June 26, 2019: member
    Being backported in 16035.
  35. HashUnlimited referenced this in commit 07f14966bb on Aug 23, 2019
  36. Bushstar referenced this in commit cad6f0f7c3 on Aug 24, 2019
  37. Bushstar referenced this in commit 14327fa060 on Aug 24, 2019
  38. Bushstar referenced this in commit b3cc3c9089 on Aug 24, 2019
  39. Bushstar referenced this in commit fdb340a19d on Aug 24, 2019
  40. codablock referenced this in commit d9741fc632 on Nov 22, 2019
  41. UdjinM6 referenced this in commit ef55e48c1e on Nov 22, 2019
  42. barrystyle referenced this in commit f288644a21 on Jan 22, 2020
  43. deadalnix referenced this in commit eb3223a6e3 on Apr 16, 2020
  44. FornaxA referenced this in commit 5ffbf6d4ce on Jul 6, 2020
  45. ckti referenced this in commit 0530b20de7 on Mar 29, 2021
  46. Munkybooty referenced this in commit 370ec45a1f on Oct 30, 2021
  47. Munkybooty referenced this in commit 70e305e810 on Oct 30, 2021
  48. Munkybooty referenced this in commit 26401de456 on Nov 2, 2021
  49. Munkybooty referenced this in commit a3e4529a10 on Nov 2, 2021
  50. Munkybooty referenced this in commit a7f877741a on Nov 4, 2021
  51. Munkybooty referenced this in commit 8dd46b2e14 on Nov 16, 2021
  52. Munkybooty referenced this in commit b2f9eef0d5 on Nov 18, 2021
  53. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me