We were converting the floating point numbers to integers using a cast,
which causes them to be always rounded down. The result is that a
monitor may be too small by a pixel, creating broken configurations.
Also fix the same issue when calculating whether a scale should be
supported.
See https://gitlab.gnome.org/GNOME/mutter/issues/412
This is a function working only on a configuration which runs the
snapping with infinite snapping. This allows forcing a monitor that has
been modified to be adjacent to at least one monitor.
There was an issue where the "minor" axis snapping would not be done if
the "major" axis snapping had a zero distance. This could be seen when e.g.
moving a monitor on the right up/down slightly. In that case, no
snapping to align the bottom/top edges were done unless you also moved
the mouse sideways a bit.
Fixes#211
This improves the snapping behaviour in a number of ways. It allows
increasing the snapping distance while still helping the user to align
monitors by snapping a different distance for the minor axis. The patch
also allows setting this distance to infinity so that we get the correct
behaviour in the case of two monitors for the corners.
Two monitors are a special case where it is easy to ensure that the
monitors are always adjacent to each other by special casing the
snapping code. Do so by increasing the snapping distance to infinity and
adding extra snapping points so that corner cases are covered.
This adds the following API:
* cc_display_config_get_ui_sorted_monitors
Returns the monitors in UI order
* cc_display_config_count_useful_monitors
Counts the useful monitors (active and usable)
* cc_display_monitor_is_useful
Checks if a monitor is active and usable
* cc_display_monitor_is_useable
Check if a monitor is marked as useable
* cc_display_monitor_set_usable
Used to mark builtin monitors as unusable if the lid is closed
* cc_display_monitor_get_ui_*
Get the UI number and strings for display
https://bugzilla.gnome.org/show_bug.cgi?id=786971
This commits adds a new arrangement widget, refactoring the existing
code and addressing a number of issues:
* Forced snapping made laying out more than 2 monitors hard
* Random gaps would be shown between monitors
* The scaling was fixed and usually tiny
https://bugzilla.gnome.org/show_bug.cgi?id=786971