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

Fix multiple issues #177

Closed
wants to merge 23 commits into from
Closed

Fix multiple issues #177

wants to merge 23 commits into from

Conversation

felix-andreas
Copy link
Member

@felix-andreas felix-andreas commented Aug 21, 2019

This PR tries to address multiple issues:

  1. Introduce magnetic egde to align monitors and avoid small offsets (Provide magnetic edges #95 ,[Multimonitor] Snap Behaviour in switchboard-plugin-display #40, display settings fail with multiple monitors #38.2)
  2. If monitors are perfectly aligned window snap is broken (Adjusting Display Position Doesn't Work #154)
  3. Currently it is possible to create a gap between monitors (Triple-monitor setup screens not lining up #35.1)
  4. Currently it is possible to create an overlap/intersection between monitors (Triple-monitor setup screens not lining up #35.2)
  5. Releasing the mouse button without moving the widget does not end grab (The display rectangle is "running away" from my pointer #34, Triple-monitor setup screens not lining up #35.4)

I also added a label to show the current monitor geometry. Maybe this is too much, but I think it is useful to check if the monitors are properly aligned.

1./2. Magnetic edge and center:
align-monitors
Can be disabled by pressing Ctrl

3. Close gaps after mouse button release
close-gaps
Should work for all cases with 3 monitors. For 4 and the problem is more complicated.

4. Fix intersection for multiple displays:
fix-intersections

fix multiple issues:

- snap on monitor edges
- fix accidental release
- not possible to create gaps
- fix intersects
- fix wrong snap on release
@felix-andreas felix-andreas marked this pull request as ready for review August 21, 2019 21:54
@felix-andreas
Copy link
Member Author

Ready for review!

Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! To make the review process more speedy and easier on reviewers and to have a cleaner commit history, I would really appreciate it if you would break this up into several smaller pull requests that only make one of these changes per PR

@felix-andreas
Copy link
Member Author

felix-andreas commented Aug 21, 2019

@danrabbit thanks for the fast response! I considered breaking this up into multiple PRs beforehand, but this would make it more complicated in my opinion. The problem is that all of this issues are interdependent. In the first place I just wanted to introduce the magnetic edges. But this functionality would be completely broken without fixing 2.. Unfortunately 2. can not be solved without solving 3. and 4..

Theoretically I could split the 1-4 up into two PRs, but this would require other code in the first PR to just not break things. And this code would then have to be removed in the second PR.

If you want I could separate 5., but it just one line.

@felix-andreas
Copy link
Member Author

Gap detection for more than 3 monitors:
In this PR the gaps are detected by checking if each monitor is connected to another one. For more than three monitors this test is not sufficient, as it possible to create "islands" of connected monitors:
close-gaps-fail
As this problem is more complicated to solve and this PR is already messy enough, I will address this in another PR.

Intersection detection for more than 3 monitors:
The intersection detection on the other hand should work for an arbitrary amount of displays:
intersect-detection-2

@tintou
Copy link
Member

tintou commented Aug 24, 2019

Thanks for this Pull Request, this is highly appreciated. It looks like a huge improvement on the user experience! One thing that I think we don't really need is the show the x,y on the widget, monitors should be aligned because of the magnetic edge (if it's not doing this reliably it's probably a bug). Overall, this looks like a nice touch there!

@felix-andreas
Copy link
Member Author

@tintou in my opinion the x,y-labels provide useful information. It gives the user the certainty that the monitors are properly aligned and also makes it easier to position monitors pixel-perfect if edge alignment is not wanted. I would also argue that especially multi-monitor users which tend to be more "heavy" users would like to have such information. I still removed the labels as it is a different issue.

Back to this PR: To make the review easier, I added some commits to cleanup and concise the code. With the most recent commit this PR has only 50 LOC more than master.

Also I wanted to ask - as completely rewrote the widget-snapping, gap-detection, intersection-detection and widget-alignment algorithms - if it is okay if I would add myself to the Authored by list at the top of the DisplaysOverlay.vala file?

widget was not immediately redrawn/resized when resolution
was changed
@felix-andreas
Copy link
Member Author

@danrabbit after the code cleanup and in contrary to what I initially said, it was with some small modifications possible to break this up into multiple PRs. I will therefore close this PR.

@ma1onso
Copy link

ma1onso commented Aug 31, 2019

Thanks @andreasfelix : )

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.

4 participants