Eclipse IDE: Rapid on all monitor with Hidpi presentation

0
6
Eclipse IDE: Rapid on all monitor with Hidpi presentation


If you work on a high-resolution monitor or with a multi-monitor set-up, you have a problem in the eclipse IDE: If you move the window between the monitor with different DPI settings, the user interface does not score dynamically. A staining UI not only affects optics, but also the developer productivity.




Amtya (Marti) is a software engineer in Parijat Yata. He did his Master of Science (M.Sc.) in Computer Science at Rhineland-Palletten University of Caesarslontorn-Gland and has been with Yatta since 2023. Frankfurt and Casel -based company revolves around development and development: software and companies, from themselves and society.

Scam | Lap method to take calls from unknown numbers without the risk of scamScam | Lap method to take calls from unknown numbers without the risk of scam



With Hidpi correction (right), the presentation (left) (Fig. 1) is quite sharp.

(Image: Screenshot (Amtya Parajat))

The eclipse uses SWT (standard widget toolkit) as a UI framework that uses the original widget of the concerned operating system. Under Windows, SWT Java-UI components were translated into indigenous Windows components. It usually leads to better performance and a platform -sipahi look and feel. However, SWT only records DPI information when the application is initiated and accordingly sets all widgets. If the DPI settings change, change the monitor or takes a window to another monitor, the eclipse is not automatically adapted. Therefore, widgets appear either pixelated or oversize.

For example, if someone postponed a button, which was originally shown on the monitor with 100 % zoom on the monitor with 200 % zoom, the button retains its original shape and thus appears blurred or discrepancy.

To overcome this discrepancy, we launched a project for Hidpi scaling for eclipse under Windows.

A look at the structure of SWT shows how complicated the challenge of dynamic scaling is. The tool kit consists of three implementation, one for Windows, Unix and McOS, as well as a common code for some areas. Implementation shares a public API that ensures that components work equally in all three platforms. SWT applications are based on three main components:

  1. Widget-All UI elements base class.
  2. Control – A subclass of widgets, for example for button or text field.
  3. Resources – graphics and fonts for application.

If an application in SWT makes a button, it applies it through the OS-level binding as the native Windows button, but it does not register the latter DPI changes. Since the implementation of SWT varies on the basis of platform, the question arises as to how to enable DPI change in Windows-specific components without spoiling the underlying platform behavior. It should also be possible to update the platform -independent code in future without changing its implementation.

We started researching ideas in the community. Somebody already had a suitable bridge request in the eclipse, which provided the first approach to DPI changes under Windows, which, however, was not enough, especially with multiple-negative scenarios. So we started with evidence of concept (POC) and divided the problem into the following areas:

  1. Provide DPI reference to Windows components: SWT component should be able to record DPI settings on the word word.
  2. Ensure cross-platform stability: When adjusting the DPI under Windows, there was no negative effect on other operating systems.
  3. Dynamic scaling for multiple monitors: The components should behave properly if they are transported between the monitor with various DPI values.

The objective was to continuously pass on changes in application with other DPI values ​​along with other DPI values. While implementing this, we were the following as follows:

First, the implementation captures DPI changes at the shell level. Represents the square in SWT Shell The main window of an application. She registers Windows event DPI_CHANGEDIf, for example, the window is transported between the monitor. If this phenomenon occurs, SWT provides the right zoom level to all child elements.

Then the implementation will have to pass on DPI changes in all widows. as soon as the Shell New DPI settings are obtained, it triggers a new calibration of all subordinate widgets. Since SWT widgets are organized by hierarchy, it was to be ensured that the DPI converts into a top-down order Shell Every child’s widget should be passed. We integrated the DPI handler in the concerned Win32 categories. A new API probably harassed the cross -platform design. Instead, we used stable private methods to control the changes in DPI internally. So we were able to score dynamic wigates dynamically without changing public APIs or producing regression on other platforms.

A special glued points were resource -like resources. The same image can be displayed on the monitor with separate DPI settings. Therefore, it was necessary to make several handles for each resource – in each suitable size. For example, 16 pX in 100 % zoom, 24 pX at 150 % and 32 px on 200 % zoom. We led methods in Resource-Classes that manage handles for zoom levels. This process allows the system to present resources on various monitor in optimal quality.

Microsoft: New Visual Studio Hub Bundle Information about IDEMicrosoft: New Visual Studio Hub Bundle Information about IDE

LEAVE A REPLY

Please enter your comment!
Please enter your name here