virtualbox/vbox_hidpi_support.patch

31 lines
1.2 KiB
Diff

Index: VirtualBox-5.1.10/src/VBox/Frontends/VirtualBox/src/main.cpp
===================================================================
--- VirtualBox-5.1.10.orig/src/VBox/Frontends/VirtualBox/src/main.cpp 2016-11-21 18:31:06.000000000 +0100
+++ VirtualBox-5.1.10/src/VBox/Frontends/VirtualBox/src/main.cpp 2016-11-30 14:04:31.028269344 +0100
@@ -446,6 +446,12 @@ extern "C" DECLEXPORT(int) TrustedMain(i
qInstallMsgHandler(QtMessageOutput);
#endif /* QT_VERSION < 0x050000 */
+#if QT_VERSION >= 0x050600
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+#endif
+#if QT_VERSION >= 0x050700
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+#endif
/* Create application: */
QApplication a(argc, argv);
@@ -603,6 +609,12 @@ int main(int argc, char **argv, char **e
/* Initialization failed: */
if (RT_FAILURE(rc))
{
+#if QT_VERSION >= 0x050600
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+#endif
+#if QT_VERSION >= 0x050700
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+#endif
/* We have to create QApplication anyway
* just to show the only one error-message: */
QApplication a(argc, &argv[0]);