Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 djview4 (4.10.6-1) unstable; urgency=medium
 .
   [ Leon Bottou ]
   * high dpi display support
 .
   [ Barak A. Pearlmutter ]
   * new upstream version
   * trivial debian/control updates
   * enable hardening in debian/rules
Author: Barak A. Pearlmutter <bap@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- djview4-4.10.6.orig/nsdejavu/nsdejavu.1.in
+++ djview4-4.10.6/nsdejavu/nsdejavu.1.in
@@ -213,7 +213,7 @@ tag:
 .SH INTERFACING THE DJVIEW PLUGIN WITH JAVASCRIPT
 Recent versions of the 
 .B djview4
-plugin can be controlled from the JavaScript intepreter of 
+plugin can be controlled from the JavaScript interpreter of 
 browsers implementing the Mozilla NPRuntime API.
 To access the plugin object,
 include the attribute
--- djview4-4.10.6.orig/src/djview.cpp
+++ djview4-4.10.6/src/djview.cpp
@@ -137,7 +137,12 @@ QDjViewApplication::QDjViewApplication(i
   extern void qt_mac_set_native_menubar(bool);
   qt_mac_set_native_menubar(false);
 #endif
-
+  
+  // Enable highdpi pixmaps
+#if QT_VERSION >= 0x50200
+  setAttribute(Qt::AA_UseHighDpiPixmaps, true);
+#endif
+  
   // Wire session management signals
   connect(this, SIGNAL(saveStateRequest(QSessionManager&)),
           this, SLOT(saveSessionState(QSessionManager&)) );
--- djview4-4.10.6.orig/src/qdjviewsidebar.cpp
+++ djview4-4.10.6/src/qdjviewsidebar.cpp
@@ -603,9 +603,14 @@ QDjViewThumbnails::Model::makeIcon(int p
   if (doc)
     {
       // render thumbnail
-      int w = size;
-      int h = size;
-      QImage img(size, size, QImage::Format_RGB32);
+#if QT_VERSION >= 0x50200
+      int dpr = djview->devicePixelRatio();
+#else
+      int dpr = 1;
+#endif
+      int w = size * dpr;
+      int h = size * dpr;
+      QImage img(size*dpr, size*dpr, QImage::Format_RGB32);
       int status = ddjvu_thumbnail_status(*doc, pageno, 0);
       if (status == DDJVU_JOB_NOTSTARTED)
         {
@@ -614,9 +619,9 @@ QDjViewThumbnails::Model::makeIcon(int p
       else if (ddjvu_thumbnail_render(*doc, pageno, &w, &h, format, 
                                       img.bytesPerLine(), (char*)img.bits() ))
         {
-          QPixmap pixmap(size,size);
+          QPixmap pixmap(size*dpr,size*dpr);
           pixmap.fill();
-          QPoint dst((size-w)/2, (size-h)/2);
+          QPoint dst((size*dpr-w)/2, (size*dpr-h)/2);
           QRect src(0,0,w,h);
           QPainter painter;
           painter.begin(&pixmap);
@@ -625,6 +630,9 @@ QDjViewThumbnails::Model::makeIcon(int p
           painter.setPen(Qt::darkGray);
           painter.drawRect(dst.x(), dst.y(), w-1, h-1);
           painter.end();
+#if QT_VERSION >= 0x50200
+          pixmap.setDevicePixelRatio(dpr);
+#endif
           return QIcon(pixmap);
         }
     }
