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

(2/5) Multiple Issues: Snap monitors after mouse button release #181

Merged
merged 18 commits into from
Sep 29, 2019
Merged

(2/5) Multiple Issues: Snap monitors after mouse button release #181

merged 18 commits into from
Sep 29, 2019

Conversation

felix-andreas
Copy link
Member

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

(2/5) Split up #177 in different PRs:

Needs to be merged after #180

Changes in this PR:

Shows that it is now possible to perfectly align montiors. The magnetic edges will be introduced in (5/5).
align-monitors

This is a prep PR needed for the following PRs:
- snap widgets after mouse button release
- close gaps after mouse button release
- fix intersects after mouse button release
- align display_widget edges/center

Changes in this PR
- change the meaning of display_widget.delta:
 from distance of in widget units to distance in monitor/pixel units

The expression
```vala
delta_x = (int)(event.x_root - start_x);
delta_y = (int)(event.y_root - start_y);
```

led to the loss of information and as the distance in widgets units is
always less than the distance in monitor units. There no 1-to-1 mapping
was possible.

With the expression
```vala
display_widget.delta_x = (int) (diff_x / current_ratio);
display_widget.delta_y = (int) (diff_y / current_ratio);
```
a 1-to-1 mapping between the widget units and monitor units is possible
as the integer cast happens after the float division!

- rename move_display to end_grab as the signal is only emitted when the mouse button is released
- introduce new signal called `move_display` which is emitted when widget is moved
- a more concise widget snapping algorithm
- also fixes some issues when the widgets were
  perfectly aligned
@kgrubb kgrubb requested a review from jeremypw September 28, 2019 04:51
@jeremypw
Copy link
Collaborator

I am reviewing #182 which incorporates this PR. I do not think this PR does needs to be merged separately.

@felix-andreas
Copy link
Member Author

@jeremypw, I just wanted to point out, that in #177 danielrabbit asked to split the PR into smaller different PRs:

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

Wouldn't it then not also make sense to merge them separately?

@jeremypw
Copy link
Collaborator

OK, I see you have backported the relevant changes from the 3/5 review so I guess I can merge them separately.

@jeremypw jeremypw merged commit 0335616 into elementary:master Sep 29, 2019
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.

2 participants