Backport all patches to git master for various fixes inc (#1809717)
This commit is contained in:
106
0016-monitor-config-manager-Respect-layout-mode-when-calc.patch
Normal file
106
0016-monitor-config-manager-Respect-layout-mode-when-calc.patch
Normal file
@@ -0,0 +1,106 @@
|
||||
From 531a195cf184b3d81e333dedf83bc51c3f37e97b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
|
||||
Date: Wed, 11 Mar 2020 09:53:17 +0100
|
||||
Subject: [PATCH 16/48] monitor-config-manager: Respect layout mode when
|
||||
calculating CRTC layout
|
||||
|
||||
The scale used when calculating the CRTC layout should only come from
|
||||
the logical monitor scale if the layout mode of the corresponding
|
||||
configuration is 'logical'.
|
||||
|
||||
This fixes an issue where the X11 screen size accidentally got set to a
|
||||
size scaled down by the configured global UI scale.
|
||||
|
||||
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/1107
|
||||
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/1109
|
||||
|
||||
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1118
|
||||
---
|
||||
src/backends/meta-monitor-config-manager.c | 22 +++++++++++++++++++---
|
||||
1 file changed, 19 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c
|
||||
index 2107b7463..5739ca18b 100644
|
||||
--- a/src/backends/meta-monitor-config-manager.c
|
||||
+++ b/src/backends/meta-monitor-config-manager.c
|
||||
@@ -152,6 +152,7 @@ find_unassigned_crtc (MetaOutput *output,
|
||||
typedef struct
|
||||
{
|
||||
MetaMonitorManager *monitor_manager;
|
||||
+ MetaMonitorsConfig *config;
|
||||
MetaLogicalMonitorConfig *logical_monitor_config;
|
||||
MetaMonitorConfig *monitor_config;
|
||||
GPtrArray *crtc_infos;
|
||||
@@ -173,7 +174,7 @@ assign_monitor_crtc (MetaMonitor *monitor,
|
||||
MetaMonitorTransform crtc_transform;
|
||||
int crtc_x, crtc_y;
|
||||
float x_offset, y_offset;
|
||||
- float scale;
|
||||
+ float scale = 0.0;
|
||||
float width, height;
|
||||
MetaCrtcMode *crtc_mode;
|
||||
graphene_rect_t crtc_layout;
|
||||
@@ -209,7 +210,17 @@ assign_monitor_crtc (MetaMonitor *monitor,
|
||||
|
||||
x_offset = data->logical_monitor_config->layout.x;
|
||||
y_offset = data->logical_monitor_config->layout.y;
|
||||
- scale = data->logical_monitor_config->scale;
|
||||
+
|
||||
+ switch (data->config->layout_mode)
|
||||
+ {
|
||||
+ case META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL:
|
||||
+ scale = data->logical_monitor_config->scale;
|
||||
+ break;
|
||||
+ case META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL:
|
||||
+ scale = 1.0;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
crtc_mode = monitor_crtc_mode->crtc_mode;
|
||||
|
||||
if (meta_monitor_transform_is_rotated (crtc_transform))
|
||||
@@ -272,6 +283,7 @@ assign_monitor_crtc (MetaMonitor *monitor,
|
||||
|
||||
static gboolean
|
||||
assign_monitor_crtcs (MetaMonitorManager *manager,
|
||||
+ MetaMonitorsConfig *config,
|
||||
MetaLogicalMonitorConfig *logical_monitor_config,
|
||||
MetaMonitorConfig *monitor_config,
|
||||
GPtrArray *crtc_infos,
|
||||
@@ -307,6 +319,7 @@ assign_monitor_crtcs (MetaMonitorManager *manager,
|
||||
|
||||
data = (MonitorAssignmentData) {
|
||||
.monitor_manager = manager,
|
||||
+ .config = config,
|
||||
.logical_monitor_config = logical_monitor_config,
|
||||
.monitor_config = monitor_config,
|
||||
.crtc_infos = crtc_infos,
|
||||
@@ -324,6 +337,7 @@ assign_monitor_crtcs (MetaMonitorManager *manager,
|
||||
|
||||
static gboolean
|
||||
assign_logical_monitor_crtcs (MetaMonitorManager *manager,
|
||||
+ MetaMonitorsConfig *config,
|
||||
MetaLogicalMonitorConfig *logical_monitor_config,
|
||||
GPtrArray *crtc_infos,
|
||||
GPtrArray *output_infos,
|
||||
@@ -337,6 +351,7 @@ assign_logical_monitor_crtcs (MetaMonitorManager *manager,
|
||||
MetaMonitorConfig *monitor_config = l->data;
|
||||
|
||||
if (!assign_monitor_crtcs (manager,
|
||||
+ config,
|
||||
logical_monitor_config,
|
||||
monitor_config,
|
||||
crtc_infos, output_infos,
|
||||
@@ -395,7 +410,8 @@ meta_monitor_config_manager_assign (MetaMonitorManager *manager,
|
||||
{
|
||||
MetaLogicalMonitorConfig *logical_monitor_config = l->data;
|
||||
|
||||
- if (!assign_logical_monitor_crtcs (manager, logical_monitor_config,
|
||||
+ if (!assign_logical_monitor_crtcs (manager,
|
||||
+ config, logical_monitor_config,
|
||||
crtc_infos, output_infos,
|
||||
reserved_crtcs, error))
|
||||
{
|
||||
--
|
||||
2.26.0.rc2
|
||||
|
||||
Reference in New Issue
Block a user