Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI freezes because of DPI configuration: "Per-Monitor (v2)" #1262

Closed
fedejeanne opened this issue Jun 5, 2024 · 4 comments
Closed

UI freezes because of DPI configuration: "Per-Monitor (v2)" #1262

fedejeanne opened this issue Jun 5, 2024 · 4 comments
Assignees
Labels
bug Something isn't working HiDPI Issues related to High resolution monitors Windows Happens on Windows OS

Comments

@fedejeanne
Copy link
Contributor

fedejeanne commented Jun 5, 2024

(Moved here as requested in vi-eclipse/Eclipse-Platform#68 (comment))

Setting the DPI configuration to "Per Monitor (v2)" can trigger a UI freeze, as described in this old eclipse issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=571209

Most of the findings have already been discussed with Vector and Yatta colleagues and possible solutions and workarounds have been planned. This issue should work as an umbrella for the future steps.

Goal

Investigate and document:

  • Why does the UI-freeze happen?
  • Is it avoidable? How?
  • Are there any possible workarounds?

Starting point

See Heiko's E-Mail below (in German):

From: Klare, Heiko 
Sent: Friday, April 19, 2024 11:15 AM 
Subject: RE: Langsame IDE-Reaktionen

Hallo zusammen,

hier noch eine weitere Info zu unseren IDE-Performance-Problemen: es gab von einigen Kollegen die 
Meldung, dass es Freezes in der Breakpoints-View gibt.

Da sich der Corretto-JDK-Build ja in Bezug auf DPI-Awareness 
sowieso unkonventionell verhält, habe ich Christian mal geraten einen anderen JDK-Build (z.B. Temurin) 
zu nutzen. Es wäre auch möglich, dass die anderen Freezes, bei denen die VM in OS-Calls hängt (was laut 
Grafana-Logs ja die meisten sind) mit DPI-bezogenen Problemen in Multi-Monitor-Setups zusammen 
und könnten durch einen anderen JDK-Build oder ein modifiziertes Java-Manifest für unsere IDE gelöst 
werden.

Was bei Christian ersten Erkenntnissen nach (auch ohne anderen JDK-Build) funktioniert hat, ist es im „-
vm“-Argument in der .ini nicht  „javaw“ zu nutzen. Also konkret das Ersetzen von
-vm 
D:/Dev/java/corretto-jdk17.0.5.8.1_x86_64/bin/javaw
durch
-vm 
D:/Dev/java/corretto-jdk17.0.5.8.1_x86_64/bin

Das führt nebenbei euch dazu, dass die gemeldeten HiDPi-Probleme in Multi-Monitor-Setups 
verschwinden, sodass wir auf den Workaround mit den Kompatibilitäts-Einstellungen verzichten 
können.

Perspektivisch sollten wir dann aus meiner Sicht wirklich auf einen Temurin-JDK-Build wechseln. Darüber 
könnten wir am kommenden Donnerstag im Dev-Tools-Standup sprechen.

Viele Grüße und ein schönes Wochenende
Heiko
@fedejeanne fedejeanne added bug Something isn't working Windows Happens on Windows OS HiDPI Issues related to High resolution monitors labels Jun 5, 2024
@fedejeanne fedejeanne self-assigned this Jun 5, 2024
@fedejeanne
Copy link
Contributor Author

fedejeanne commented Jun 5, 2024

Here are some of my notes and findings.

The problem

When working with multiple monitors with different DPI configurations, some UI freezes may occur.

The setup

(As explained in comment#23)

  • 2 monitors
  • Monitor on the left is set to zoom = 100%
  • Monitor on the right is set to zoom = 125%

How to reproduce the problem

(As explained in comment#29)

  • Open Eclipse and put it on the left monitor
  • Open the outline view, it should be on the right (close to the other monitor)
  • Hover over the name of a method that is very long --> A "tooltip" (I call it "overlay") with the whole name of the method will appear. If most of that overlay goes to the monitor on the right then the hang occurs.

Why does this happen?

The issue seems to be that a repaint event is "triggering itself again". This is a very short simplification, of course. The whole analysis is in comment#36.

Is this an SWT/Eclipse problem?

I don't think so! I was able to reproduce the problem with the Windows Explorer, which means that this is probably a problem with Windows and it should be reported.

Explorer hangs on mutiple DPI configuration

Workaround

(As explained in comment#44)
Avoid using the DPI configuration Per monitor (v2) and use System instead. This can be achieved by either:

  • Pointing the start parameter -vm to the <JDK_FOLDER>\bin instead of <JDK_FOLDER>\bin\javaw or...
  • Overriding the DPI configuration via the properties of the EXE file (Righ click > Properties > ...) as described in comment#38 and comment#39 or...
  • Providing a Manifest file for the proper javaw.exe and override the property dpiAwareness (and also dpiAware, for older systems) so it uses system instead of PerMonitorV2system. Ours looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
   <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="SWT.javaw" type="win32" />
   <description>Standard Widget Toolkit</description>
   <dependency>
      <dependentAssembly>
         <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" />
      </dependentAssembly>
   </dependency>
   <application xmlns="urn:schemas-microsoft-com:asm.v3">
      <windowsSettings>
         <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
         <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">system</dpiAwareness>
      </windowsSettings>
   </application>
   <!--Specifically targeting your application for Windows 8.1 or Windows 10: https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241(v=vs.85).aspx -->
   <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
        <application>
            <!-- Windows 10 -->
            <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
            <!-- Windows 8.1 -->
            <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
            <!-- Windows Vista -->
            <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
            <!-- Windows 7 -->
            <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
            <!-- Windows 8 -->
            <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
        </application>
    </compatibility>
</assembly>

TO-DO

Useful links

@fedejeanne
Copy link
Contributor Author

fyi @akoch-yatta , @HeikoKlare

@jukzi
Copy link
Contributor

jukzi commented Jun 6, 2024

This a duplicate of #557 ?!

@fedejeanne
Copy link
Contributor Author

This a duplicate of #557 ?!

And here I was, thinking I just had an original thought 😛 . Thank you for pointing it out, @jukzi !

@fedejeanne fedejeanne closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working HiDPI Issues related to High resolution monitors Windows Happens on Windows OS
Projects
None yet
Development

No branches or pull requests

2 participants