-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
(1/5) Multiple issues: Prep #180
(1/5) Multiple issues: Prep #180
Conversation
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No regressions noticed so far. The new event handling could be simplified a little.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some questions over the way virtual monitor geometries are translated into widget geometries (result in pixel sized gaps on screen) but I think it better to wait until this sequence of PRs is merged before seeing whether this can be improved.
(1/5) Split up #177 into different PRs:
This is a prep PR needed for the following PRs:
Changes in this PR:
change the unit of
display_widget.delta
from widget units to monitor/pixel unitsThe integer cast
should be done after dividing by
current_ratio
. The distance in widgets units isalways less than the distance in monitor units. So doing the integer cast before dividing by
current_ratio
makes it not possible to arbitrary position the monitors as the rounding of doubleleads to information loss .
With the expression
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
toend_grab
as the signal is only emitted when the mouse button is releasedintroduce new signal called
move_display
which is emitted when widget is movedset
holding
always to false if the mouse button is released, which solves (The display rectangle is "running away" from my pointer #34, Triple-monitor setup screens not lining up #35.4)