Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meta-monitor-manager-xrandr.c: screen size fixes
In previous commits, we have fixed "scale-up" fractional mode scaling when done via the display settings UI. However, there is still the matter of meta_monitor_manager_xrandr_update_screen_size_derived() which can be called on anyone's change to the xrandr configuration. Prior to this commit, to work around an issue where CRTCs must be disabled, this function *never* set the correct screen size when scaling up. This has some horrible consequences like breaking edges on the sides of monitors, windows appearing completely offscreen, incorrect workspace previews, etc., so we should *never* do this. Let's instead try to set the correct screen size. If it fails, that's fine because we are doing it via XCB and will merely log the error. It's better than always setting the wrong screen size. Plus, there is reason to think that the screen size will already be correct anyways. In previous commits we already fixed *our* handling of xrandr scaling to correctly update the screen size when the necessary CRTCs are disabled. Hopefully all other tools are doing it correctly as well and we never have to update the screen size here. :) If this prediction proves inaccurate, we can later update this function to (1) check if the screen size actually needs changing and, if it does, then (2) disable any CRTCs that need disabling before changing the screen size and (3) re-enable them after the change of screen size. Unfortunately I don't know if there is a simpler way. In general, we have to be careful to not disable CRTCs too eagerly either because disabling a CRTC is typically quite easily noticed by a user and results in the screen turning black for a moment.
- Loading branch information