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

Improving Shell Drag Positioning when placed partially on multi monitors with different zoom levels #111

Open
amartya4256 opened this issue Jul 26, 2024 · 0 comments
Labels
Bug A Derivation of Expected Behavior HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT

Comments

@amartya4256
Copy link

amartya4256 commented Jul 26, 2024

Follows eclipse-platform/eclipse.platform.swt#1349

When a shell is partially placed at multiple monitors with different zoom levels, the layout of the drag and drop is flaky in terms of its bounds. For example, if the monitors have 100% and 200% zoom level respectivel and the shell is placed in such a way that most of its area is on 100% monitor but the DPI_CHANGED event hasn't been sent from Windows (so, the zoom level of the shell is still 200%); if we drag a CTabFolder on top of it, the drag and drog region bounds are drawn in context to 100% zoom monitor, even though the shell is still at 200%. This is because the mapping uses OS.MonitorFromWindow to find which monitor the shell is on, which is inconsistent with the state of the shell since the DPI_CHANGED event hasnt been sent from Windows to inform the shell to rescale to 100%.

Possible solution: Bind the shell with the monitor it is at by providing a private field and package protected getter to obtain the monitor, i.e. where the shell is created & when update the monitor when a DPI_CHANGED event occurs. This way, we always use the monitor associated with the shell for mapping and it also means less OS.MonitorFromWindow calls since at the moment it is called millions of time on the drag event.

@amartya4256 amartya4256 converted this from a draft issue Jul 26, 2024
@amartya4256 amartya4256 added SWT Issue for SWT Bug A Derivation of Expected Behavior HiDPI A HiDPI-Related Issue or Feature labels Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A Derivation of Expected Behavior HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT
Projects
Status: 🔖 Ready: Atomic
Development

No branches or pull requests

1 participant