Skip to content

Commit

Permalink
Fix dpi scaling issues (#1424)
Browse files Browse the repository at this point in the history
  • Loading branch information
rumtid authored Sep 27, 2022
1 parent c8a33cc commit 16bde19
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/filebrowser/file-browser-dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,20 @@ const int kSearchBarWidth = 250;

void openFile(const QString& path)
{
#if defined(Q_OS_WIN32)
// The QT_SCREEN_SCALE_FACTORS environment variable will be passed to the
// application invoked from here, which may cause scaling problems.
// So we temporary reset that and restore back.
const char *factors = g_getenv("QT_SCREEN_SCALE_FACTORS");
g_setenv("QT_SCREEN_SCALE_FACTORS", "1", 1);
#endif

::openInNativeExtension(path) || ::showInGraphicalShell(path);

#if defined(Q_OS_WIN32)
g_setenv("QT_SCREEN_SCALE_FACTORS", factors, 1);
#endif

#ifdef Q_OS_MAC
MacImageFilesWorkAround::instance()->fileOpened(path);
#endif
Expand Down

0 comments on commit 16bde19

Please sign in to comment.