Menu

#727 résolution écran QHD 3200x1800

Future_Release
closed
None
1
2019-01-11
2015-09-01
dan
No

Sweet Home 3D ne supporte pas les écrans en résolution QHD (3200x1800) comme celui du lenovo Yoga 3 pro.

Discussion

  • Emmanuel Puybaret

    Merci d'essayer les solutions proposées dans le forum.

     
  • Franco Caponi

    Franco Caponi - 2015-10-17

    Dears,
    i have added a vote on this topic since the solution proposed in the topic doesn't cover completely the user interface.

    Basically the main problem is on the toolbar, not usable on any retina display (i have a dell with 15" screen qHD)

    In my opion the solution is quite simple as the dpi od the screen can be easily detected with the following code (successfully tested on a plugin I am developing):

    int pixelPerInch=java.awt.Toolkit.getDefaultToolkit().getScreenResolution(); 
    System.out.println("pixelPerInch = " + pixelPerInch);
    
    
    // 96 is the standard 
    // 216 is a retina display
    if (pixelPerInch <= 96) {
        dpiFactor = 1;  
     } else if (pixelPerInch <= 216) {
         dpiFactor = 2;
     } else {
         dpiFactor = 3;
     }
    
     
  • Franco Caponi

    Franco Caponi - 2015-10-26

    Please have a look at the wrong behavior I'm experiencing on Windows 10

     
  • Franco Caponi

    Franco Caponi - 2015-10-27

    The behavior of windows 10 after my first set of patches (coming soon)

     
  • Franco Caponi

    Franco Caponi - 2015-10-27

    Please find attached the files changed in order to support 4k displays on windows.

     
  • Emmanuel Puybaret

    Thanks for this patch. I would have probably added new utilities methods in SwingTools rather than in OperatingSystem, because of dependencies to AWT. But this gives a good idea of what should be changed if Oracle takes too long to fix this issue.

     
  • Franco Caponi

    Franco Caponi - 2015-11-01

    Thanks for the suggestion. I have to admit that I searched a bit for an utility class more appropriate than OperatingSystem without luck.
    I will refactor the sources soon according to this hint, as soon as I finish other improvements related to UHD.

     
  • Emmanuel Puybaret

    I added to Sweet Home 3D 5.2 the new com.eteks.sweethome3d.resolutionScale System property that will rescale UI. Please read this blog article for more information.
    I used your nice idea also in places like wizards and help, but not for wall pattern to ensure consistency across platforms when printing the plan.

     
  • Franco Caponi

    Franco Caponi - 2016-02-20

    Many thanks for applying the patch. I have downloaded the new version and prepared the ini file. I'll give a try and let you know how it works.

    Best regards

     
  • Franco Caponi

    Franco Caponi - 2016-02-20

    Unfortunately it seem to not use the ini file. Any tip on how to get it applied?

    Attached the content of mine...

    I have tried the web start version, and it works fine, so it seems a problem of the portable one.

     

    Last edit: Franco Caponi 2016-02-20
  • Emmanuel Puybaret

    Thanks for your feedback :-)
    Actually, the rule for .l4j.ini files is to replace the .exe extension of the executable file you run by .l4j.ini. So, for the portable version that should give SweetHome3D-windows-x86.l4j.ini or SweetHome3D-windows-x64.l4j.ini

     
  • Franco Caponi

    Franco Caponi - 2016-02-20

    Ok, with your suggestion the scale factor works!

    There is an unexpected behaviour because it seems that also the fonts are scaled (in the web start version they are correct).
    Have you applied some changes in this area?
    Maybe I have to add also other hints in the ini file? For example:

    -Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel
    -Dswing.plaf.metal.controlFont=Dialog-30
    -Dswing.plaf.metal.userFont=SansSerif-30
    -Dswing.plaf.metal.systemFont=SansSerif-30

     
  • Emmanuel Puybaret

    The fonts are scaled too with updateComponentDefaults method called in SwingViewFactory constructor. One option is enough! ;-)
    Even if actually it might not work with some look and feels, in which case you'll have to force Metal look and feel with the Java option
    -Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel

     

    Last edit: Emmanuel Puybaret 2016-02-20
  • Franco Caponi

    Franco Caponi - 2016-02-20

    But the fonts doesn't need a scaling.... they are already handled properly by the JVM: have you experienced this problem in other operating systems?

    How can be possible that the webstart version works fine and the portable one does not? Are they using different swing themes?

    Anyway the code is really clear, may I ask to add a special value named "AUTO" in order to automatically detect the factor as in the code I provided some time ago?
    Sorry for the boring request, but every change of resolution in my pc needs to logoff and logon again in order to get applied by other java interfaces I use (like projectlibre), so having a way to automatically adapt to the one currently in use is very usefull.

     
  • Emmanuel Puybaret

    I have no computer to test this patch, that's one of the reason why I added a system property and not a behavior that changes the scale like you proposed. If it doesn't work, users will be able to ignore the property or/and change the look and feel properties. There could be also a few people that don't want any rescaling of the user interface.
    Your proposal for a special value name "AUTO" is a nice idea but you'll have to wait for the next version...

     
  • J S

    J S - 2018-06-23

    The suggested workarounds work for me. But I would like to suggest a solution to provide automatic adaptation.

    I have seen very similar problems for JOSM (Java OpenStreetMap editor) on my high-DPI screen. They were solved basically by using Java 9 (or later), which has much better high-DPI support (talking about Windows).

    Unfortunately, I was unable to run SweetHome3D with Java 10, e.g. like this:
    C:\ProgramData\Oracle\Java\javapath\javaw.exe -cp "C:\Program Files\Sweet Home 3D\lib*" com.eteks.sweethome3d.SweetHome3D
    The program starts, but hangs at the splash screen.

    So supporting Java 9 or later might just solve the problem.

    BTW: Thanks for providing such a great tool!

     
  • Emmanuel Puybaret

    I know that Java 9/10 is supposed to fix this issue, but I'm not sure it works for the 3D view yet (see this dicussion in JOGL forum).

    The parameters you used are not enough to run Sweet Home 3D. Please rather try the double clickable JAR executable version. To ensure it uses the right Java version, you can run it with the a command line like this:
    C:\ProgramData\Oracle\Java\javapath\javaw.exe -jar pathto\SweetHome3D-5.7.jar
    As I don't have any Windows HiDPI computer, I would be pleased to read your feedback about running Sweet Home 3D this way.

     
  • J S

    J S - 2018-06-24

    Using the JAR executable version, it works very well with Java 10, the scaling is correct (except that the icons are a bit blurry as they are not high-DPI naturally). The 3D view also works fine, except that it covers only the lower left quarter of the pane, but that could be a very easy fix.

    You don't really need a HiDPI screen to test all this. Just set the Windows scaling factor to 200% and check that everything scales up consistently (and live with the drastically reduced screen space while doing this).

     
  • Emmanuel Puybaret

    Fixed in version 6.0.

     
  • Emmanuel Puybaret

    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB