From 1c006d147288ac4d2a85bc73a5203bc7829983b3 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Fri, 28 Jul 2017 09:39:25 -0700 Subject: [PATCH] macOS reports and sets screen resolution https://github.com/Beep6581/RawTherapee/issues/3984#issuecomment-318476962 --- rtgui/main.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rtgui/main.cc b/rtgui/main.cc index 099751f06..5a0322973 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -254,6 +254,15 @@ RTWindow *create_rt_window() Gtk::Settings::get_for_screen(screen)->property_gtk_theme_name() = "Adwaita"; Gtk::Settings::get_for_screen(screen)->property_gtk_application_prefer_dark_theme() = true; +#if defined(__APPLE__) + double resolution = screen->get_resolution (); + printf("Screen resolution is %.1f", (float)resolution); + + // This will force screen resolution regarding font, but I don't think it's compliant with Gtk guidelines... + // Do not confuse with screen scaling, where everything is scaled up ! + screen->set_resolution (96.); +#endif + Glib::RefPtr regex = Glib::Regex::create(THEMEREGEXSTR, Glib::RegexCompileFlags::REGEX_CASELESS); Glib::ustring filename = Glib::build_filename(argv0, "themes", options.theme + ".css"); if (!regex->match(options.theme + ".css") || !Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) {