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

Ticket #33: Provide HiDPI Support for Multi-Monitor Environments for custom controls #15

Closed
wants to merge 27 commits into from

Conversation

ShahzaibIbrahim
Copy link
Collaborator

Adding editable option in an example for testing the multi-monitor support for these components:

  • Tree Tab
  • Table Tab

vi-eclipse/Eclipse-Platform#33

Copy link

github-actions bot commented May 2, 2024

Test Results

   470 files  +20     470 suites  +20   8m 5s ⏱️ -30s
 4 135 tests + 8   4 127 ✅ + 8   8 💤 ±0  0 ❌ ±0 
16 336 runs  +17  16 244 ✅ +17  92 💤 ±0  0 ❌ ±0 

Results for commit ad2de40. ± Comparison against base commit 9505103.

♻️ This comment has been updated with latest results.

ShahzaibIbrahim and others added 9 commits June 18, 2024 11:05
Writing GetSystemMetrics method in Widget class so that the child
controls can use it to get System Metrics to be DPI dependent

Contributes to:
eclipse-platform#62 &
eclipse-platform#127
This commit contributes to multi zoom level support of pattern using a map of zoom levels with relevant patterns.

Contributes to eclipse-platform#62 and eclipse-platform#131
This commit fixes an issue when creating a GC from an Image using a device bound to another thread as the GC is currently created in.

Fixes eclipse-platform#1288
This commit implements the mean to provide different handles of a transform object at different zoom levels which can be consumed by GC depending on the zoom level available within its GCData.

Contributes to eclipse-platform#62 and eclipse-platform#127
This commit contributes to the obtaining the path as per the zoom level
of the monitor. A method win32_getPAth is used in place wherever
path.handle was used earlier by the clients. The preferred zoom level
has to be passed by the clients as a parameter to the mthod in order to
get the handle for the scaled path.

contributes to eclipse-platform#62 and eclipse-platform#127
In this contribution the DPIUtil dependency from org.eclipse.swt.widgets.Event is removed including all package protected pixel consuming or returning methods. As (at least) Windows receivces HiDPI support for multiple zoom levels, this is a prerequisite to contribute this feature. As a consequence all callers inside SWT that still used the pixel dependent methods are adapt to only use the public API.

Contributes to eclipse-platform#62 and eclipse-platform#131
Without explicit configuration the JVM uses 25% of the available RAM as
maximum heap-size. With the 4GiB of RAM available on the current Jenkins
executors, just removing any explicit heap-size limits is equivalent to
passing '-Xmx1G' as 'MAVEN_OPTS'.
laeubi and others added 14 commits June 23, 2024 19:22
While the methods to perform an operation with busy indication are
already a great help to write responsive UI there is one case missing
where a (Completable)Future is already present, this can for example be
used to cache some heavy work.

This now adds a new BusyIndicator.showWhile(Future) method that covers
the use case of an externally provided future computation so the caller
can be sure that while it takes place the UI shows an indicator.

Beside that the Snippet30 was enhanced to demonstrate the new function.
Apply language suggestions from code review

Co-authored-by: Ed Merks <Ed.Merks@gmail.com>
Co-authored-by: Sebastian Zarnekow <Sebastian.Zarnekow@gmail.com>
This was forgotten in
eclipse-platform#1266

Also require the bumped minor version of the o.e.swt host in the
fragments.
…e-platform#1298

This migrates the unit tests placed in the SWT win32 production
fragments to JUnit 5. The visibility of the test classes is reduced to
`packaged protected` as allowed by JUnit 5.

Fixes eclipse-platform#1298
This commit fixes the image scaling bug in GC data. The image was scaled
with the native zoom of the GC Data instead of the zoom. This leads to
the the problem of no image drawn but just a white background. The image
is only visible when the zoom and nativeZoom are the same. This behavior
can be seen if the IDE is started at i.e. 125% zoom level on the default
monitor. Hence, in this case the zoom is set to 100 and nativeZoom is
125. And due to wrong scaling, the lineNumberRulerColumn and minimize
and maximize button images are not visible but rather just a white
background is visible. This fix provides the right scaling to the
image in the GC Data using the zoom but not the nativeZoom level
as per the standard.

Contributes to eclipse-platform#62 and eclipse-platform#127
This commit removes the constructor and the following method win32_new and
hereby confirms that none of the clients consume them.

contributes to eclipse-platform#62 and eclipse-platform#127
The swt.autoScale.updateOnRuntime has currently only effect in the win32 implementation. Therefor parsing of the flag will only be done on win32.

Contributes to eclipse-platform#62 and eclipse-platform#127
Adds final modifier and private constructor to the utility class.
This commit applies dpi changes to all menus in this menus attribute in Decorations as well in windows, so pop-up menus are no longer opened on the wrong location in multi zoom scenarios.

Contributes to eclipse-platform#62 and eclipse-platform#131
This commit scales the caret on a DPI change event on styled text. It
uses the line height of the styled text to set on caret. The
height and width field in the caret are storing data in points now and
not in pixels. We do so to avail the scaling refernece. Also we use
SWT.DEFAULT to ignore setting of width. It is useful when we set the new
height on DPI change since the preferred width of the caret is loadeed
from preferences on the Caret creation.

Contributes to eclipse-platform#62 and eclipse-platform#127
Registering the comboDpiChange handler and applying change manually to
text, image and arrow and popup
As one constructor of Tracker is not calling the super constructor the nativeZoom attribute must be set here as well. As it only has the display as reference, the zoom of the display (currently equal to primary monitor zoom) will be used.

Contributes to eclipse-platform#62 and eclipse-platform#131
It closes with the "esc" key, as many other snippets do
@ShahzaibIbrahim ShahzaibIbrahim force-pushed the akoch-master-33 branch 2 times, most recently from aac6dbb to 3b53dfd Compare July 3, 2024 08:37
ShahzaibIbrahim and others added 3 commits July 3, 2024 12:57
Extract private method to do the refresh and call it from the DPI change handler
This commit provides the ability to scaling the special icons of Text in
win 32, i.e., Search and Cancel icon. The scaled icon is obtained at the
draw time in the method Text.WM_DRAWITEM. We get rid of the fields
hIconSearch and hIconCancel and we maintain a hashmap of size to icon
for both the icons.

contributes to eclipse-platform#62 and eclipse-platform#127
This commit adds the feature of scaling region based on the zoom level of the monitor it is drawn on. The mentioned functionality is attained by using a map to maintain the handle of the region scale as per zoom level. The handle can then be obtained by the method win32_getHandle by passing the zoom information from the client.
The region object stores a history of all the operations performed on it
so that it can be used to create handles for different zoom level.
Additionally, this commit removes the public handle field from Region for win32 since
it is now replaced by win32_getHandle method for the clients and
internally the class uses a hashMap zoomToHandle to get the handle for
the particular zoomlevel. The default handle is stored in zoomToHandle
mapped to the initialZoom.

contributes eclipse-platform#62 and eclipse-platform#127
This commit is part of testing the custom controls for multi-monitor support.
@ShahzaibIbrahim ShahzaibIbrahim deleted the akoch-master-33 branch July 10, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants