From 10c3b9cf5c1685f10b8575c7c777a309fdd0e325bd0b16ccab205a2383f79206 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 30 Nov 2016 19:25:05 +0000 Subject: [PATCH] Accepting request 442920 from home:gladiac:branches:Virtualization Add support for HiDPI in the management frontend This does not fix rendering in guest windows https://doc.qt.io/qt-5/qpainter.html#drawing-high-resolution-versions-of-pixmaps-and-images OBS-URL: https://build.opensuse.org/request/show/442920 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=295 --- vbox_hidpi_support.patch | 30 ++++++++++++++++++++++++++++++ virtualbox.changes | 7 +++++++ virtualbox.spec | 3 +++ 3 files changed, 40 insertions(+) create mode 100644 vbox_hidpi_support.patch diff --git a/vbox_hidpi_support.patch b/vbox_hidpi_support.patch new file mode 100644 index 0000000..a8c350a --- /dev/null +++ b/vbox_hidpi_support.patch @@ -0,0 +1,30 @@ +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]); diff --git a/virtualbox.changes b/virtualbox.changes index 517257b..34a3599 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Nov 30 16:45:43 UTC 2016 - asn@cryptomilk.org + +- Add patch file "vbox_hidpi_support.patch" to add support for HiDPI in the + management frontend. + (This does not fix rendering in guest windows) + ------------------------------------------------------------------- Mon Nov 21 22:43:33 UTC 2016 - Larry.Finger@lwfinger.net diff --git a/virtualbox.spec b/virtualbox.spec index aa0a469..bf56f61 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -90,6 +90,8 @@ Patch112: modify_for_4_8_bo_move.patch Patch113: vbox_remove_smp_mflags.patch # Fix build error on kernel 4.9 Patch114: vbox_fix_4.9_api_changes.patch +# Add support for HiDPI in the management frontend +Patch115: vbox_hidpi_support.patch # BuildRequires: LibVNCServer-devel BuildRequires: SDL-devel @@ -325,6 +327,7 @@ This package contains icons for guest desktop files that were created on the des %patch112 -p1 %patch113 -p1 %patch114 -p1 +%patch115 -p1 #copy user manual cp %{SOURCE1} UserManual.pdf