Bug 524919 - Qt build of Firefox or Fennec does not respect my screen's DPI. r=mark.finkle, sr=pavlov

This commit is contained in:
James Cook 2010-03-10 16:36:47 +02:00
parent ed18d75aab
commit 1342a5a01f
2 changed files with 11 additions and 1 deletions

View File

@ -135,6 +135,7 @@ public:
protected:
static gfxFontconfigUtils *sFontconfigUtils;
void InitDisplayCaps();
private:
virtual qcms_profile *GetPlatformCMSOutputProfile();

View File

@ -39,7 +39,7 @@
#include <QPixmap>
#include <QX11Info>
#include <QApplication>
#include <QWidget>
#include <QDesktopWidget>
#include "gfxQtPlatform.h"
@ -583,3 +583,12 @@ gfxQtPlatform::SetPrefFontEntries(const nsCString& aKey, nsTArray<nsRefPtr<gfxFo
}
#endif
void
gfxQtPlatform::InitDisplayCaps()
{
QDesktopWidget* rootWindow = qApp->desktop();
sDPI = rootWindow->logicalDpiY(); // y-axis DPI for fonts
if (sDPI <= 0)
sDPI = 96; // something more sensible
}