Skip to content

Commit 567ca4b

Browse files
jknockelmtwebster
authored andcommitted
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.
1 parent c0ddf33 commit 567ca4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backends/x11/meta-monitor-manager-xrandr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ meta_monitor_manager_xrandr_update_screen_size_derived (MetaMonitorManager *mana
847847
if (!crtc || !crtc->config)
848848
continue;
849849

850-
if (!have_scaling || scale_mode != META_X11_SCALE_MODE_UI_DOWN)
850+
if (!have_scaling)
851851
{
852852
/* When scaling up we should not reduce the screen size, or X will
853853
* fail miserably, while we must do it when scaling down, in order to

0 commit comments

Comments
 (0)