X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyx_gui_misc.C;h=dc3a66d7334b30c1945f1f96611a078d604cf7b9;hb=3df345c9383480f68fad51feae8b9c64425c8729;hp=beee7bc0f098e6d4cc0436450fb1533723cd6a0b;hpb=0088121bd8c3fc7f2109e8dc9b22b73ca193f20e;p=lyx.git diff --git a/src/lyx_gui_misc.C b/src/lyx_gui_misc.C index beee7bc0f0..dc3a66d733 100644 --- a/src/lyx_gui_misc.C +++ b/src/lyx_gui_misc.C @@ -32,6 +32,7 @@ #include "insets/insetindex.h" #include "LyXView.h" +using std::pair; using std::make_pair; extern BufferView * current_view; @@ -408,3 +409,11 @@ void WarnReadonly(string const & file) _("The document is read-only:"), file); } + +/// Get the dpi setting of the current screen +float getScreenDPI() +{ + Screen * scr = DefaultScreenOfDisplay(fl_get_display()); + return ((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) + + (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2; +}