From 51ec239770e70b23e542ce26615d59621bab5ff4 Mon Sep 17 00:00:00 2001 From: wangqr Date: Fri, 17 May 2019 03:01:31 -0400 Subject: [PATCH] Get DPI info from GTK --- src/utils.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/utils.cpp b/src/utils.cpp index 2416aa7a2..e96c3ed34 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -214,9 +214,15 @@ void AddFullScreenButton(wxWindow *) { } void SetFloatOnParent(wxWindow *) { } // OS X implementation in retina_helper.mm -RetinaHelper::RetinaHelper(wxWindow *) { } +RetinaHelper::RetinaHelper(wxWindow* w) { window = w; } RetinaHelper::~RetinaHelper() { } -int RetinaHelper::GetScaleFactor() const { return 1; } +int RetinaHelper::GetScaleFactor() const { +#ifdef __WXGTK__ + return int(window->GetContentScaleFactor()); +#else + return 1; +#endif +} // OS X implementation in scintilla_ime.mm namespace osx { namespace ime {