1
0
forked from pool/virtualbox

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
This commit is contained in:
Larry Finger 2016-11-30 19:25:05 +00:00 committed by Git OBS Bridge
parent badf2901f4
commit 10c3b9cf5c
3 changed files with 40 additions and 0 deletions

30
vbox_hidpi_support.patch Normal file
View File

@ -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]);

View File

@ -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

View File

@ -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