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

Dragging an editor to another monitor with different zoom is positioning it wrong #78

Closed
akoch-yatta opened this issue Jun 24, 2024 · 1 comment
Assignees
Labels
Bug A Derivation of Expected Behavior HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT

Comments

@akoch-yatta
Copy link

akoch-yatta commented Jun 24, 2024

Important setup: the primary monitor is at 200% and the second monitor is on 100% and placed right from the 200% monitor

The problem occurs, when a view is dragged from the 200% monitor to a position on tje 100% monitor. The new view will not be visible after that, because it is position out of sight.
As far as I have investigated, the flow is as follows:

  1. a new Shell is created und it inherits the zoom from the parent or uses it from the primary monitor (=200%).
  2. the position is set (from WBWRenderer::createWidget) to its target position, e.g. mouse drop at position 4000/200 (is on 100% monitor)
  3. Shell:.setBounds is called with point 4000/200
  4. Shell has zoom of 200% and there the points will scaled up to 8000/400 and positioned out of sight.

There will be no DPI changed event, because the shell was never positioned correctly on the second monitor.

Question is, what is the expected behaviour here. I see two different options:

  1. The caller takes care of this
    Hard to achieve, because the target location comes from the OS (= drop location of the mouse cursor). How should the caller adept to this (windows specific) behaviour
  2. Shell:setBounds takes care of this
    Probably easier to achieve. This would mean that setBounds must be adapted to:
  • calculate monitor where the the shell will be placed onto (see org.eclipse.jface.util.Util::getClosestMonitor)
  • adapt nativeZoom attribute the zoom of the monitor
@akoch-yatta akoch-yatta converted this from a draft issue Jun 24, 2024
@akoch-yatta akoch-yatta added SWT Issue for SWT Bug A Derivation of Expected Behavior HiDPI A HiDPI-Related Issue or Feature labels Jun 24, 2024
@akoch-yatta akoch-yatta self-assigned this Jun 24, 2024
@akoch-yatta akoch-yatta moved this from 🔖 Ready: Atomic to 🏗 In Work: Short in Eclipse Jun 24, 2024
@akoch-yatta akoch-yatta moved this from 🏗 In Work: Short to 👀 In Review in Eclipse Jun 27, 2024
@akoch-yatta akoch-yatta moved this from 👀 In Review to 🏗 In Work: Short in Eclipse Jun 28, 2024
@amartya4256 amartya4256 self-assigned this Jul 16, 2024
@amartya4256 amartya4256 moved this from 🏗 In Work: Short to 👀 In Review in Eclipse Jul 17, 2024
@akoch-yatta
Copy link
Author

Closed with eclipse-platform/eclipse.platform.swt#1349
Remaining limitations are discussed in #125

@github-project-automation github-project-automation bot moved this from 👀 In Review to ✅ Done in Eclipse Oct 7, 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: Done
Development

No branches or pull requests

2 participants