lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] GetContentScaleFactor() always "1"?


From: Greg Chicares
Subject: [lmi] GetContentScaleFactor() always "1"?
Date: Wed, 14 Sep 2022 15:33:42 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0

Picking up where I left off before vacation, I remember that running the
automated GUI test under xvfb works with 96 = DPI, but fails with 192 = DPI.
I thought it would be nice to detect that and print a warning if 96 != DPI.
However, this one-line experimental change (I got the idea from
  https://groups.google.com/g/wx-users/c/GE8snC1zwPc
):

--8<----8<----8<----8<----8<----8<----8<----8<--
diff --git a/main_wx_test.cpp b/main_wx_test.cpp
index af62ad7d2..512b136fa 100644
--- a/main_wx_test.cpp
+++ b/main_wx_test.cpp
@@ -818,6 +818,8 @@ void SkeletonTest::RunTheTests()
         return;
         }
 
+    std::cout << "scale " << MainWin->GetContentScaleFactor() << std::endl;
+
     // Close any initially opened dialogs (e.g. "About" dialog shown unless a
     // special command line option is specified).
     for(;;)
--8<----8<----8<----8<----8<----8<----8<----8<--

prints "scale 1" and succeeds with DPI =  96, yet
prints "scale 1" and  fails   with DPI = 192, under xvfb.
Running it directly without xvfb, both DPI values still
print "scale 1".

What am I missing? Should I be doing what's described here:
  https://groups.google.com/g/wx-users/c/GE8snC1zwPc/m/xUoIlw6iAAAJ
i.e.,
  SetProcessDPIAwareFunc pFunc = 
(SetProcessDPIAwareFunc)GetProcAddress(m_user32Dll, "SetProcessDPIAware");
with all the {Load,Free}Library() rigmarole that entails?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]