forked from eclipse-platform/eclipse.platform.swt
-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/update master #5
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update API filters to new version
GTK 4 port crashes on start up if worspace chooser has to be shown as AccessibleObject is totally disfunctional on GTK 4.x version but later on it tries to send events. Disable it for now.
This fixes wrong formatting introduced to the Win32 display class in eclipse-platform#1722
This commit adresses render artifacts visible when drawing on a GC with monitor-specific scaling enabled e.g. on 175%. Reason is that scaling up all attributes of bounds separately can lead to rounding errors e.g. between y and height (one being scaled up, the other one not). Scaling them together as a rectangle solves this limitation.
This commit replaces Image::getBoundsInPixels calls with Image::getBounds since it is deprecated for win32. For all those consumers who can't access the getBounds(int zoom) method, a simple DPIUtil::scaleUp call is used in combination with the public API Image::getBounds. contributes to eclipse-platform#62 and eclipse-platform#127
This commit adapts a limitation of handling fonts in the win32 implementation. When a font is initialized with FontData the height in points of it and the desired target zoom will be used to calculate the font height in pixels. When the FontData of an existing font is retrieved the Logfont data from the OS together with the font zoom are used to recalculate the original font height. As the conversion to pixels involved rounding, the reversed calculation will result in a different value than was used on creation time. With monitor-specific scaling a font for a different zoom will be calculated on the basis of the FontData of an existing base font. This can lead to font heights in pixels that differ from the "correct" value. To solve this limitation each font stores its original font height in points to recreate the it when Font::getFontData is called.
This commit refactors ScalingSWTFontRegistry to simplify creation and caching of scaled variants of custom and system fonts. This is possible because the conversion of SWT font height in points to the OS font height in pixels no longer relies on the primary monitor zoom, but can directly calculated based on the target zoom a font will be used on now.
This commit refactors Transform in the win32 implementation to better support multiple handles for different zoom settings of a Transform when monitor-specific scaling is enabled. The previous implementation only applied adaptions to the initial handle of the transform and relied on the transform not to be changed afterwards. This doesn't cover all scenarios and can lead to unexpected behavior when re-using Transform objects over different zoom settings.
Checks existing behavior
Windows only: use the original width and height of the images set to the shell when searching for the best fit instead of adapting them to the zoom, otherwise the smallest image will always be picked and it will result in a blurry shell icon when scaling up for monitors with a higher zoom levels. contributes to eclipse-platform#62 and eclipse-platform#127
Extract existing differences in the ImageLoader implementation for Linux/GTK into an InternalImageFileLoader class that also exists for Windows and MacOS but just delegates to FileFormat.
This commit adapts Transform in the win32 implementation to create handles only on demand. If a non-handle specific operation like isIdentity() is called, a temporary handle will be created and disposed afterwards if no handle exists already.
This commit adapt the obsolete equals and hashCode methods for Region to use the super implementation instead. For the upcoming changes for win32 the current implementation cannot be used anymore because all handles will be created on demand. As the current implementation is equal in their behavior to the base behavior for these methods is inherited from Object.
This commit refactors Path in the win32 implementation to better support multiple handles for different zoom settings of a Path when monitor-specific scaling is enabled. The previous implementation only applied adaptions to the initial handle of the path and relied on the path not to be changed afterwards. This doesn't cover all scenarios and can lead to unexpected behavior when re-using Path objects over different zoom settings.
When running with a device zoom of 200, the bounds of images created with an ImageGcDrawer have double the expected size. The reason is that the image is initialized with image data at zoom 200, from which also the width and height are retrieved. The used initialization logic does, however, always expect image data at zoom 100 to be passed. This change fixes the initialization of images based on ImageGcDrawer to create both the 100 and 200 image data version and correctly initialize the image metadata with the former. The according test case is extended to validate the bounds in pixels of images not only against the bounds if the image but also against the expected/initial bounds.
In some image constructors, image data are currently auto-scaled. This works by accident, as the device zoom used for auto scaling conforms to the zoom of the image to be initialized. However, to make this explicit, with this change the proper zoom is passed to scale method. It also makes the autoScaleUp method in DPIUtil obsolete and removes it. Co-authored-by: Hannes Wellmann <[email protected]>
Method getCaretPosition is implemented with Gtk 4. The other method getCaredLocation is simply bypassed on Gtk 4 with TODO to prevent the crash for now.
This commit refactors Region in the win32 implementation to better support multiple handles for different zoom settings by creating all handles only on demand.
This commit adds the OS call for GetDpiForWindow.
This commit contributes to better scaling of Images obtained from Display::getSystemImage using better windows API LoadIconWithScaleDown for scaling. The new API also changes the old system icons to the new Windows System Icons. Contributes to eclipse-platform#62 and eclipse-platform#127
Images based on ImageFileNameProvider and ImageDataProvider are initialized with data based on the default zoom and can later on be reinitialized with data for others zooms when `getImageData()` is called. At both places, the same functionality is implemented twice. This change makes the initial creation of image data use the already existing implementation for reinitializing it for another zoom. It also unifies the previous two implementations and removes obsolete calls to init() which are just required once for starting resource tracking.
Deprecate Image constructor that accepts Rectangle in favor of Image(display, width, height).
This commit reduces the calls to Image#win32_getHandle(int) in GC. When drawing an image with a GC multiple draw... methods are calling each other for that operation. All those methods are refetching the handle via Image#win32_getHandle(int) with getZoom(). To support use cases where a method uses a different zoom to get a handle to draw the handle is now fetched in the top most methods and are passed to the other methods directly.
These only look awkward in failures. This is also prep step for whenever suite is to be migrated to JUnit 5.
…ipse-platform#228 Add helper methods that redirect to GTK/GTK3 in Widget for convenience. Contributes to eclipse-platform#228
Preserve the handles of images created out of existing image handles and also from those which are still needed (according to the method AbstractImageProviderWrapper::getPreservedZoomLevels) Fixes eclipse-platform#2139
This adds Snippet384 to inspect the behavior of different different algorithms for the transformations of images to be used as disabled versions.
…form#2000 When using WebView2 as browser engine in SWT without a WebView2 runtime being available on the system, browser initialization fails. In order to more gracefully handle the case that a system has no such runtime installed (like on some Windows 10 systems), this change introduces an automatic fallback option to Internet Explorer in case no WebView2 runtime is found. It shows a dialog informing about the missing runtime, the option to fallback to IE and also allows to open further information provided via the FAQ. Fixes eclipse-platform#2000
With this change, warnings will be logged when strict checks are enabled and a GC is initialized for an image in unsupported cases: 1. images whose scaled variants are not derived via scaling from an original version but are retrieved from a central data source (like ImageDataProvider or ImageFileNameProvider) 2. images for which handles in other zoom values have already been created such that drawing on them will only be applied to one of those handles
This commit adapts the drawImage method in GC in the windows implementation for copying and (probably) scaling an area from a source image into the GC target. With the Image supporting multiple handles now, the handle from the source image is no longer chosen by the zoom context of the GC but from the target size, e.g. if an image should be drawn with a scale of 2 on a 100% monitor, it might provide better results to use an image handle fitting for 200%.
Use Path.equals() instead of URI.equals() to compare the URI paths. This will will handle upper/lower-case differences correctly which can arise, e.g. when symlinks are involved. Fixes eclipse-platform#2061.
It shouldn't call GTK 3 function (causes a crash right now) and same approach as cut/copy is used.
This commit introduces the data attribute AUTOSCALE_DISABLED for the windows implementation for Widget. This will disable autoscaling for this Widget and all of its children. This is a necessary requirement for some complex usages utilizing GC. Without disabling autoscaling rendering artifacts will be introduced when only parts of the GC are redrawn. This commit serves as starting point to harden this feature before considering extracting an API out of it.
Fetch GdkDisplay from GdkSurface as done on Wayland
There is one extra change about unused lambda warnings which was autoadded by JDT that's why I keep it in.
This commit contributes to handling wmNotify event for tooltip of a Tree regardless of if the Tree object maintains the handle of the tooltip in itemToolTipHandle. If there's a tooltip which is not handled by wmNotifyToolTip, it is completely maintained by windows and hence can span over multiple montiors. Hence, with this PR such tooltips are also positioned inside a single monitor to prevent any infinite loop. Contributes to eclipse-platform#62 and eclipse-platform#128
…e-platform#2162 This reverts commit 807b159. Add regression test. Fixes eclipse-platform#2162
* Use assertThrows * Do not override parent test method so it actually gets executed
Makes it easier to view the text as it appears in the launcher.
This commit adapts the zoom passed to the GC when it is initialized for a plain Image created via Image#Image(Device, int, int) with a given width and height. It will fall back to DPIUtil#getDeviceZoom() again to revert to original bevahiour and prevent blurry rescaling of old usages.
…ipse-platform#2188 When copying an image based on an input stream, the copied provider wrapper was erroneously created on the original image. This change adapts the instantiation to create the warpper on the correct image. Fixes eclipse-platform#2188
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.