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

Tackle limitation of point coordinate system #125

Closed
Assignees
Labels
Enhancement A Request for an Enhancement of an Existing Feature HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT
Milestone

Comments

@akoch-yatta
Copy link

akoch-yatta commented Oct 7, 2024

There are some scenarios, e.g. with detached views in the IDE, where point to pixels conversion lead to unexpected results:

Scenario 1 (e.g. detached preview)

Fetch a point are rectangle on one monitor and change it programmatically to another monitor (with a different zoom) before using it again:

Point l = shell.getLocation();
l.x += 30;
shell.setLocation(l);

Scenario 2 (e.g. Eclipse view D&D)

E.g.
Control::getBounds().contains(getCursor)

Scenario 3 (Maximized window)

getBounds with maximized windows -> getBoundsInPixel gives position with x/y shifted by 8 outside of monitor

Follow-up Actions

@akoch-yatta akoch-yatta converted this from a draft issue Oct 7, 2024
@akoch-yatta akoch-yatta added SWT Issue for SWT HiDPI A HiDPI-Related Issue or Feature Enhancement A Request for an Enhancement of an Existing Feature labels Oct 7, 2024
@amartya4256 amartya4256 self-assigned this Oct 7, 2024
@akoch-yatta
Copy link
Author

Improved by PR #1524

@akoch-yatta
Copy link
Author

As discussed in the daily, we will rediscuss this issue and possible solutions

@akoch-yatta akoch-yatta modified the milestones: 4.34 M3, 4.35 M1 Nov 6, 2024
@akoch-yatta akoch-yatta moved this from 👀 In Review to Blocked in HiDPI Nov 6, 2024
@akoch-yatta akoch-yatta moved this from Blocked to 🏗 In Work: Short in HiDPI Dec 2, 2024
@akoch-yatta akoch-yatta self-assigned this Dec 2, 2024
@amartya4256
Copy link

amartya4256 commented Jan 2, 2025

After investigating this issue, we had these options for fixing/redesigning the coordinate system:

  • Having one zoom level for the global coordinate space:
  1. Having 100% for all monitor: The problem that I noticed was in the overlay during the drag and drop not being placed in the right position because of scaling issue.

  2. Having pixels/absolute positioning for all monitors: The main problem with this method so far was that we need the clients to adapt to provide the pixels value especially for set bounds and location for Shells.

  • Having a Coordinate System with gaps: The problem is the gap. If a point is placed in the gap, how should we treat it in terms of scaling.

We have further created some tests to find out what problems lie in this approach: eclipse-platform/eclipse.platform.swt#1699

@HeikoKlare
Copy link
Contributor

2. The main problem with this method so far was that we need the clients to adapt to provide the pixels value especially for set bounds and location for Shells.

I do not fully understand this point: aren't setBounds() and setLocation() (usually) called with some modified values that have previously been retrieved from getBounds()/getLocation()? Or to phrase it differently: are there any sources of objects passed to those setters that have (initially) been explicitly defined in points rather than whatever the according getters yield?

@amartya4256
Copy link

amartya4256 commented Jan 7, 2025

Here are the different Coordinate system specifications along with the major problem associated with them:

Having one zoom level for the global coordinate space:
Having global coordinate space in pixels:

  • 2 different contexts cause the problem of drag and drop not working inside
    Image

Having a different zoom level for each monitor with Gap:

  • Points in the gap are misevaluated because of the absense of zoom context

Having a different zoom level for each monitor with overlapping monitors

  • ambiguous points

@amartya4256
Copy link

amartya4256 commented Jan 7, 2025

According to the last discussion, the plan is to provide zoom context to the rectangles and points which are used in the mappers, consume it while converting from points to pixels and validate if this fixes the bugs in the current MultiZoomCoordinateSystemMapper.

@amartya4256
Copy link

The shell can be created while having another shell as its parent. It means if a shell is on a monitor with a different zoom level, it might still receive a DPI_CHANGED callback from its parent from the different monitor. We need to verify if it can lead to any unprecedented behaviour.

@amartya4256 amartya4256 moved this from 🏗 In Work: Short to 👀 In Review in HiDPI Jan 17, 2025
@fedejeanne
Copy link

This issue is In Review but the linked PRs are inactive. Is eclipse-platform/eclipse.platform.swt#1711 related to this one?

@HeikoKlare
Copy link
Contributor

HeikoKlare commented Jan 18, 2025

Also related to this (but does not completely resolve this):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A Request for an Enhancement of an Existing Feature HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT
Projects
Status: Done
4 participants