-
-
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
(4/5) Multiple Issues: Fix intersections after mouse button release #183
(4/5) Multiple Issues: Fix intersections after mouse button release #183
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
- a more concise widget snapping algorithm - also fixes some issues when the widgets were perfectly aligned
- check intersections after mouse button release: this makes it possible to place a monitor between to others - also fix issue: for 3 and more monitors it was possible to create intersections between monitors
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.
…ors_after_mouse_button_release
…hub.com:andreasfelix/switchboard-plug-display into 2_of_5_snap_monitors_after_mouse_button_release
…_of_5_close_gaps_after_mouse_button_release
….com:andreasfelix/switchboard-plug-display into 3_of_5_close_gaps_after_mouse_button_release
…_5_fix_intersections_after_mouse_button_release
This reverts commit 2ef6b0e.
…_5_fix_intersections_after_mouse_button_release
@andreasfelix It looks like only a pixel gap on-screen so is probably some kind of rounding error - I'll investigate further. |
…hub.com:andreasfelix/switchboard-plug-display into 2_of_5_snap_monitors_after_mouse_button_release
….com:andreasfelix/switchboard-plug-display into 3_of_5_close_gaps_after_mouse_button_release
…_of_5_close_gaps_after_mouse_button_release
…_of_5_close_gaps_after_mouse_button_release
…_of_5_close_gaps_after_mouse_button_release
…_5_fix_intersections_after_mouse_button_release
Does not compile after merging master |
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.
Small gaps still sometimes appear between monitors (as displayed) but I think this may be fixed by part 5/5.
More of a problem is that if a monitor is dropped on top of another, the underlying monitor moves out of the way (even if it has previously been carefully aligned). In my opinion the mis-dropped monitor should be moved to an 'allowed' position instead without moving the remaining monitors.
As it looks like it is intended to drop a monitor between two others, my previous comment regarding moving the dropped monitor can be disregarded. |
(4/5) Split up #177 in different PRs:
Needs to be merged after #182
Changes in this PR: